Dracut strangeness
So, I've been beating my head against this for too long. I found a fix, but I don't like it because it requires modifying scripts that probably will get updated. Maybe someone can tell me what I can't see. This is a long post, but the solution is complicated.
I've scoured the 'net for information on dracut and how to deal with a luks-crypt partition that holds the LVM that contains root, swap, and home, and little of it has been useful. I have several computers running Leap 15.2 with different hard disk configurations, and only one has a dracut problem when it creates the new initrd after a kernel update. I have two computers with the exact same hard disk partitioning below, but only one has the dracut problem, and I can't figure out why. After a kernel update and YaST runs dracut, there is no crypt module in any initrd on /boot, so the computer won't boot. My solution has been to boot off the distro DVD into the installation section, then after it asks for the decryption password, run through these steps from a console (Ctrl-Alt-F2): Code:
1. mkdir ttt Here's my lsblk: Code:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT Code:
/dev/sda1: LABEL="ZuleBoot" UUID="480bf83c-0505-4405-adbb-a9be37f32baf" TYPE="ext2" PTTYPE="dos" PARTUUID="000057e4-01" Code:
cr_ZuleSysLVM /dev/disk/by-uuid/f820119e-0e89-4743-ba34-e0d0172b2251 none luks Code:
/dev/ZuleSys/Root / ext4 acl,user_xattr 1 1 Code:
add_dracutmodules+=" crypt " The line numbers don't match up with that link, but the idea is the same. The snippet of my module-setup.sh is this: Code:
if [ "${forceentry}" = "yes" ]; then Best I can figure from dracut's debug output, dracut only looks at the swap partition inside the LVM. It never looks at ZuleSys-Root. With the default setup, dracut decides that there are no luks-crypt partitions so it does not include anything related to decrypting it at boot time. The modification to module-setup.sh and myconf.conf force it to include the crypt stuff and create etc/crypttab and etc/cmdline.d/90crypt.conf in the initrd. I have tried different versions for /etc/crypttab with no effect. I've tried forcing dracut to include the crypt module and include crypttab and 90crypt.conf, but it makes its own crypttab unless 90crypt/module-setup.sh is modified as shown. Can anyone see what's wrong with this setup? Why does it not work right when others do? Thanks for your help. |
Code:
# inxi -SM You could temporarily replace your swapper with another EXT4, install another 15.2, or 15.3 or TW, and diff some of their files until you find something different, if the fresh installation works as expected. If it doesn't, you've a reproducible scenario that warrants a bug report. |
FWIW, mrmazda, my no-GUI file server uses 3.7GB in /, while my main "work" desktop uses 24GB. The main desktop has multiple DEs and tons of development files loaded up.
Sure, I could try a fresh installation, but only at a very last resort. This is a fairly minor annoyance, and surely there's some solution without wiping the whole thing away and starting over. The part I don't get is why this one installation has this issue while 3 others do not. One installation that does not have this problem has the exact same partitioning, luks crypt, and LVM scheme. That's the puzzle. |
Where did you see a suggestion to wipe away "the whole thing" or "starting over"? A temporary extra installation using your normal swap space is neither, and presents an opportunity to diff a whole lot of files that should be exact matches or immaterially different.
That 4696490 blocks representing 62% usage on / above would change to about 3086515 blocks representing about 38.4% usage if I removed all but one kernel. Instead of temporarily re-purposing swap, you could shrink /home by 4GB, temporarily or otherwise, to make space for a direct comparison installation. |
Sorry, mrmazda, I misread what you meant.
I will point out that to make my computer bootable, I boot from the distro DVD into installation, then chroot to the installed system. Unless I'm mistaken, that means I'm using what's installed on the hard disk, not the DVD, to run dracut and fix things so I can boot from the installed system. I've compared some of the dracut scripts on the problem computer with those on another and they're exactly the same. |
There are regulars on the openSUSE forums with a lot more familiarity with LVM and crypto than I. Consequently, the only other suggestion I can make is to try there, or the regulars on the openSUSE support mailing list.
|
Yes, I will post on the openSUSE forums once I can. I've registered and can get to everything but the forums. I posted here because I could and it seemed like a good place to start.
|
Well, I found the problem.
After comparing dracut's output booting from the installation DVD and the output booting from the installed system, the only difference was the device name I chose in crypttab. In my first post, crypttab started with "cr_ZuleSysLVM". That name is reflected everywhere, like in lsblk, blkid, and even device names sprinkled throughout /dev. Booting into the DVD, that installer doesn't read my crypttab - it makes up its own name, "cr_auto-2". The real bug is string comparisons in sh. The dracut debug output has lines like this: Code:
[[ CRYPT-LUKS1-f820119e0e894743ba34e0d0172b2251-cr_ZuleSysLVM != LVM-* ]] Code:
[[ CRYPT-LUKS1-f820119e0e894743ba34e0d0172b2251-cr_ZuleSysLVM =~ LVM-* ]] If the made-up name includes LVM, those string comparisons don't work as the coder expected. Once I lopped off the LVM from that name in crypttab, booted with the DVD, and rebuilt my initrd, everything is working properly. In my installed system, dracut now finds the luks crypt partition and makes initrd properly. tl;dr: do not use "LVM" in your crypttab name. |
Nice find. That's a bug - report it.
|
Quote:
|
I'm gonna report it on the dracut github page, as it's not specific to openSUSE.
https://github.com/dracutdevs/dracut |
All times are GMT -5. The time now is 05:12 PM. |