Solved gpart bootcode question

Hi,
basically I am following this guide:

http://www.wonkity.com/~wblock/docs/html/disksetup.html

because I would like to try "manual" FreeBSD installation on a disk (I mean, without bsdinstall).
Just for study purpose.

I created GPT scheme and the first boot partition.
My doubt belongs to this command:

Code:
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0

Is it unclear to me if -b /boot/pmbr and -p /boot/gptboot -i 1 are mutually exclusive.
I read gpart manpage (bootcode section), but I don't understand very well.
Any help?
Thank you!
 
They do different things, -b /boot/pmbr installs the protective MBR code on the first sector of the disk, the -p /boot/gptboot -i 1 option writes the GPT bootcode on the first GPT partition of the disk, this partition should be of type freebsd-boot. Both are needed to boot a GPT partitioned disk on a BIOS only system or on a system where the UEFI firmware is in legacy/CSM mode.
 
-p /boot/gptboot -i 1
You will see the -i flag used alot on FreeBSD disk utilities and it was confusing to me in the begining.
-i is partition index number. You can find the index number by looking at gpart show. Contrast that with gpart show -p.
The -p flag here shows the partition name instead of partition index number.
Knowing how -i works will greatly help you in advanced disk procedures, like growing a partition.
 
Back
Top