Dracut/kernel-install target wrong partition

So I did some reorganization, converted from using separate partitions to btrfs subvolumes instead and everything looked good once I was done. To be save (I lost a btrfs partition on another machine while trying to move and resize) I started with a fresh btrfs partition, created the subvolumes and moved all data from old partitions in there.

I had updated the systemd/efi boot config and the fstab in the new root subvolume and the system would boot fine and work.

Now, one “yay” later, a new kernel got pulled and installed. I have not rebooted yet but checked the newly generated loader entry config file and the kernel options are created wrong: the root= is pointing to the old partition where the system was initially installed and the rootflags=subvol is also not pointing to the new subvol but the old one on the old partition

I looked around and found /etc/kernel/cmdline and updated that with the correct new values. But this file doesn’t seem to be used since another run of dracut will still use the wrong old partition.

Finally, the question: how to tell dracut about the new partition and subvolume for root?

You need to run sudo reinstall-kernels after updating /etc/kernel/cmdline

Also, if you use snapshots, be careful not to create a separate subvolume for /var

As a side note, that isn’t controlled by dracut, it is set by the bootloader.

Nice, thanks.

so, updating /etc/kernel/cmdline is the right thing to do. I only wasn’t aware of the reinstall-kernels

1 Like

Would this be equivalent of systemd-boot for when you need to update the grub.cfg after you edit the /etc/default/grub, kind of?

Sort of?

Most changes don’t require you to run a command. It is only when you update the kernel options.

1 Like