Solved Help needed after zfs features upgrade before bootcode upgrade

Hi,
I'm having an issue with bootcode upgrade after zfs features upgrade. FreeBSD's suggestion is this

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0

but this doesn't work because there is no da0. Instead I use ada0, the only SSD fully owned by ZFS. However, the result is an error:

Code:
root@box:/boot # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
gpart: No such geom: ada0.

Geom name not accepted by the looks of it. This is said SSD:

Code:
root@box:/boot # camcontrol devlist
<SanDisk SD8SFAT032G Z2333000>     at scbus0 target 0 lun 0 (ada0,pass0)

And it should have a matching geom label/name:

Code:
root@box:/boot # glabel list
Geom name: ada0
Providers:
1. Name: diskid/DISK-161619400039
   Mediasize: 32017047552 (30G)
   Sectorsize: 512
   Mode: r1w1e2
   secoffset: 0
   offset: 0
   seclength: 62533296
   length: 32017047552
   index: 0
Consumers:
1. Name: ada0
   Mediasize: 32017047552 (30G)
   Sectorsize: 512
   Mode: r1w1e3

Geom label is ada0.

So, what am I doing wrong? Most importantly: how can I prep the boot device with the new bootcode so that it won't halt on next boot? That would be very bad, since the box is in a few 100 km distant colo datacenter with very little FreeBSD knowledge locally ...

Any help much appreciated.
 
Post the output from gpart show.

Instead I use ada0, the only SSD fully owned by ZFS.
It's not that a disk has to be 'owned' by ZFS, it's your boot disk that's important. But really only if you used a zfs-on-root system, in other words if you actually boot from a ZFS filesystem.
 
you should probably read this:


and also the release notes for 13.0 which state, that you should not use gpart for EFI partitions anymore. But as you did not provide gpart show (as SirDice mentioned), we don't know if you are updating an older freebsd-boot partition or a newer ESP.

 
Thanks for your swift replies.

Code:
root@box:/boot # gpart show
=>      34  62533229  diskid/DISK-161619400039  GPT  (30G)
        34         6                            - free -  (3.0K)
        40      1024                         1  freebsd-boot  (512K)
      1064       984                            - free -  (492K)
      2048   4194304                         2  freebsd-swap  (2.0G)
   4196352  58335232                         3  freebsd-zfs  (28G)
  62531584      1679                            - free -  (840K)

The box is (still) running
Code:
12.2-RELEASE-p6
.
 
Then it's no use upgrading the bootcode. You only need to do this after you upgraded to 13.0-RELEASE and only if you upgraded your zpools. I would recommend upgrading to 13.0-RELEASE but NOT upgrading your pools yet. Do that when you're absolutely certain you don't need to go back to 12 anymore. As long as you don't upgrade the pools the original bootcode will be able to work.
 
IIRC, if you want that the name of your disk be ada0, add in loader.conf:
Code:
kern.geom.label.disk_ident.enable="0"

I think this is normaly added by bsdinstall.
Look in /etc/fstab what is referenced inside before to make this change. Because this could prevent your system to boot in multi-user mode.
 
If there's no use upgrading the bootcode [after enabling the pool features (s. below)], then why is zpool reminding me to update the bootcode?

Code:
root@box:/usr # zpool upgrade -a
This system supports ZFS pool feature flags.

Enabled the following features on 'tank':
  large_dnode
  device_removal
  obsolete_counts
  zpool_checkpoint
  spacemap_v2
  allocation_classes

If you boot from pool 'tank', don't forget to update boot code.
Assuming you use GPT partitioning and da0 is your boot disk
the following command will do it:

        gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0

That's what I did (minus the suggestion) to get rid of the persistent messages on e.g. zpool status.

Is this 12.2p6 box able to boot without upgrading the bootcode? That's my most pressing question now, because the server is a remote one.
 
Ok. It's better to update the bootcodes then. Well, gptzfsboot mostly (pmbr stayed the same since longtime). Have you tried with the diskid as geom?
 
IIRC, if you want that the name of your disk be ada0, add in loader.conf:
Code:
kern.geom.label.disk_ident.enable="0"

I think this is normaly added by bsdinstall.
Look in /etc/fstab what is referenced inside before to make this change. Because this could prevent your system to boot in multi-user mode.
Thanks. Will test/do this, once I will be in the same room with that server again. Today I will skip this if it is another potential cause to halt the next boot process.
 
Ok. It's better to update the bootcodes then. Well, gptzfsboot mostly (pmbr stayed the same since longtime). Have you tried with the diskid as geom?
YES, now I have! And it worked:
Code:
root@box:~ # gpart show
=>      34  62533229  diskid/DISK-161619400039  GPT  (30G)
        34         6                            - free -  (3.0K)
        40      1024                         1  freebsd-boot  (512K)
      1064       984                            - free -  (492K)
      2048   4194304                         2  freebsd-swap  (2.0G)
   4196352  58335232                         3  freebsd-zfs  (28G)
  62531584      1679                            - free -  (840K)


root@box:~ # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 DISK-161619400039
gpart: No such geom: DISK-161619400039.
root@box:~ # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 diskid/DISK-161619400039
partcode written to diskid/DISK-161619400039p1
bootcode written to diskid/DISK-161619400039
root@box:~ #

Thank you very much!! To all of you who've contributed. Thanks a lot!
 
Back
Top