5

This works:

crypttab:

sda2_crypt UUID=6bbba323-ddad-479d-863e-4bd939b46f96 none luks,swap
sda3_crypt UUID=3087cec6-dcc9-44ee-8a08-5555bb2ca566 none luks

fstab:

/dev/mapper/sda3_crypt /               ext4    errors=remount-ro 0       1
/dev/mapper/sda2_crypt none            swap    sw              0       0

But when I try to change it to this and run update-initramfs -u -k all, it gives me this error: cryptsetup: WARNING: failed to determine cipher modules to load for part_root_crypt

crypttab:

part_swap_crypt UUID=6bbba323-ddad-479d-863e-4bd939b46f96 none luks,swap
part_root_crypt UUID=3087cec6-dcc9-44ee-8a08-5555bb2ca566 none luks

fstab:

/dev/mapper/part_root_crypt /               ext4    errors=remount-ro 0       1
/dev/mapper/part_swap_crypt none            swap    sw              0       0

I wanted to change this because when I installed my operative system, this disk was sda, but afterwards I've added more disks and now it's sdb and I'd like to change it's name to something disk independent.

What am I missing here?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
  • Not sure, but I wonder if `update-initramfs` tries to find out the necessary modules from the running system, and if you don't actually have `part_root_crypt` (with the new name) at the time of running it, it can't find out what modules it needs – ilkkachu Apr 06 '17 at 08:14
  • Well, that makes sense. The problem is that part_root_crypt is the root partition. So, I can't umount the previous /dev/mapper/sda3_crypt and mount in it's place /dev/mapper/part_root_crypt. Or can I?.. – oak-island-pirate Apr 07 '17 at 11:22

2 Answers2

1

luks,swap forces the swap to be re-formatted at leach launch causing it to also change it's UUID, not sure i'm using the best approach but I solved this with

# swap UUID changes each mount
swap_crypt    /dev/disk/by-partlabel/SWAP_CRYPT    none    luks,swap
# leaving the rest of crypttab the same
part_root_crypt    UUID=3087cec6-dcc9-44ee-8a08-5555bb2ca566    none    luks
1

The warning is expected when you are changing the name of the encrypted volume that contains the root filesystem. It does not mean the new initramfs won't work; it just means the initramfs generator must now add the kernel modules for all the possible encryption algorithms, so your new initramfs may be noticeably larger than the old one.

Once you have successfully booted with the renamed device, it should be possible to run update-initramfs again, and as the names in the configuration files will again match what's currently in use, it will be able to determine the correct modules to include and minimize the size of the initramfs file again.

telcoM
  • 87,318
  • 3
  • 112
  • 232