From nobody Thu May 05 22:21:00 2022 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 A66931ACAB3D for ; Thu, 5 May 2022 22:15:16 +0000 (UTC) (envelope-from jwmaag@gmail.com) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvSgR53TWz3n7M for ; Thu, 5 May 2022 22:15:15 +0000 (UTC) (envelope-from jwmaag@gmail.com) Received: by mail-yb1-xb35.google.com with SMTP id w187so9991606ybe.2 for ; Thu, 05 May 2022 15:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HeloBSN9MjOIB0aa398tsYHXq25CMPbVkHfG0bCUD9Y=; b=BP/Nd6ILB0Ra+ue/2a3hqVRNyoFU8DE6NYSXC81M9tCVoGanoEbk5p7ldzz+cqgRge 8FlAqRQFlnFq2J3HhBf+8xB5JiEKxAEnCWyVjm/Pit1IAJK5RIGCpm2LXluw1B1YN9KM n8FQ+2QfTZpmTc8iOxX/KSm6LTJvx8hiy7n3aS0/VSchNUu7N7887rgexFPf3Acvt27F hW1Y2xCmfzLErTq9XQAawWdVMv0rPBetGCtSnTF3iBIKJnBZg53yMQ9JBy8aI6LbK6NF fPsLbJDM2Tk1NC5549rHu0WSK7F7EeHO61VNcR5h3MdE5gvN4vsAOw0aA6bTOr3cixrQ kLdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HeloBSN9MjOIB0aa398tsYHXq25CMPbVkHfG0bCUD9Y=; b=jE6x2aRGthxMl+nn6VaHpNjXAzU/Awt725uxwk8CCT06aWqIwcJuNhMAoYhyOGxmM4 3mZUsPMlGN3AGBuvFgI27ygGKLJ4Y25G8WVZ0l7Ucsp4tUde45Q6cV7YilTCaaJRwt2j 2vSXY2uAiNR9A7Q33oxiDnPZMLOjLVvujk8SF/ZQ7+gtn+0XG6eYQmmQ8ZpLeuW0VQNp AsKALxuifejVSJJySXYErxpt9vVkx6gTXWpmYaA50PeEqSHid7Kk4tfpUjzzllxWZljZ ZRmLr0kJDEEMvWhs12IvjRptg8wwg2z3DeLc9gONqMmDUZX0tlYOnqFXAdxxlF77Ubt2 NOTQ== X-Gm-Message-State: AOAM531XrPqKsZzh/ORwCL2L/UXJABXl+fRGGRpqe/V5lvYi9X1XGkHy OmNnjbZudiDPtqwJmX9v092TDGjTLB/r2bT5Id1pGp+feJs= X-Google-Smtp-Source: ABdhPJw96PNqviRSlOJ1Obldpurom5otKEb3AQAIrEq9DXwagKU0iBjJGG7Bq4wAeMOWTGSFcOgkMNuJ1MWWaNuJuyc= X-Received: by 2002:a25:4506:0:b0:648:cfc2:301d with SMTP id s6-20020a254506000000b00648cfc2301dmr274862yba.380.1651788915013; Thu, 05 May 2022 15:15:15 -0700 (PDT) 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 References: In-Reply-To: From: Wes Maag Date: Thu, 5 May 2022 17:21:00 -0500 Message-ID: Subject: Re: FreeBSD, boot environments and /dev To: Michael Schuster Cc: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="00000000000085ff5605de4b13ed" X-Rspamd-Queue-Id: 4KvSgR53TWz3n7M X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="BP/Nd6IL"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jwmaag@gmail.com designates 2607:f8b0:4864:20::b35 as permitted sender) smtp.mailfrom=jwmaag@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b35:from]; MLMMJ_DEST(0.00)[freebsd-current]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000085ff5605de4b13ed Content-Type: text/plain; charset="UTF-8" On Thu, May 5, 2022 at 4:10 PM Michael Schuster wrote: > Hi all, > > while still working (slowly) on an answer to my own question on the > right workflow to keep current up to date reliably with boot > environments, I noticed that after creating and mounting a new BE, > that new BE's /dev (eg /mnt/dev) is very sparsely populated: > > [22:44:45: ~ 0] $ ll /mnt/dev > total 20 > 9 dr-xr-xr-x 4 root wheel 7 Apr 18 00:35 . > 9 drwxr-xr-x 23 root wheel 30 May 5 22:44 .. > 1 drwxr-xr-x 2 root wheel 2 Apr 18 00:35 fd > 1 lrwxr-xr-x 1 root wheel 12 Apr 17 20:41 log -> /var/run/log > 1 -rw-r--r-- 1 root wheel 63 May 3 22:19 null > 1 -rw-r--r-- 1 root wheel 1 May 3 22:18 null.bak > 1 drwxr-xr-x 2 root wheel 2 Apr 18 00:35 shm > [22:44:48: ~ 0] $ > > (no matter whether I use "beadm create" or "bectl create -r") > > I can then mount devfs: > # mount -t devfs devfs /mnt/dev > > and it will look (and work) as expected (eg for "pkg -c /mnt update" > (*)) ... as long as the BE is mounted. > When I try to boot from (into?) that BE though, it fails, and on the > console I can see messages about missing /dev/... entries. I sneaked a > peek into beinstall.sh, found no inspiration there, I'm afraid. > > I believe I noticed this apparent requirement to mount devfs > separately not so long ago ... definitely this year, while I've been > experimenting with boot environments for quite a bit longer. Was I > just lucky all along, or did something change ... and, more > importantly, how do I make my boot environments bootable again? > > TIA for hints, pointers, advice > Michael > > *) I first noticed something was amiss when "pkg -c /mnt ... " > complained about /dev/null missing, IIRC ... > -- > Michael Schuster > http://recursiveramblings.wordpress.com/ > recursion, n: see 'recursion' > > getting /dev/null errors with pkg -c makes sense. I wouldn't expect /dev to contain anything after a create. Why it is not populated on boot seems odd to me though... It's possible, if you created a deep boot environment, you created a pool/ROOT/dev dataset and it is overwriting the initial /dev from boot (I have not tested this theory). Tough to say without more information about the BE layout, and maybe a look at fstab. FWIW I typically run "pkg -r /tmp/be_mount.XXXX" after mounting with "bectl mount" which should give you the same effect as -c without the rooted devfs requirement -- Wes --00000000000085ff5605de4b13ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, May 5, 2022 at 4:10 PM Michae= l Schuster <michaelsprivate= @gmail.com> wrote:
Hi all,

