partitioning dilemma
Aragon Gouveia
aragon at phat.za.net
Fri May 6 00:14:02 UTC 2011
On 05/05/11 22:02, Aragon Gouveia wrote:
> Are you able to boot such partitions? Over here my system is just
> entering a boot loop. BIOS has UEFI disabled, and I know for certain the
> pmbr code is being executed, but not sure if it gets as far as chaining
> to gptboot code.
>
> Here's what I have:
>
> # gpart show ada2
> => 34 468862061 ada2 GPT (223G)
> 34 524254 1 efi (256M)
> 524288 128 2 freebsd-boot (64k)
> 524416 524160 - free - (256M)
> 1048576 67108864 3 freebsd [bootme] (32G)
> 68157440 67108864 4 freebsd (32G)
> 135266304 67108864 5 freebsd-swap (32G)
> 202375168 33554432 6 freebsd-zfs (16G)
> 235929600 201326592 7 freebsd-zfs (96G)
> 437256192 31605903 - free - (15G)
>
> # gpart show ada2s3
> => 0 67108864 ada2s3 BSD (32G)
> 0 2048 - free - (1.0M)
> 2048 2097152 1 freebsd-ufs (1.0G)
> 2099200 8388608 2 freebsd-ufs (4.0G)
> 10487808 33554432 4 freebsd-ufs (16G)
> 44042240 23066624 - free - (11G)
>
>
> GPT and BSD schemes have /boot/pmbr and /boot/boot bootcode
> respectively. GPT partcode applied to partition 2 from /boot/gptboot.
So I've been doing some more experimenting and it looks like my boot
loop was caused by the return in sys/boot/i386/gptboot/gptboot.c:159. I
replaced the return line with an infinite loop, which allowed me to read
gptboot's error message, "no UFS partition was found". Upon further
inspection, it looks like gptboot won't boot off a BSD labeled GPT
partition.
As a workaround I've done:
# gpart show ada2
=> 34 468862061 ada2 GPT (223G)
34 128 1 freebsd-boot (64k)
162 524126 - free - (255M)
524288 524288 2 freebsd-ufs [bootme] (256M)
1048576 67108864 3 freebsd (32G)
68157440 67108864 4 freebsd (32G)
135266304 67108864 5 freebsd-swap (32G)
202375168 33554432 6 freebsd-zfs (16G)
235929600 201326592 7 freebsd-zfs (96G)
437256192 31605903 - free - (15G)
I newfs'd ada2p2 and copied a /boot directory there. I was hoping I'd
be able to instruct loader to use ada2s3a as its rootdev, but alas, not
even loader will read a BSD labeled GPT partition! For now I've also
created /etc/fstab on ada2p2 which allows the kernel to boot from
ada2p2, but mount / from the gmirror volume on ada2s3 and ada3s3. This
seems like such an ugly hack that I'm reconsidering EBR if I can figure
out how to calculate the partition offsets I want.
Any other suggestions appreciated!
Thanks,
Aragon
More information about the freebsd-geom
mailing list