How to boot from GPT partition without "bootme" attribute?
Mark Millard
marklmi at yahoo.com
Tue Oct 30 21:38:12 UTC 2018
Lev Serebryakov lev at FreeBSD.org wrote on
Tue Oct 30 18:37:14 UTC 2018 :
> I have disk with GPT scheme and three partitions:
>
> p1 - freebsd-boot
> p2 - freebsd-ufs
> p3 - freebsd-ufs
>
> pmbr is installed on this disk, and gptboot is installed on p1. Both p2
> and p3 contains valid FreeBSD installation, with /boot/loader, kernel,
> and everything.
>
> I have attribute "bootme" set on p3, but not on p2.
>
> What should I do to boot from p2?
>
> I've tried to interrupt gptboot and override its choice:
>
> 0:ad(0p3)/boot/loader
>
> with
>
> 0:ad(0p2)/boot/loader
>
> After that loader, loaded from p2, loads kernel from p3 and boots
> system from p3!
Are the kernel's on p2 and p3 distinct in an identifiable way?
Can you be sure it was not a mix of the p2 kernel and p3 world
that booted? I ask because . . .
One way to control what world is booted is to adjust the
/etc/fstab where the /boot/kernel/kernel is loaded from,
having that /etc/fstab to point to a different / area. I do
this on small, single board computers to get the kernel
from a microsd card but world from a USB storage media
device. (I tend to use some form of labeling style
reference to avoid device numbering dependencies.) The
/etc/fstab where world is from has / agreeing and directs
swap partition bindings and such that are appropriate to
the specific world.
(I've frequently had a world on the microsd card that the
initial /etc/fstab can be edited to point to. This gives
me a way to boot if there is a problem for the USB media.)
I've done such things in gpt and non-gpt contexts.
Any chance that that /etc/fstab initially used points
to p3's world for / ?
There are also things like /boot/loader.conf having
something like:
vfs.root.mountfrom='ufs:/dev/gpt/MyRoot'
to control where things are booted from.
> If I have MBR, I could override "active" slice in boot0 MBR loader
> interactively.
>
> Is it analogous feature for GPT?
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
More information about the freebsd-stable
mailing list