From owner-freebsd-stable@freebsd.org Tue Oct 30 21:38:12 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23C1210F593E for ; Tue, 30 Oct 2018 21:38:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-35.consmr.mail.ne1.yahoo.com (sonic317-35.consmr.mail.ne1.yahoo.com [66.163.184.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B59F17BE3E for ; Tue, 30 Oct 2018 21:38:11 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 1nN8K0YVM1mHl6EkHobwYqiMbvGWY9jd8iOS.ODGN._TJy.iWXByzDuY890dd9f 566kQJF0I9qhKFvXEC.YW5HKIvnln4EngFkfiFxS0nJfM4IfvAKrqgWiuJlxWmDXx.Cmm7TicTUt 90.yvpOjPcBKlclmKgdeDU1VmhOAJ6ZRgJt.NdG3aD9JShAngbgnVouEnc9hY__A6ire949X0HI0 Q71BRJWKkwMx1hfMy7lwrwXgKD5ssVYxb8aEqF2VCkG2zV21uY8uAf6z_WYKUdPtbAjBQOG235BR 4ibksINdlLetnvEsO4FqISthevdaXB_UtmWoLrugVTwmsC5V2oE0gA7.Y6cqxG02gl5NVPSsZVgr HhLXTj_Cdd4LZ5NaDgAUtomzxAM8ptzBcdcO_dqc9Bly3sYI8ddqy64HONgqtVbe7BuMzQJeujvq xInqJweazO5vty6SLSGDq_M8naeHeBRE60ETsWj.q1PUT.xBKXmLwv3mS2IHhOT_NGcrCkeSr0j_ Pn72BpJ7Yt0tWzHTAYQMoSJF7tPkpK_ZOoTFrtWybsDtbXeIKZbnjxMOJRWCuWoSGQsPF4yfKd8G qNNgj795DgPHRnixstxT.1jT_CzxZ5wURiJHBBxXMpiUMftvUWdgVFszLUJfl68GMWDjAOdq3TUg 5cKS45TQPeF4SmVZ33DEinLUHA2l8e9BeEFZwJrvDsK9IOKdm6ZjI8cIeI8Gb1wCHz5wLex7asZZ IXBxx3jMm7OWpY54fGsOMhepDGHSZq.961.MCu.B34B_MWOVPt5xwkLyw.bnria1OdgL7zfXjUjz z6iHrsqT1xzeB4sIs3l3.UK09I248uVW9rwG2pgxh6y87iOffaZI9QXt6W7L49SOrFDVBTXHAAhe Igzi5a8t4WNhx5EUDWhcFnZDkq9l47GCi9YYVVjEbcyu9USgwA6uTOMQbm5MtnyuygR46rPoh1S0 V2OsMYSgiMr07zX0ux7ZFLfB_985F_vBVd4lvOeJeWlZ8_qr0w2BUkt_nqccV2AhFW.GmRr94tM9 wT9_iw_OVx_fwCuDseMPiYotlIYpN2AN4pxB1U4nRJ15z6A-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 30 Oct 2018 21:38:10 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp421.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 10bafcd5dbef4b676b2eac7cb176b7a2; Tue, 30 Oct 2018 21:38:08 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: How to boot from GPT partition without "bootme" attribute? Message-Id: Date: Tue, 30 Oct 2018 14:38:07 -0700 To: Lev Serebryakov , FreeBSD-STABLE Mailing List X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:38:12 -0000 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)