Bug 475748 - luks invocation in initrd hardcodes disk number, breaks when disks change
Summary: luks invocation in initrd hardcodes disk number, breaks when disks change
Keywords:
Status: CLOSED DUPLICATE of bug 500830
Alias: None
Product: Fedora
Classification: Fedora
Component: mkinitrd
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-10 09:35 UTC by Tomasz Torcz
Modified: 2009-05-15 13:58 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-05-15 13:58:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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 ***


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