Bug 211503

Summary: gpart bootcode should have an easier way to specify partition index
Product: Base System Reporter: Eric van Gyzen <vangyzen>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People CC: adamw, chris, grahamperrin, ler, vsasjason
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264090

Description Eric van Gyzen freebsd_committer freebsd_triage 2016-08-01 15:34:42 UTC
When installing bootcode to a partition, the user needs to find the right partition index.

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

This is tedious and error-prone.  The bootcode command should take an alternative parameter that specifies the partition in a more user-friendly way.  My first idea is -t <type>, such as

    gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -t freebsd-boot da0

This would install to the first freebsd-boot partition on da0.

Perhaps another option is to use the partition's label, which would be even more user-friendly.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2019-01-09 22:24:15 UTC
At the very least, the output of `zpool upgrade` should say to replace `-i 1` with the slice number of the freebsd-boot partition. Following the instructions it gives you is a great way to destroy a root-on-zfs EFI system.