From nobody Sun Jun 30 15:23:21 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WBtHH2qlrz5Pv1t for ; Sun, 30 Jun 2024 15:23:39 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (pdx.rh.CN85.dnsmgr.net [65.75.216.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WBtHG1twgz4HRJ for ; Sun, 30 Jun 2024 15:23:38 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=gndrsh.dnsmgr.net; spf=pass (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net designates 65.75.216.6 as permitted sender) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 45UFNLEU009632; Sun, 30 Jun 2024 08:23:21 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 45UFNLnX009631; Sun, 30 Jun 2024 08:23:21 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202406301523.45UFNLnX009631@gndrsh.dnsmgr.net> Subject: Re: Booting in bhyve always sets currdev to ZFS In-Reply-To: To: Rick Macklem Date: Sun, 30 Jun 2024 08:23:21 -0700 (PDT) CC: FreeBSD CURRENT X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.58 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.99)[-0.995]; NEURAL_HAM_SHORT(-0.79)[-0.790]; DMARC_POLICY_ALLOW(-0.50)[gndrsh.dnsmgr.net,none]; R_SPF_ALLOW(-0.20)[+ip4:65.75.216.0/23]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:10494, ipnet:65.75.216.0/23, country:US]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@FreeBSD.org]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4WBtHG1twgz4HRJ > On Fri, Jun 28, 2024 at 6:26?PM Rick Macklem wrote: > > > > Hi, > > > > I've installed FreeBSD current in a bhvye instance. Everything > > went ok, with UFS as a root partition. > > Then I created a zpool in another partition... > > - Now, every time I boot it I have to > > OK set currdev=disk0s1a: > > to get it to boot. > > > > What is the trick to keep ZFS from messing up the boot variables? > I've been poking around, but haven't learned much. > I think it is userboot (although there are so many boot programs in /boot, > I am not 100% sure?) that sets currdev=zfs:example: since it sees there is ZFS > in a partition on the drive. It is not the boot partition and doesn't have > any boot stuff in it. > > When I look at userboot, it appears that it always sets userboot_zfs_found > to 1 whenever userboot_zfs_probe() is called, given that there is a ZFS > partition with a pool on it. This makes extract_currdev get set to the > ZFS stuff, > assuming I am reading the code correctly. > What I do not understand is why I have not seen this before? > (Was the a change to building it with USERBOOT_ZFS_SUPPORT done?) > > It seems that userboot_zfs_probe() should check for boot files on the volume > and not just that a pool exists on the partition, maybe? > > Anyhow, manually setting currdev=disk0s1a: gets around the problem. You should be able to set that in your ufs partition /boot/loader.conf file and at least then your not having to drop to the OK prompt and manually entering this. There is much magic in boot code that bites, and not just in FreeBSD. Often assumptions are made that "this" boot code, and "this" OS are the only things on the disk(s). The fact that Linux uses a "apple-zfs" uuid, and FreeBSD a "FreeBSD-zfs" drove me nuts for 2 days until I found this little tid bit. Zpool import doesnt care, but the boot code does! -- Rod Grimes rgrimes@freebsd.org