Bug 211503 - gpart bootcode should have an easier way to specify partition index
Summary: gpart bootcode should have an easier way to specify partition index
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-01 15:34 UTC by Eric van Gyzen
Modified: 2019-01-09 23:37 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric van Gyzen freebsd_committer 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 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.