[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trouble/bug with initramfs-tools adding encrypted swap partition



Hello Hans,
this is exactly what I did. To be precise, I followed this guide [1], with the difference that instead of "crypt" I used the actual name, luks-<UUID> (Disks thanksfully shows everything relevant). It's not the first time I'm doing this. Yet I experience the errors mentioned. Sure, I'm not using the -u flag with update-initramfs as I see no point in updating what's already broken, I just use -ck all. But that shouldn't make a difference.

Best
Richard

[1]: https://wiki.debian.org/GrubEFIReinstall

Am Mi., 24. Apr. 2024 um 08:35 Uhr schrieb Hans <hans.ullrich@loop.de>:

Am Dienstag, 23. April 2024, 22:26:17 CEST schrieb Richard:

Hi Richard,


this is, what I am doing when this happens:


1. booting into a live system (any new is working, I prefer kali-linux)


2. If you are using encrypted filesystems, open it. But you have to name it like it is named in /etc/crypttab of the defective system


3. Now mount the device with root-filesystem to /mnt


4. If you have /boot as a separated partition, mount it to /mnt/boot


5. Now mount needed system directories to /mnt

    mount --bind /sys /mnt/sys

    mount --bind /proc /mnt/proc

    mount --bind /dev /mnt/dev


6. If everything is mounted correct, you can chroot into the mounted system

    chroot /mnt


7. Now you can create a new initrd

    update-initramfs -u

 

8. exit the chroot and reboot.






Note:


1. if you have encrypted filesystems, check in the chroot the files


/etc/crypttab

/etc/cryptsetup-initramfs/conf-hook


In conf-hook check the last line, the parm "ASKPASS=Y" should be commented out.


2. You can check the UUID of every partition with the command

    blkid /dev/sda1

and compare it with the entries in /etc/fstab, /etc/crypttab and everywhere else it is used.


3. In chroot, you can of course also create a new initrd, using

    update-initramfs -c -k all


4. Please remember, when you have encrypted partitions, then the UUID of the device is other, than the partitions, you later mount. Example:


blkid /dev/sda3

UUID=1234556-dfre-3456.............


Now

cryptsetup luksOpen /dev/sda3 crypt_sda3

blkid /dev/mapper/crypt_sda3

UUID=9876g54-765g-87hg............


Watch this, when changing any UUIDs in /etc/fstab or anywhere else.


Last but not least: Hope this helps, good luck!


Best


Hans


  



Reply to: