Date: Tue, 30 Oct 2018 14:38:07 -0700 From: Mark Millard <marklmi@yahoo.com> To: Lev Serebryakov <lev@FreeBSD.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org> Subject: Re: How to boot from GPT partition without "bootme" attribute? Message-ID: <B34FD2C6-B74A-48E4-A789-130C9B881D53@yahoo.com>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B34FD2C6-B74A-48E4-A789-130C9B881D53>