Date: Sat, 19 Nov 2022 20:32:52 -0700 From: Warner Losh <imp@bsdimp.com> To: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Cc: =?UTF-8?Q?Chlast=C3=A1k_Miroslav?= <mira@chlastak.cz>, FreeBSD CURRENT <freebsd-current@freebsd.org> Subject: Re: loader.conf and rootdev option for memory disk Message-ID: <CANCZdfpNtRnqoirja30q_7gotE=Z9w2MG-XhjFETwNQU=XzgLQ@mail.gmail.com> In-Reply-To: <20221120100046.b44741ca341c1593a72f594b@dec.sakura.ne.jp> References: <2E58D34B-F8C5-4291-B019-9E24F56DC3DF@chlastak.cz> <CANCZdfqGhHXCJtUOctpoB-sAuxSdzJZERSBritTazp_uragZ=Q@mail.gmail.com> <F3702494-1433-4324-B972-52FBD84EFFD8@chlastak.cz> <20221120055845.366367f1d371ae4d6eb8d747@dec.sakura.ne.jp> <97A75B5E-6C38-4CFB-9978-7E254595D980@chlastak.cz> <20221120100046.b44741ca341c1593a72f594b@dec.sakura.ne.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000b4161705edde9863 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 19, 2022 at 6:01 PM Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote: > But your previous post shows rootdev=3D there didn't work, and needed > setting vfs.root.mountfrom=3D. > > OTOH, rootdev=3D is reported to work in efi/boot/freebsd/loader.env (with > efi loader) on freebsd-users-jp ML (as it's Japanese ML, in Japanese) > this year. > > So /boot/defaults/loader.conf (/usr/src/stand/defaults/loader.conf) > should be fixed, and what should be set in loader.env should be > documented. > > *Dedicated brand-new manpage or in boot.8 (or in loader.8 describing > rootdev, or loader.conf.8 in contrast with itself). > Reading the code it's complicated. rootdev looks like it overrides the default root... unless vfs.root.mountfrom has already been set. > > On Sat, 19 Nov 2022 22:31:42 +0100 > Chlast=C3=A1k Miroslav <mira@chlastak.cz> wrote: > > > 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 <mailto:mira@chlastak.cz>> w= rote: > > > > > >> 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 <mailto: > imp@bsdimp.com>> wrote: > > >>> > > >>> > > >>> > > >>> On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k Miroslav <mira@chlas= tak.cz > <mailto:mira@chlastak.cz> <mailto: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" # The "mdroot" prefix is arbitrar= y. > > >>> #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@de= c.sakura.ne.jp <mailto: > junchoon@dec.sakura.ne.jp>> > > > > > -- > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E [Tomoaki AOKI] <junchoon@dec.sa= kura.ne.jp> > > --000000000000b4161705edde9863 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Sat, Nov 19, 2022 at 6:01 PM Tomoa= ki AOKI <<a href=3D"mailto:junchoon@dec.sakura.ne.jp">junchoon@dec.sakur= a.ne.jp</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"= margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef= t:1ex">But your previous post shows rootdev=3D there didn't work, and n= eeded<br> setting vfs.root.mountfrom=3D.<br> <br> OTOH, rootdev=3D is reported to work in efi/boot/freebsd/loader.env (with<b= r> efi loader) on freebsd-users-jp ML (as it's Japanese ML, in Japanese)<b= r> this year.<br> <br> So /boot/defaults/loader.conf (/usr/src/stand/defaults/loader.conf)<br> should be fixed, and what should be set in loader.env should be<br> documented.<br> <br> =C2=A0*Dedicated brand-new manpage or in boot.8 (or in loader.8 describing<= br> =C2=A0 rootdev, or loader.conf.8 in contrast with itself).<br></blockquote>= <div><br></div><div>Reading the code it's complicated.</div><div><br></= div><div>rootdev looks like it overrides the default root... unless vfs.roo= t.mountfrom</div><div>has already been set.<br></div><div>=C2=A0</div><bloc= kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:= 1px solid rgb(204,204,204);padding-left:1ex"> <br> On Sat, 19 Nov 2022 22:31:42 +0100<br> Chlast=C3=A1k Miroslav <<a href=3D"mailto:mira@chlastak.cz" target=3D"_b= lank">mira@chlastak.cz</a>> wrote:<br> <br> > Look at the file /boot/defaults/loader.conf:<br> > <br> > =E2=80=A6<br> > ###=C2=A0 Initial memory disk settings=C2=A0 #########################= ##<br> > #mdroot_load=3D"YES"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 # The "mdroot" prefix is arbitrary.<br> > #mdroot_type=3D"md_image"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#= Create md(4) disk at boot.<br> > #mdroot_name=3D"/boot/root.img"=C2=A0 =C2=A0# Path to a file= containing the image.<br> > #rootdev=3D"ufs:/dev/md0"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#= Set the root filesystem to md(4) device.<br> > =E2=80=A6<br> > <br> > =E2=80=94<br> > Mira<br> > <br> > > On 19 Nov 2022, at 21:58, Tomoaki AOKI <<a href=3D"mailto:junc= hoon@dec.sakura.ne.jp" target=3D"_blank">junchoon@dec.sakura.ne.jp</a>> = wrote:<br> > > <br> > > IIUC, rootdev should be set in loader.env, if needed.<br> > > `man 5 loader.conf` has nothing about rootdev variable.<br> > > <br> > > (It's undocumented, IIRC.)<br> > > <br> > > <br> > > On Sat, 19 Nov 2022 19:57:47 +0100<br> > > Chlast=C3=A1k Miroslav <<a href=3D"mailto:mira@chlastak.cz" ta= rget=3D"_blank">mira@chlastak.cz</a> <mailto:<a href=3D"mailto:mira@chla= stak.cz" target=3D"_blank">mira@chlastak.cz</a>>> wrote:<br> > > <br> > >> I have my device working for now - but the question is - Is t= he documentation and example for =E2=80=9Crootdev=E2=80=9D right or not?<br= > > >> <br> > >> =E2=80=94<br> > >> Mira<br> > >> <br> > >>> On 18 Nov 2022, at 21:13, Warner Losh <<a href=3D"mail= to:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a> <mailto:<a href= =3D"mailto:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>>> wro= te:<br> > >>> <br> > >>> <br> > >>> <br> > >>> On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k Miroslav &= lt;<a href=3D"mailto:mira@chlastak.cz" target=3D"_blank">mira@chlastak.cz</= a> <mailto:<a href=3D"mailto:mira@chlastak.cz" target=3D"_blank">mira@ch= lastak.cz</a>> <mailto:<a href=3D"mailto:mira@chlastak.cz" target=3D"= _blank">mira@chlastak.cz</a> <mailto:<a href=3D"mailto:mira@chlastak.cz"= target=3D"_blank">mira@chlastak.cz</a>>>> wrote:<br> > >>> Hi all,<br> > >>> <br> > >>> In the /boot/defaults/loader.conf are these options for m= emory disk settings:<br> > >>> <br> > >>> #mdroot_load=3D"YES"=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 # The "mdroot" prefix is arbitrary.<br> > >>> #mdroot_type=3D"md_image"=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0# Create md(4) disk at boot.<br> > >>> #mdroot_name=3D"/boot/root.img"=C2=A0 =C2=A0# P= ath to a file containing the image.<br> > >>> #rootdev=3D"ufs:/dev/md0"=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0# Set the root filesystem to md(4) device.<br> > >>> <br> > >>> <br> > >>> But - is this example for rootdev option still right? Bec= ause =E2=80=9Cufs:/dev/md0=E2=80=9D works fine on freebsd 12.1, but on free= bsd 12.3 this does not work and generates error message:<br> > >>> <br> > >>> Can=E2=80=99t determine root device<br> > >>> <br> > >>> <br> > >>> 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.<br> > >>> <br> > >>> I think you want vfs.root.mountfrom=3D instead of rootdev= =3D here.<br> > >>> <br> > >>> Warner<br> > >>> <br> > >>> =E2=80=94<br> > >>> Mira<br> > >> <br> > > <br> > > <br> > > -- <br> > > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E=C2=A0 [Tomoaki AOKI]=C2=A0 = =C2=A0 <<a href=3D"mailto:junchoon@dec.sakura.ne.jp" target=3D"_blank">j= unchoon@dec.sakura.ne.jp</a> <mailto:<a href=3D"mailto:junchoon@dec.saku= ra.ne.jp" target=3D"_blank">junchoon@dec.sakura.ne.jp</a>>><br> > <br> <br> <br> -- <br> =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E=C2=A0 [Tomoaki AOKI]=C2=A0 =C2=A0 <= ;<a href=3D"mailto:junchoon@dec.sakura.ne.jp" target=3D"_blank">junchoon@de= c.sakura.ne.jp</a>><br> <br> </blockquote></div></div> --000000000000b4161705edde9863--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpNtRnqoirja30q_7gotE=Z9w2MG-XhjFETwNQU=XzgLQ>