From nobody Sat Nov 19 21:31:42 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 4NF6L351fJz4j2RR for ; Sat, 19 Nov 2022 21:31:55 +0000 (UTC) (envelope-from mira@chlastak.cz) Received: from mxb-1-3f7.seznam.cz (mxb-1-3f7.seznam.cz [IPv6:2a02:598:128:8a00::1000:3f7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "email-registrator.ops.iszn.cz", Issuer "Servers 2022.1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NF6L318vGz3G6j for ; Sat, 19 Nov 2022 21:31:55 +0000 (UTC) (envelope-from mira@chlastak.cz) Authentication-Results: mx1.freebsd.org; none Received: from email.seznam.cz by smtpc-mxb-68545b7b84-q2m5b (smtpc-mxb-68545b7b84-q2m5b [2a02:598:128:8a00::1000:3f7]) id 17a7e74f9b6771bb15d07274; Sat, 19 Nov 2022 22:31:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emailprofi.seznam.cz; s=szn20221014; t=1668893506; bh=rmGjO+2iIDRXh+vG4MNZIeVzwix+XV+6O+Uqq5oXHlA=; h=Received:From:Message-Id:Content-Type:Mime-Version:Subject:Date: In-Reply-To:Cc:To:References:X-Mailer; b=B/EWe7kkUiYL3e2J0uY1WcNl10fPUCpR66uVccMS6qsiZHAfmF0k9oHBSb3eFJNRo WUOR6I5s9qRP3CIp0UJM2FfLE97j/WBVPDapqqJUjW2Wpd4mXU1hSzEzf7YYurTgGz Ikr1OjypWxRGI0GIBg7sw2R8QE4D37xrdOMuEGYPNQiakESnDHgU0FWU/32A3fJxkB XvmE2Bxg5UBjVrX2tBUtepsvb/tLeGTa2xIrWHbs30vi81Mkru/kpyqnkt0Woh7RCY SMBE3DpAvkfIqFPkkE5lQfNFw6gTmgqZofqNT5wMLgicp01qTXsPhECoWGA5h5fnL8 ZeKqe6F2TyJUA== Received: from [10.10.100.102] (cust.uvtnet.cz [185.63.97.36]) by email-relay4.ng.seznam.cz (Seznam SMTPD 1.3.140) with ESMTP; Sat, 19 Nov 2022 22:31:44 +0100 (CET) From: =?utf-8?Q?Chlast=C3=A1k_Miroslav?= Message-Id: <97A75B5E-6C38-4CFB-9978-7E254595D980@chlastak.cz> Content-Type: multipart/alternative; boundary="Apple-Mail=_50BCB33F-6C39-4359-A528-FC4EA71B940C" 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 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: loader.conf and rootdev option for memory disk Date: Sat, 19 Nov 2022 22:31:42 +0100 In-Reply-To: <20221120055845.366367f1d371ae4d6eb8d747@dec.sakura.ne.jp> Cc: FreeBSD CURRENT To: Tomoaki AOKI References: <2E58D34B-F8C5-4291-B019-9E24F56DC3DF@chlastak.cz> <20221120055845.366367f1d371ae4d6eb8d747@dec.sakura.ne.jp> X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Rspamd-Queue-Id: 4NF6L318vGz3G6j X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:43037, ipnet:2a02:598::/32, country:CZ] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_50BCB33F-6C39-4359-A528-FC4EA71B940C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Look at the file /boot/defaults/loader.conf: =E2=80=A6 ### Initial memory disk settings ########################### #mdroot_load=3D"YES" # The "mdroot" prefix is arbitrary. #mdroot_type=3D"md_image" # Create md(4) disk at boot. #mdroot_name=3D"/boot/root.img" # Path to a file containing the image. #rootdev=3D"ufs:/dev/md0" # Set the root filesystem to md(4) = device. =E2=80=A6 =E2=80=94 Mira > On 19 Nov 2022, at 21:58, Tomoaki AOKI = wrote: >=20 > IIUC, rootdev should be set in loader.env, if needed. > `man 5 loader.conf` has nothing about rootdev variable. >=20 > (It's undocumented, IIRC.) >=20 >=20 > On Sat, 19 Nov 2022 19:57:47 +0100 > Chlast=C3=A1k Miroslav > = wrote: >=20 >> I have my device working for now - but the question is - Is the = documentation and example for =E2=80=9Crootdev=E2=80=9D right or not? >>=20 >> =E2=80=94 >> Mira >>=20 >>> On 18 Nov 2022, at 21:13, Warner Losh > wrote: >>>=20 >>>=20 >>>=20 >>> On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k Miroslav = >> wrote: >>> Hi all, >>>=20 >>> In the /boot/defaults/loader.conf are these options for memory disk = settings: >>>=20 >>> #mdroot_load=3D"YES" # The "mdroot" prefix is = arbitrary. >>> #mdroot_type=3D"md_image" # Create md(4) disk at boot. >>> #mdroot_name=3D"/boot/root.img" # Path to a file containing the = image. >>> #rootdev=3D"ufs:/dev/md0" # Set the root filesystem to md(4) = device. >>>=20 >>>=20 >>> But - is this example for rootdev option still right? Because = =E2=80=9Cufs:/dev/md0=E2=80=9D works fine on freebsd 12.1, but on = freebsd 12.3 this does not work and generates error message: >>>=20 >>> Can=E2=80=99t determine root device >>>=20 >>>=20 >>> When I use this option with value =E2=80=9C/dev/md0=E2=80=9D or = =E2=80=9Cmd0=E2=80=9D (even with this option commented out), so the = machine boots correctly without any error. >>>=20 >>> I think you want vfs.root.mountfrom=3D instead of rootdev=3D here. >>>=20 >>> Warner >>>=20 >>> =E2=80=94 >>> Mira >>=20 >=20 >=20 > --=20 > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E [Tomoaki AOKI] = > --Apple-Mail=_50BCB33F-6C39-4359-A528-FC4EA71B940C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Look = at the file /boot/defaults/loader.conf:

=E2=80=A6
###  Initial memory disk settings =  ###########################
#mdroot_load=3D"YES= "              # The "mdroot" prefix = is arbitrary.
#mdroot_type=3D"md_image"   =       # Create md(4) disk at boot.
#mdroot_name=3D"/boot/root.img"   # Path to a file = containing the image.
#rootdev=3D"ufs:/dev/md0" =         # Set the root filesystem to md(4) = device.
=E2=80=A6

=E2=80=94
Mira

On 19 Nov 2022, at 21:58, Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:

IIUC, rootdev should be set in = loader.env, if needed.
`man 5 loader.conf` has nothing about rootdev = variable.

(It's = undocumented, IIRC.)


On Sat, 19 Nov 2022 19:57:47 +0100
Chlast=C3=A1k Miroslav = <mira@chlastak.cz> wrote:

I = have my device working for now - but the question is - Is the = documentation and example for =E2=80=9Crootdev=E2=80=9D right or not?

=E2=80=94
Mira

On 18 Nov 2022, at = 21:13, Warner Losh <imp@bsdimp.com> wrote:



On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k = Miroslav <mira@chlastak.cz <mailto:mira@chlastak.cz>> wrote:
Hi = all,

In the /boot/defaults/loader.conf are = these options for memory disk settings:

#mdroot_load=3D"YES" =             &n= bsp;# The "mdroot" prefix is arbitrary.
#mdroot_type=3D"md_image" =         # Create md(4) disk at = boot.
#mdroot_name=3D"/boot/root.img"   # Path = to a file containing the image.
#rootdev=3D"ufs:/dev/md0" =         # Set the root = filesystem to md(4) device.


But - is this example for rootdev option still right? Because = =E2=80=9Cufs:/dev/md0=E2=80=9D works fine on freebsd 12.1, but on = freebsd 12.3 this does not work and generates error message:

Can=E2=80=99t determine root device


When I use this option with = value =E2=80=9C/dev/md0=E2=80=9D or =E2=80=9Cmd0=E2=80=9D (even with = this option commented out), so the machine boots correctly without any = error.

I think you want vfs.root.mountfrom=3D= instead of rootdev=3D here.

Warner

=E2=80=94
Mira



-- 
=E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98= =8E  [Tomoaki AOKI]    <junchoon@dec.sakura.ne.jp>

= --Apple-Mail=_50BCB33F-6C39-4359-A528-FC4EA71B940C--