while still working (slowly) on an answer to my own question on the
right workflow to keep current up to date reliably with boot
environments, I noticed that after creating and mounting a new BE,
that new BE's /dev (eg /mnt/dev) is very sparsely populated:

[22:44:45: ~ 0] $ ll /mnt/dev
total 20
9 dr-xr-xr-x=C2=A0 =C2=A04 root=C2=A0 wheel=C2=A0 =C2=A07 Apr 18 00:35 . 9 drwxr-xr-x=C2=A0 23 root=C2=A0 wheel=C2=A0 30 May=C2=A0 5 22:44 ..
1 drwxr-xr-x=C2=A0 =C2=A02 root=C2=A0 wheel=C2=A0 =C2=A02 Apr 18 00:35 fd 1 lrwxr-xr-x=C2=A0 =C2=A01 root=C2=A0 wheel=C2=A0 12 Apr 17 20:41 log ->= /var/run/log
1 -rw-r--r--=C2=A0 =C2=A01 root=C2=A0 wheel=C2=A0 63 May=C2=A0 3 22:19 null=
1 -rw-r--r--=C2=A0 =C2=A01 root=C2=A0 wheel=C2=A0 =C2=A01 May=C2=A0 3 22:18= null.bak
1 drwxr-xr-x=C2=A0 =C2=A02 root=C2=A0 wheel=C2=A0 =C2=A02 Apr 18 00:35 shm<= br> [22:44:48: ~ 0] $

(no matter whether I use "beadm create" or "bectl create -r&= quot;)

I can then mount devfs:
# mount -t devfs devfs /mnt/dev

and it will look (and work) as expected (eg for "pkg -c /mnt update&qu= ot;
(*)) ... as long as the BE is mounted.
When I try to boot from (into?) that BE though, it fails, and on the
console I can see messages about missing /dev/... entries. I sneaked a
peek into beinstall.sh, found no inspiration there, I'm afraid.

I believe I noticed this apparent requirement to mount devfs
separately not so long ago ... definitely this year, while I've been experimenting with boot environments for quite a bit longer. Was I
just lucky all along, or did something change ... and, more
importantly, how do I make my boot environments bootable again?

TIA for hints, pointers, advice
Michael

*) I first noticed something was amiss when "pkg -c /mnt ... " complained about /dev/null missing, IIRC ...
--
Michael Schuster
http://recursiveramblings.wordpress.com/
recursion, n: see 'recursion'

=C2=A0
getting /dev/null errors with p= kg -c makes sense. I wouldn't expect /dev to contain anything after a c= reate.

Why it is not populated on boot seems odd t= o me though... It's possible, if you created a deep boot environment, y= ou created a pool/ROOT/dev dataset
and it is overwriting the init= ial /dev from boot (I have not tested this theory). Tough to say without mo= re information about the BE layout, and maybe a look at fstab.

FWIW I typically run "pkg -r /tmp/be_mount.XXXX"= after mounting with "bectl mount" which should give you the same= effect as -c without the rooted devfs requirement

=
--
Wes
=C2=A0
--00000000000085ff5605de4b13ed--