Bug 475748

Summary: luks invocation in initrd hardcodes disk number, breaks when disks change
Product: [Fedora] Fedora Reporter: Tomasz Torcz <tomek>
Component: mkinitrdAssignee: David Lehman <dlehman>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: dcantrell, hdegoede, katzj, pjones, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-15 13:58:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomasz Torcz 2008-12-10 09:35:44 UTC
Description of problem:

When full disk is encrypted, generated initrd contains explicit name of partition:

#v+
echo Setting up disk encryption: /dev/sda2
plymouth ask-for-password --command "cryptsetup luksOpen /dev/sda2 luks-5af54d72-bae5-4cac-bcf9-0551ee3711dd"
#v-

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):
mkinitrd-6.0.71-2.fc10.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install Fedora with disk encryption
2. Change the order of disks
3. Try to boot.
  
Actual results:
Booting fails, asking for disk password few times.

Expected results:
Booting should work.

Additional info:
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

Comment 1 David Lehman 2008-12-17 23:02:55 UTC
/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.

Comment 2 Tomasz Torcz 2009-05-15 13:58:27 UTC

*** This bug has been marked as a duplicate of bug 500830 ***