Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Upgrade dracut -> LUKS fails to open non-root LV
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jebriggsy
n00b
n00b


Joined: 22 Aug 2013
Posts: 26
Location: USA

PostPosted: Tue Mar 25, 2014 11:01 pm    Post subject: [SOLVED] Upgrade dracut -> LUKS fails to open non-root LV Reply with quote

Hello,

I have recently upgraded my bootloader from GRUB Legacy (0.97-r12) to GRUB2 (2.00_p5107-r2), my kernel from 3.9.9-hardened to 3.11.7-hardened-r1, and Dracut from 031-r1 to 036-r4. After this, dracut fails to mount my encrypted swap and home LVs. I have been troubleshooting this for about a day now and have hit a roadblock. No matter what I do I can't get them to mount. I still have my 3.9.9 kernel and initramfs in GRUB2, and those mount/unlock my home and swap without issue.

Examining the logs shows the difference but I can't seem to locate what settings have changed.

New kernel & dracut log:
Code:

[    1.465737] dracut: dracut-036-r4
[    2.450423] dracut: luksOpen /dev/sda2 luks-cfdc5b46-0c38-4825-ad12-3cddf2685941 
[   14.703674] dracut: Scanning devices dm-0  for LVM logical volumes vg/swap vg/root
[   14.815655] dracut: inactive '/dev/vg/swap' [8.00 GiB] inherit
[   14.815918] dracut: inactive '/dev/vg/root' [128.00 GiB] inherit
[   14.816146] dracut: inactive '/dev/vg/home' [459.00 GiB] inherit
[   15.296564] dracut: Checking ext4: /dev/vg/root
[   15.296890] dracut: issuing e2fsck -a  /dev/vg/root
[   15.395030] dracut: /dev/vg/root: clean, 527502/8388608 files, 4252630/33554432 blocks
[   15.397705] dracut: Mounting /dev/vg/root with -o noatime,ro
[   15.552075] dracut: Mounted root filesystem /dev/mapper/vg-root
[   15.732521] dracut: Switching root


Old (functioning) kernel & dracut log:
Code:

[    3.261836] dracut: dracut-031-r1
[    4.102284] dracut: luksOpen /dev/sda2 luks-cfdc5b46-0c38-4825-ad12-3cddf2685941 
[   18.403140] dracut: Scanning devices dm-0  for LVM volume groups
[   18.408544] dracut: Reading all physical volumes. This may take a while...
[   18.412908] dracut: Found volume group "vg" using metadata type lvm2
[   18.442946] dracut: 3 logical volume(s) in volume group "vg" now active
[   18.838639] dracut: Checking ext4: /dev/mapper/vg-root
[   18.838951] dracut: issuing e2fsck -a  /dev/mapper/vg-root
[   18.917471] dracut: /dev/mapper/vg-root: clean, 527792/8388608 files, 4248981/33554432 blocks
[   18.920099] dracut: Mounting /dev/mapper/vg-root with -o noatime,ro
[   19.085850] dracut: Mounted root filesystem /dev/mapper/vg-root
[   24.274358] dracut: Switching root


I don't understand why it unlocks and mounts the root LV but not the swap or /home. I can provide relevant configs & logs if needed. Please help


Last edited by jebriggsy on Fri Mar 28, 2014 3:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 806
Location: S.O. France

PostPosted: Thu Mar 27, 2014 12:25 am    Post subject: Reply with quote

Dracut > 0.34-r4 ignores DRACUT_MODULES="" in your make.conf

You have to install the ebuild like lvm2... manually.
Look if you don't have unemerged (depclean) one you need.
Code:
To get additional features, a number of optional runtime dependencies may be installed:
[ ] net-misc/curl to Networking support
[ ] net-misc/dhcp[client] to Networking support
[ ] sys-apps/iproute2 to Networking support
[ ] app-benchmarks/bootchart2 to Measure performance of the boot process for later visualisation
[ ] sys-apps/usleep to Measure performance of the boot process for later visualisation
[ ] sys-process/acct to Measure performance of the boot process for later visualisation
[ ] sys-fs/btrfs-progs to Scan for Btrfs on block devices
[ ] sys-libs/libcap to Load kernel modules and drop this privilege for real init
[ ] net-fs/cifs-utils to Support CIFS
[ ] sys-fs/cryptsetup to Decrypt devices encrypted with cryptsetup/LUKS
[ ] app-crypt/gnupg to Support for GPG-encrypted keys for crypt module
[ ] app-shells/dash to Allows use of dash instead of default bash (on your own risk)
[ ] media-gfx/splashutils to Framebuffer splash (media-gfx/splashutils)
[ ] sys-block/open-iscsi to Support iSCSI
[ ] sys-fs/lvm2 to Support Logical Volume Manager
[ ] sys-fs/mdadm to Support MD devices, also known as software RAID devices
[ ] sys-fs/multipath-tools to Support Device Mapper multipathing
[ ] sys-boot/plymouth to Plymouth boot splash
[ ] sys-block/nbd to Support network block devices
[ ] net-fs/nfs-utils to Support NFS
[ ] net-nds/rpcbind to Support NFS
[ ] dev-libs/openssl to Install ssh and scp along with config files and specified keys
[ ] app-admin/syslog-ng to Enable logging with syslog-ng or rsyslog
[ ] app-admin/rsyslog to Enable logging with syslog-ng or rsyslog
Back to top
View user's profile Send private message
jebriggsy
n00b
n00b


