Dracut | Grub | Speed up boot by Specifying a Boot Device AND Kernel Command Line

Not to worry. You are right I am using GRUB. I have been reading and learning (best thing about being part of the community with supportive people like you).

So I found two other references which I think might work … but ofcourse second set of eyes always helps.

  1. dracut is capable of embedding the kernel parameters in the initramfs, thus allowing to omit them from the boot loader configuration. See dracut#Kernel command line options

    Source:
    https://wiki.archlinux.org/title/Kernel_parameters

  2. Kernel command line options

Kernel command line options can be placed in a .conf file in /etc/dracut.conf.d/, and set via the kernel_cmdline= flag. Dracut will automatically source this file and create a 01-default.conf file and place it inside the initramfs directory /etc/cmdline.d/. For example, your kernel command line options file could look like:

/etc/dracut.conf.d/cmdline.conf

kernel_cmdline=“rd.luks.uuid=luks-f6c738f3-ee64-4633-b6b0-eceddb1bb010 rd.lvm.lv=arch/root rd.lvm.lv=arch/swap root=/dev/arch/root rootfstype=ext4 rootflags=rw,relatime”

Source:
https://wiki.archlinux.org/title/Dracut#Kernel_command_line_options

If I am reading the references above correctly it looks like I can move the following lines out of the /etc/default/grub and use the following solution:

  1. Create cmdline.conf file in the dracut directory.
sudo touch /etc/dracut.conf.d/cmdline.conf
  1. Edit the /etc/dracut.conf.d/cmdline.conf
sudo nano /etc/dracut.conf.d/cmdline.conf
  1. Get Root Partition configuration configuration information and put into the “kernel_cmdline” of the “/etc/dracut.conf.d/cmdline.conf” file.

The below configuration line assumes your root partition is:

  • Not on a LVM volume.
  • Not on a raid partition
  • Does not lives inside a specific crypto LUKS encrypted volume.
kernel_cmdline="rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0"
  1. I can then remove the same references from /etc/default/grub/

Do you think this is a good best practice?

1 Like