You are not logged in.

#1 2019-05-26 13:11:51

Makowski
Member
Registered: 2019-05-26
Posts: 2

root password Invalid when booting from initramfs

I am observing very strange behaviour. On a fresh install with encrypted root partition, my root password is rejected when logging into tty.

Boot procedure is as follows:

1) grub prompts for password for root(!) partition. (I have no separate boot partition, yet)
2) grub.cfg is loaded from root partition
3) linux booted with custom initramfs
  ```
  insmod luks
  set root=(lvm/sdz-arch)
  linux /boot/vmlinuz-linux root=/dev/mapper/sdz-arch cryptdevice=/dev/sda2:cryptroot
  initrd /boot/custom-linux.img
  ```
4) luks pasword prompt
5) tty prompt
6) root password rejection

If I however manually decrypt the luks volume from initrrd everything works just fine, and I can log in as root.
```
  $ cryptsetup luksOpen /dev/sda2 xxx
  $ mount /dev/mapper/sdz-arch /new_root
  $ exit
```
I enter the initrd's rescue shell, e.g. by removing `cryptdevice=/dev/sda2:cryptroot`. The initrd then complains about not finding /dev/mapper/sdz-arch and drops to a shell.

My custom initramfs was created with mkinicpio:
```
...
BINARIES=(cryptsetup)
...
HOOKS=(base udev keyboard encrypt block lvm2 filesystems)
```

My naive assumption is that somehow the initrd's /etc/shadow is still in effect. No idea, though really...

Offline

#2 2019-05-26 13:21:18

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: root password Invalid when booting from initramfs

maybe you have copied something with dd and so there is some duplicate UUID confusion? and your rootfs is actually something different with a different root pass...?

check blkid, lsblk that there are no duplicate uuid and everything is mounted as you expect (ok, hard to check if you cannot login)

block supposed to before encrypt not after. binaries cryptsetup should not be necessary (included by encrypt hook).

Last edited by frostschutz (2019-05-26 13:21:29)

Offline

#3 2019-05-26 14:54:25

Makowski
Member
Registered: 2019-05-26
Posts: 2

Re: root password Invalid when booting from initramfs

OK, solved.

Your questions (frostschutz) pointed me at having a look at my /etc/fstab. My root partition was missing! Facepalming myself for that one.

Athough, I don't quite understand how me mounting the disk manually from within the initrd is any different...

For the sake of completeness answering your questions:

> maybe you have copied something with dd and so there is some duplicate UUID confusion?
no. nothing copied nor mounted with dd.

> and your rootfs is actually something different with a different root pass...?
no both crypt mounts are the same (for now).

Thanks a lot!

Offline

Board footer

Powered by FluxBB