"mounting /dev/vg0/root on /sysroot failed" on RPI4
Hi everyone,
I'm trying to install Alpine on an RPI4 with LVM and LUKS. I have already
done it several times without problem but this time I got this error:
"mount: mounting /dev/vg0/root on /sysroot failed: No such file or
directory and the emergency recovery shell is launched. I manage to
continue the boot by manually mounting the partition and it starts as it
should:
```
nlplug-findfs: crypt_load(/dev/mmcblk0)
mount: mounting /dev/vg0/root on /sysroot failed: No such file or directory
Mounting root failed.
initramfs emergency recovery shell launched. Type 'exit' to continue boot
sh: can't access tty; job control turned off
~ #
~ # cryptsetup luksOpen /dev/mmcblk0p1 lvmcrypt
--key-file=/crypto_keyfile.bin
~ # lvm vgchange -ay vg0
3 logical volume(s) in volume group "vg0" now active
~ # mount /dev/vg0/root /sysroot
~ # exit
```
Once the system is started, I check that the modules are loaded, that the
cmdline.txt is ok and I rebuild the initial RAM disk:
```
$ cat /etc/mkinitfs/mkinitfs.conf
features="base mmc usb ext4 mmc vfat nvme vmd lvm cryptsetup cryptkey"
$
$ cat /boot/cmdline.txt
modules=loop,squashfs,sd-mod,usb-storage,vfat,ext4,nvme,vmd,kms,lvm,cryptsetup,cryptkey
quiet console=tty1 rootfstype=ext4 slab_nomerge init_on_alloc=1
init_on_free=1 page_alloc.shuffle=1 pti=on vsyscall=none debugfs=off
oops=panic module.sig_enforce=1 lockdown=confidentiality mce=0 loglevel=0
root=/dev/vg0/root cryptroot=/dev/mmcblk0 cryptkey=yes cryptdm=lvmcrypt
$
$ ls /crypto_keyfile.bin
/crypto_keyfile.bin
$ sudo mkinitfs -c /etc/mkinitfs/mkinitfs.conf -b / 6.6.4-0-rpi
==> initramfs: creating /boot/initramfs-6.6.4-0-rpi
$ sudo reboot
```
But that doesn't change anything and I fall back again into the emergency
shell.
Usually it works well and I can't find the difference in this case.. any
idea?
Thanks in advance for the help.
Thanks for the hint! I activated it but unfortunately there are too many
logs too quickly and the last screen says nothing about `mmcblk0` :/ (I
tried a video but it's too fast..).
Suppose the partition is not recognized as LVM2_member, how I could fix
this?
Thanks!
On Thu, 11 Jan 2024 at 12:53, Konstantin Kulikov <k.kulikov2@gmail.com>
wrote:
> Add debug_init=1 to kernel command line and check that blkid detects> your partition as LVM2_member>>> https://git.alpinelinux.org/mkinitfs/tree/nlplug-findfs/nlplug-findfs.c#n1014>
I'd edit /usr/share/mkinitfs/initramfs-init with either
exec >/init.log 2>&1
or pass -d to nlplug-findfs directly without debug_init and rebuild initram.
Or connect serial console.
As for a fix I don't know i'm not familiar with lvm. Maybe partition
type needs to be set to LVM?
Anyway try running `blkid` manually and see what it reports.
Problem solved! Must be `cryptroot=/dev/mmcblk0p1` not
`cryptroot=/dev/mmcblk0`..
Thank you for the help!
On Thu, 11 Jan 2024 at 15:18, Konstantin Kulikov <k.kulikov2@gmail.com>
wrote:
> I'd edit /usr/share/mkinitfs/initramfs-init with either> exec >/init.log 2>&1> or pass -d to nlplug-findfs directly without debug_init and rebuild> initram.> Or connect serial console.>> As for a fix I don't know i'm not familiar with lvm. Maybe partition> type needs to be set to LVM?> Anyway try running `blkid` manually and see what it reports.>