Bug 1085562

Summary: dracut is unable to read crypttab if last line does not contain a newline
Product: Red Hat Enterprise Linux 6 Reporter: Kevin Young <kevin_young>
Component: dracutAssignee: dracut-maint-list
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: atodorov, bgoncalv, dracut-maint-list, harald, jonathan, kevin_young, mganisin, pholica, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: If /etc/crypttab does not contain a newline as the last character, the last line is not parsed by dracut. Consequence: The encrypted disk is not unlocked. Fix: dracut was fixed to handle /etc/crypttab without a newline at the end. Result: The encrypted disk specified in the last line is handled, a password is requested and the disk is unlocked.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 06:38:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kevin Young 2014-04-08 23:05:17 UTC
Description of problem:
When booting to an encrypted root volume and the crypttab has been included in the initramfs.img, if the line in the crypttab file does not end in a newline, it is not properly interpreted by dracut. It would be preferable that dracut give a better error message if it cannot read the crypttab file properly. The error during boot looks like this:

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

Steps to Reproduce:
1. Create crypttab file that contains "cryptroot /dev/xvdf /etc/keyfile" (ensure entry in crypttab does not end in a newline)
2. Run dracut, injecting crypttab and keyfile into initramfs.img
3. update grub.conf to boot to encrypted filesystem root=/dev/mapper/cryptroot

Actual results:
dracut: luksOpen /dev/xvdf luks-587e17f6-c6a6-447e-bd9e-e654e7aaedae /etc/keyfile
dracut Warning: No root device "block:/dev/mapper/cryptroot" found

Expected results:
dracut: luksOpen /dev/xvdf cryptroot /etc/keyfile
dracut: Mounted root filesystem /dev/mapper/cryptroot

Additional info:

Comment 1 Adam Williamson 2014-04-17 17:26:13 UTC
This is filed against Fedora Rawhide, but:

Version-Release number of selected component (if applicable):

is this supposed to be for RHEL 6 or Fedora? Thanks!

Comment 5 Alexander Todorov 2015-04-02 11:24:39 UTC
I wasn't able to reproduce with dracut-004-356.el6.noarch and my /etc/crypptab doesn't contain a new line at the end.

can you see if you can reproduce with RHEL 6.6 ?

Comment 8 errata-xmlrpc 2015-07-22 06:38:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Comment 9 Kevin Young 2015-08-31 16:48:40 UTC
verified the fix