Red Hat Bugzilla – Bug 475748
luks invocation in initrd hardcodes disk number, breaks when disks change
Last modified: 2009-05-15 09:58:27 EDT
Description of problem:
When full disk is encrypted, generated initrd contains explicit name of partition:
echo Setting up disk encryption: /dev/sda2
plymouth ask-for-password --command "cryptsetup luksOpen /dev/sda2 luks-5af54d72-bae5-4cac-bcf9-0551ee3711dd"
I connected another disk, original sda became sdb. In normal situation, when mounting is done by labels, everything worked. With encryption, above cryptsetup command fails and boot is impossible.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install Fedora with disk encryption
2. Change the order of disks
3. Try to boot.
Booting fails, asking for disk password few times.
Booting should work.
Clearly, hardcoding "sda2" in initrd is no-go. Instead, /dev/disk/by-uuid/ name should be used. Notice, that this UUID is already mentioned in initrd:
cryptsetup luksOpen /dev/sda2 luks-5af54d72-bae5-4cac-bcf9-0551ee3711dd
And my proper sda2 is:
# ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 gru 3 12:21 5af54d72-bae5-4cac-bcf9-0551ee3711dd -> ../../sda2
/dev/disk/by-uuid is not an option in the initrd since udev is not running at that point.
I will have to see what options nash provides for resolving a label/uuid to a device node.
*** This bug has been marked as a duplicate of bug 500830 ***