Netgate SG-1000 microFirewall

Author Topic: Can't write boot code to ZFS replacement drive  (Read 124 times)

0 Members and 1 Guest are viewing this topic.

Offline vitaprimo

  • Newbie
  • *
  • Posts: 19
  • Karma: +1/-0
    • View Profile
Can't write boot code to ZFS replacement drive
« on: December 04, 2017, 01:58:29 am »
I just replaced a drive from a ZFS mirror following the advice in the ZFS sticky, the command line's and some blog I found; I was able to replace the drive successfully, actually it was easier than I though it was gonna be, but in the last step I'm asked to write the boot code but it won't let me.



I did zpool status and the array is full online. I had like 5min downtime. 😁

Offline droeders

  • Newbie
  • *
  • Posts: 9
  • Karma: +2/-0
    • View Profile
Re: Can't write boot code to ZFS replacement drive
« Reply #1 on: December 04, 2017, 01:39:04 pm »
Try running the following sysctl, and then re-run the gpart command:

Code: [Select]
sysctl kern.geom.debugflags=0x10

Offline vitaprimo

  • Newbie
  • *
  • Posts: 19
  • Karma: +1/-0
    • View Profile
Re: Can't write boot code to ZFS replacement drive
« Reply #2 on: December 04, 2017, 01:50:32 pm »
[2.4.2-RELEASE][root@ FQDN]/root: sysctl kern.geom.debugflags=0x10
kern.geom.debugflags: 0 -> 16

[2.4.2-RELEASE][root@FQDN]/root: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
gpart: /dev/ada0p1: Operation not permitted

Then I went rogue and tried my own:

[2.4.2-RELEASE][root@FQDN]/root: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0p1
gpart: No such geom: ada0p1.

As you may see, I have no clue how disk geometry works. 😂 I'm very happy I didn't for more than a few minutes offline though, now I have time to schedule a reinstall. Whoever came up with backup & restores on pfSense is a f*cking genius! They way packages reinstall themselves and everything is back as before it just amazing. Thanks for your help!