Date: Sat, 22 Jun 2024 09:46:34 -0600 From: Warner Losh <imp@bsdimp.com> To: FreeBSD FS <freebsd-fs@freebsd.org> Subject: Re: setting currdev correctly after repartitioning Message-ID: <CANCZdfpef361Qzan7a%2BoHweMAdu2gj5ZanSCZk6=adhNc5xtsA@mail.gmail.com> In-Reply-To: <ZnbsgLFBVRtzycPU@int21h> References: <ZnbsgLFBVRtzycPU@int21h>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000914bb8061b7c749b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 22, 2024, 9:23=E2=80=AFAM void <void@f-m.fm> wrote: > I've imaged with dd an rpi4 ssd and created on the hardware > 4*8GB swap partitions, and have transferred with cpdup the > freebsd contents from the image back to the ssd. The msdos-based > EFI and rpi partition was unmodified. > > When I try to boot, it drops an OK prompt with the following error > > "Setting currdev to disk0p2: > ERROR: cannot open /boot/lua/loader.lua: no such file or directory." > > The partition table looks like this > > # gpart show da5 (this is da5 on another machine) > How do you know disk0 in the boot loader is da5 in FreeBSD? Or that it's even the disk you think it is? P2 is GPT partitioning, not MBR so you are chasing shadows here, i think. =3D> 63 1953525105 da5 MBR (932G) > 63 1 - free - (512B) > 64 524288 1 fat32lba [active] (256M) > 524352 1952448512 2 freebsd (931G) > 1952972864 552304 - free - (270M) > > > # gpart show da5s2 > > =3D> 0 1952448512 da5s2 BSD (931G) > 0 16777216 1 freebsd-swap (8.0G) > 16777216 16777216 2 freebsd-swap (8.0G) > 33554432 16777216 4 freebsd-swap (8.0G) > 50331648 16777216 5 freebsd-swap (8.0G) > 67108864 1885339648 6 freebsd-ufs (899G) > > I wonder if freebsd-ufs needs to be the first slice? No. Is that what the error means? Whatever disk this is, it GPT partitioned, may have a kernel but not the lua support files. It might even not have a recognized filesystem on it, but we think the ESP was on this disk if not, how can I tell it > that the loader is on (when it's installed on the rpi4) /dev/da5s2f ? > I think you'll be happier with labels for this. But you will need to set things up with the ESP tgat booted. it's not in fstab. context is -current and ufs2. > > fstab looks like this > > # Custom /etc/fstab for FreeBSD embedded images > /dev/ufs/rootfs / ufs rw,noatime 1 > 1 > /dev/msdosfs/EFI /boot/efi msdosfs rw,noatime 0 > 0 > tmpfs /tmp tmpfs rw,mode=3D1777 = 0 > 0 > # > #/dev/label/growfs_swap none swap sw 0 > 0 > #md none swap sw,late,file=3D/usr/swap0= 0 > 0 > There's much confusion here. That needs to be sorted out first. Warner > --000000000000914bb8061b7c749b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Sat, Jun 22, 2024, 9:23=E2=80=AFAM void <<a href= =3D"mailto:void@f-m.fm">void@f-m.fm</a>> wrote:<br></div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa= dding-left:1ex">I've imaged with dd an rpi4 ssd and created on the hard= ware<br> 4*8GB swap partitions, and have transferred with cpdup the<br> freebsd contents from the image back to the ssd. The msdos-based<br> EFI and rpi partition was unmodified.<br> <br> When I try to boot, it drops an OK prompt with the following error<br> <br> "Setting currdev to disk0p2:<br> ERROR: cannot open /boot/lua/loader.lua: no such file or directory."<b= r> <br> The partition table looks like this<br> <br> # gpart show da5 (this is da5 on another machine)<br></blockquote></div></d= iv><div dir=3D"auto"><br></div><div dir=3D"auto">How do you know disk0 in t= he boot loader is da5 in FreeBSD? Or that it's even the disk you think = it is? P2 is GPT partitioning, not MBR so you are chasing shadows here, i t= hink.</div><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmai= l_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde= r-left:1px #ccc solid;padding-left:1ex"> =3D>=C2=A0 =C2=A0 =C2=A0 =C2=A0 63=C2=A0 1953525105=C2=A0 da5=C2=A0 MBR= =C2=A0 (932G)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A063=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A0- free -=C2=A0 (512B)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A064=C2=A0 =C2=A0 =C2=A0 524288=C2= =A0 =C2=A0 1=C2=A0 fat32lba=C2=A0 [active]=C2=A0 (256M)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0524352=C2=A0 1952448512=C2=A0 =C2=A0 2=C2=A0 fre= ebsd=C2=A0 (931G)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A01952972864=C2=A0 =C2=A0 =C2=A0 552304=C2=A0 =C2= =A0 =C2=A0 =C2=A0- free -=C2=A0 (270M)<br> <br> <br> # gpart show da5s2<br> <br> =3D>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00=C2=A0 1952448512=C2=A0 da5s2=C2= =A0 BSD=C2=A0 (931G)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0=C2=A0 =C2=A0 16777216=C2=A0 =C2= =A0 =C2=A0 1=C2=A0 freebsd-swap=C2=A0 (8.0G)<br> =C2=A0 =C2=A0 =C2=A016777216=C2=A0 =C2=A0 16777216=C2=A0 =C2=A0 =C2=A0 2=C2= =A0 freebsd-swap=C2=A0 (8.0G)<br> =C2=A0 =C2=A0 =C2=A033554432=C2=A0 =C2=A0 16777216=C2=A0 =C2=A0 =C2=A0 4=C2= =A0 freebsd-swap=C2=A0 (8.0G)<br> =C2=A0 =C2=A0 =C2=A050331648=C2=A0 =C2=A0 16777216=C2=A0 =C2=A0 =C2=A0 5=C2= =A0 freebsd-swap=C2=A0 (8.0G)<br> =C2=A0 =C2=A0 =C2=A067108864=C2=A0 1885339648=C2=A0 =C2=A0 =C2=A0 6=C2=A0 f= reebsd-ufs=C2=A0 (899G)<br> <br> I wonder if freebsd-ufs needs to be the first slice?</blockquote></div></di= v><div dir=3D"auto"><br></div><div dir=3D"auto">No.</div><div dir=3D"auto">= <br></div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D= "gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding= -left:1ex"> Is that what the error means?</blockquote></div></div><div dir=3D"auto"><br= ></div><div dir=3D"auto">Whatever disk this is, it GPT partitioned, may hav= e a kernel but not the lua support files. It might even not have a recogniz= ed filesystem on it, but we think the ESP was on this disk=C2=A0=C2=A0</div= ><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmail_quote"><= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex"> if not, how can I tell it<br> that the loader is on (when it's installed on the rpi4) /dev/da5s2f ?<b= r></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">I = think you'll be happier with labels for this. But you will need to set = things up with the ESP tgat booted.</div><div dir=3D"auto"><br></div><div d= ir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st= yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> it's not in fstab. context is -current and ufs2.<br> <br> fstab looks like this<br> <br> # Custom /etc/fstab for FreeBSD embedded images<br> /dev/ufs/rootfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ufs=C2=A0 =C2=A0 =C2=A0rw,noatime=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1=C2=A0 =C2=A0 =C2=A0 =C2=A01<br> /dev/msdosfs/EFI=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /bo= ot/efi=C2=A0 =C2=A0 =C2=A0 =C2=A0msdosfs rw,noatime=C2=A0 =C2=A0 =C2=A0 0= =C2=A0 =C2=A0 =C2=A0 =C2=A00<br> tmpfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/= tmp=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tmpfs=C2=A0 =C2=A0rw,mode=3D17= 77=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A0 =C2=A00<b= r> #<br> #/dev/label/growfs_swap none=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 swap= =C2=A0 =C2=A0 sw=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A0 =C2=A00<br> #md=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0none=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 swap=C2=A0 =C2=A0 sw,la= te,file=3D/usr/swap0 0=C2=A0 =C2=A0 =C2=A0 =C2=A00<br></blockquote></div></= div><div dir=3D"auto"><br></div><div dir=3D"auto">There's much confusio= n here. That needs to be sorted out first.</div><div dir=3D"auto"><br></div= ><div dir=3D"auto">Warner</div><div dir=3D"auto"><div class=3D"gmail_quote"= ><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1= px #ccc solid;padding-left:1ex"> </blockquote></div></div></div> --000000000000914bb8061b7c749b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpef361Qzan7a%2BoHweMAdu2gj5ZanSCZk6=adhNc5xtsA>