[NEWBIE] Updating initramfs?

Hi there!

I’m a 3D Artist who was previously mainly on Windows, but decided to permanently move to Linux because of Rocky Linux. The main programs I work with are Maya 2023, Substance Painter, and Blender.
I’m not a Linux newbie per say (neither an expert), I’ve been an Arch Linux user since 2013, and lately mainly an Ubuntu user (due to Maya’s 2022 compatibility with Ubuntu), but unfortunately I could not get Maya 2023 to start in any other distro other than Rocky. It’s too much of a hassle everywhere, and instead of spending time trying to make things work I decided to try one of the officially supported distros for Maya, which is Rocky.

After some testing, I absolutely love Rocky! It rocks! (pun intended :wink: ).

Now, I encrypt everything, all my drives. Here’s my drive layout:

  • 128 GB SSD for EFI, /boot, /root, etc;
  • 2 TB HDD for storage, which I also use as /home;
  • 256 GB SSD for “working directory”. Some of the files I work with are pretty big (like 1-5 GiB easy) and I have Autosave enabled (specially for Maya), so if I have my “Maya temp” folder on my root drive the OS will freeze whenever the programs autosave. Having a separate SSD for working files removes this problem and also allows me to open/save files quicker.

I want to make these non-root drives mount automatically. The method which worked for me before switching to Rocky was this one: cryptsetup - Why my encrypted LVM volume (LUKS device) won't mount at boot time? - Unix & Linux Stack Exchange

I got everything working, execept for the “update-initramfs” part, which I have no idea how to do in Rocky. This is my first time using anything other than openSUSE/Arch/Debian-family distros (the last one being the one I used the most recently), and some tutorials about this subject differ from others, so I’m kind of afraid to screw everything up.

How can I update my initramfs and make those drives automatically mount, using the tutorial I linked above as my previous method? I tried rebooting without updating the initramfs but I was dropped to a recovery thing.

Thanks!

Glad to hear you’re having good success with Maya on Rocky. If you want to generate a new initramfs, make sure you’re running on the latest kernel installed on your system and then try this (using one of my systems as an example):

[root@xmpp01 ~]# cd /boot
# Make a backup
[root@xmpp01 boot]# cp initramfs-$(uname -r).img initramfs-$(uname -r).img.backup
# Regenerate
[root@xmpp01 boot]# dracut -f initramfs-$(uname -r).img  $(uname -r)
[root@xmpp01 boot]# ls | grep "$(uname -r)"
config-4.18.0-348.20.1.el8_5.x86_64
initramfs-4.18.0-348.20.1.el8_5.x86_64.img
initramfs-4.18.0-348.20.1.el8_5.x86_64.img.backup
initramfs-4.18.0-348.20.1.el8_5.x86_64kdump.img
symvers-4.18.0-348.20.1.el8_5.x86_64.gz
System.map-4.18.0-348.20.1.el8_5.x86_64
vmlinuz-4.18.0-348.20.1.el8_5.x86_64

At that point you can reboot.

Thank you, Nazunalika, but I’m not able to boot yet for some reason.

(sda is where the 2TB HDD was mounted. I don’t mind this)

NAME UUID MOUNTPOINT
sda
└─sda1 4e072191-d976-496a-809c-5e3655b4a871
└─2TB 02xhUr-ugp0-i1uW-vzf4-yLvY-rjqS-d0TkJM
└─home-home_LV 800eaefa-b3a3-4aa8-b813-e4a61afc0f72 /mnt/home

My /etc/crypttab (first entry was already there)

luks-6c78f38d-f1a0-4510-9b3a-72f2fc439aac UUID=6c78f38d-f1a0-4510-9b3a-72f2fc439aac none discard
2TB UUID=02xhUr-ugp0-i1uW-vzf4-yLvY-rjqS-d0TkJM MY_PASSWORD luks

/etc/fstab

UUID=800eaefa-b3a3-4aa8-b813-e4a61afc0f72 /mnt/home ext4 defaults 0 2

/mnt/home exists and is where “home_LV” is currently mounted.

Then I did

cd /boot
dracut -f initramfs-$(uname -r).img $(uname -r)

But still not able to boot.

Am I missing something here?

EDIT: If it’s of any help, I saw some messages about “dependency failed for cryptography setup”.

EDIT2: I see that /etc/default/grub has some options I never really used. Maye this line is important and I need to add something to it?

GRUB_CMDLINE_LINUX=“crashkernel=auto resume=/dev/mapper/rl-swap rd.luks.uuid=luks-6c78f38d-f1a0-4510-9b3a-72f2fc439aac rd.lvm.lv=rl/root rd.lvm.lv=rl/swap rd.driver.blacklist=nouveau”

OK, found the problem. It’s either one of these two options, not sure which one (probably the latter) but it worked after doing both procedures:

  • Instead of having the password on /etc/crypttab I left it as “none” and the system automounted it anyways (didn’t use to be this way, cryptsetup wasn’t that smart in the past);
  • Apparently I can’t make Rocky mount that HDD by using it as LUKS-LVM, it needs to be pure LUKS for it to work.

Now it works fine, all encrypted volumes mounted at boot with a single password:

Now, to enjoy this amazing OS!