Bug 475748 - luks invocation in initrd hardcodes disk number, breaks when disks change
luks invocation in initrd hardcodes disk number, breaks when disks change
Status: CLOSED DUPLICATE of bug 500830
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: David Lehman
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-10 04:35 EST by Tomasz Torcz
Modified: 2009-05-15 09:58 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-15 09:58:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomasz Torcz 2008-12-10 04:35:44 EST
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 18:02:55 EST
/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 09:58:27 EDT

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

Note You need to log in before you can comment on or make changes to this bug.