I tried to making USB memory stick using GPT partition table scheme. I usually use 152 entries to aligning 4KB boundary for data disk(start location) and use 156 entries to aligning 4KB boundary for system disk(end location, misalignment of start location is used for boot code and make 4KB aligned root partition). I don't like that some "free" sectors on disk :-) But, it failed to boot when partition entry count is adjusted to more than 128. * WORKS : 128 entries GPT(1st usable sector = 34) with freebsd-boot partition at sector 34, 40. * DOESN'T WORK : 152 entries GPT(1st usable sector = 40) with freebsd-boot partition at sector 40, 156 entries GPT(1st usable sector = 41) with freebsd-boot partition at sector 41. Yes, There's no problem with default size GPT partition table. "128 entires" - minimum entry count by spec. - seems to be sufficient at most cases. But, that can be arbitrary size and should be supported even that cases. I think there's some issue on gpart or early-stage boot loader(/boot/pmbr). How-To-Repeat: * For example, USB disk is da0 here. # gpart create -s gpt -n 152 da0 # gpart add -t freebsd-boot -b 40 -s 32 -i 1 da0 # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0 and try to boot USB. It should be show "clockwise" loading screen even no freebsd-ufs partition on USB, but it doesn't show anything and reboot immediately. It(doesn't say anything and reboot) occurs with /boot populated freebsd-ufs partition, too.
Responsible Changed From-To: freebsd-amd64->freebsd-fs reclassify.
Using more entries to pad out the table isn't the normal way to handle 4k alignment. You can just leave a gap before the start of freebsd-boot. Having the sectors "free" vs having them contain zero'd GPT entries doesn't really make a difference. One question is when does the boot break? Does it make it into the loader and break trying to boot the kernel? Does it make it into gptboot and break trying to load the loader? -- John Baldwin
That's right. Actually there's no any differences - between "free" sectors to "empty entries". In most cases 128 entries will be sufficient I said before. And I know that's not preferred way to align partitions. But, GRUB2 works even that cases. Of course that isn't GNU extension. Because of there's no any differences except total entry count, I think it should be work. I think there's some problem loading freebsd-boot partition. When I selected USB stick at boot menu, I can't see anything except black screen and it reboots immediately. If it boots correctly, it should display loading screen - rotating animation - and (if freebsd-ufs partition exists and /boot populated) Greeting message such as "BTX Loader 1.00 BTX Version is 1.02", then "Welcome to FreeBSD". I checked that behavior with work cases(128 entries, different boot partition's start location), and I found that it should display "rotating animation" even there's not exist later-step bootloader files in /boot; In that case, it automatically reboots after shows that animation because there's no freebsd-ufs partition. * I'm first use of FreeBSD's bug reporting system and it causes some confusion to me. I replied same mail to John, but not bug-followup system and I guess it is what my reply doesn't seen on bug tracking system. I hope that send reply mail to this address is right...
*** This bug has been marked as a duplicate of bug 175086 ***