Minimum size of freebsd-boot

Michael Sierchio kudzu at tenebras.com
Thu Jun 21 16:41:06 UTC 2018


It's worth mentioning that if you're going to reuse a disk with a gpart
table already on the disk, do something to remove it

offset=`diskinfo $DISK | awk '{ print $4 - 129 }'`

dd if=/dev/zero of=/dev/$DISK bs=64k count=1

dd if=/dev/zero of=/dev/$DISK seek=$offset


On Thu, Jun 21, 2018 at 9:39 AM, Michael Sierchio <kudzu at tenebras.com>
wrote:

>
>
> On Thu, Jun 21, 2018 at 9:15 AM, Manish Jain <jude.obscure at yandex.com>
> wrote:
>
>
>>
>> > Under GPT, FreeBSD needs a freebsd-boot partition of max size 512 KB...
>
> Not so. 64k works just fine. The binary /boot/gptboot is 60258 bytes. A
> snippet of the code I use to build hosts. Note that subsequent partitions
> are forced to be aligned on 64k boundaries.
>
> # add boot partition
>
> # p1
>
> gpart add -t freebsd-boot -l ${PFX}-boot -s 64k ${DISK}
>
>
> # put boot code in boot partition
>
> gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ${DISK}
>
>
> # add root, make sectors aligned
>
> # p2
>
> gpart add -t freebsd-ufs -l ${PFX}-root -a 64k -s ${ROOTSIZ} ${DISK}
>
>
>
>
>
> --
> "Well," Brahma said, "even after ten thousand explanations, a fool is no
> wiser, but an intelligent person requires only two thousand five hundred."
>
> - The Mahābhārata
>



-- 
"Well," Brahma said, "even after ten thousand explanations, a fool is no
wiser, but an intelligent person requires only two thousand five hundred."

- The Mahābhārata


More information about the freebsd-questions mailing list