Mark Millard
2018-Oct-30 21:38 UTC
How to boot from GPT partition without "bootme" attribute?
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)
Lev Serebryakov
2018-Oct-30 22:59 UTC
How to boot from GPT partition without "bootme" attribute?
Hello Mark, Wednesday, October 31, 2018, 12:38:07 AM, you wrote:>> 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 . . .Maybe, it is kernel from p2 and userland from p3, but anyway, it is not what I want to achieve. I'll add other kernel IDENT for other partition for check, but I'm sure, that p3 is moutned as /. I have different /etc/fstab on different partitions, of course. If kernel on "bootme" GPT partition will be faulty, it will be disaster, as gptboot could not (or I can not find how to) switch "bootme" attribute of GPT partition. I want to migrate my NanoBSD images from MBR to GPT, but I can not find way to easily boot from "previous" partition when "new" one is messed up.> Any chance that that /etc/fstab initially used points > to p3's world for / ?/etc/fstab on p2 points to p2, and /etc/fstab on p3 points to p3, I'm sure. -- Best regards, Lev mailto:lev at FreeBSD.org