Joined: 22 Aug 2013
Posts: 26
Location: USA

PostPosted: Thu Mar 27, 2014 5:50 am    Post subject: Reply with quote

All required packages are installed. Do those packages need to have static or static-libs flags set? I read something on the dracut wiki page that suggested they might but I hesitate to use them because I'm not 100% sure what they do.

Here is my dracut.conf http://bpaste.net/show/193684/
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 806
Location: S.O. France

PostPosted: Thu Mar 27, 2014 10:02 am    Post subject: Reply with quote

Can you post fstab, grub and lvscan

You can try with dracut-0.34-r4 to see if the problem is dracut
Back to top
View user's profile Send private message
jebriggsy
n00b
n00b


Joined: 22 Aug 2013
Posts: 26
Location: USA

PostPosted: Fri Mar 28, 2014 12:21 am    Post subject: Reply with quote

fstab: http://bpaste.net/show/194535/
lvscan (from working initramfs): http://bpaste.net/show/194536/ (on new initramfs, vg/swap and vg/home are inactive)
grub: http://bpaste.net/show/193682/

Will test with 0.34 and report back

EDIT:

With 0.34, swap now mounts, /home does not.

However, after logging in I can run lvchange -aly vg/home and then mount /home. I believe this narrows the problem down to dracut not running lvchange on all LVs or at least all listed in fstab. Should this be a bug report or am I missing some config option?
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 806
Location: S.O. France

PostPosted: Fri Mar 28, 2014 1:50 pm    Post subject: Reply with quote

Can you try # in your /etc/dracut.conf
Code:
#hostonly="yes"

This line is strange
Code:
dracut: Scanning devices dm-0  for LVM logical volumes vg/swap vg/root

I've try with your dracut.conf and the same parameters in my grub. I can't reprouduce the problem, but I don't use luks.
Can you post the output of dracut.... when you generate your initramfs.
Back to top
View user's profile Send private message
jebriggsy
n00b
n00b


Joined: 22 Aug 2013
Posts: 26
Location: USA

PostPosted: Fri Mar 28, 2014 3:31 pm    Post subject: Reply with quote

Using 0.34-r4:
Code:

$ sudo dracut '' 3.11.7-hardened-r1 --force
Executing: /usr/bin/dracut  3.11.7-hardened-r1 --force
*** Including module: dash ***
*** Including module: caps ***
*** Including module: i18n ***
*** Including module: crypt ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: kernel-modules ***
*** Including module: lvm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 56-lvm.rules
Skipping udev rule: 60-persistent-storage-lvm.rules
*** Including module: debug ***
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
Skipping udev rule: 80-drivers-modprobe.rules
*** Including module: syslog ***
*** Including module: usrmount ***
*** Including module: base ***
*** Including module: fs-lib ***
*** Including module: shutdown ***
*** Including modules done ***
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Resolving executable dependencies ***
*** Resolving executable dependencies done***
*** Stripping files ***
*** Stripping files done ***
*** Creating image file ***
*** Creating image file done ***


Testing with conig option hostonly="yes" commented out. Will edit after

EDIT: With hostonly="yes" commented out, dracut 0.34-r4 correctly unlocks and mounts all crypto LVs. Will now install 0.36-r4 and test using new config.
EDIT2: Dracut 0.36-r4 also works correctly with hostonly="yes" commented out in /etc/dracut.conf. Will now mark thread as solved.
Back to top
View user's profile Send private message
hika
Apprentice
Apprentice


Joined: 13 Mar 2009
Posts: 234
Location: Utrecht

PostPosted: Thu May 15, 2014 10:52 pm    Post subject: Reply with quote

I can confirm that for some reason the newer dracut versions don't properly support lvm. The device nodes simply don't get created. I had trouble for some time on several systems with creating new a initramfs after a kernel upgrade. Since at those times I had the old initramfs, which worked, I didn't look further. But now I'm installing a new system and I can only get a working initramfs by going back to 034-r4. It seems to coincide with the DRACUT_MODULES keywords not being used anymore! As said no nodes are created, so my guess is the lvm modules are not installed properly anymore since.
I also notice that the initramfs with exactly the same configuration, created with version 034-r4 is one and a half times as big as with 037!

Hika
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum