We are considering replacing initramfs-tools by Dracut as initrd generation tool in future Ubuntu releases.

Ubuntu 24.10 (oracular) ships a dracut version that should work on all machines and in most cases.

If you have machines running with Ubuntu 24.10 (oracular) and are comftable with the instructions below, we like to ask you to test Dracut on your machines. If you run into issue, please report them against dracut. If it works for you, you can report the success on this post.

How to test dracut

These steps are designed to be easy and safe to revert back.

  1. Check the ‘Known Issues’ section if your setup is known not to work. In this case, you can stop here.

  2. Ensure that you have a backup initrd available to boot. Unless it is a fresh installation, there should be two kernels and corresponding initrds. The ls command shows all the initrds on your system:

ls -alh /boot/initrd.img-*

If there is only one initrd, create a backup of your current initrd:

sudo cp /boot/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r).orig

Note: Having a fallback is important in case booting with Dracut fails or in case generating the initrd with initramfs-tools fails when booted with a Dracut initrd (see bug #2084809 for such an example).

  1. Install dracut-core:
sudo apt install dracut-core

The dracut-core package will provide the dracut program, but will not replace the default initrd tool (so kernel updates will continue using initramfs-tools for initrd generation). If your system boots over the network, please also install dracut-network.

Important: Do not install the dracut binary package, because this would remove initramfs-tools.

  1. Generate an initrd with dracut
sudo dracut -H --hostonly-mode=sloppy --force

This command will create an initrd for the running kernel. Please report a bug in case this command fails or in case there are warnings or errors in the output.

Note: The dracut call should just be sudo dracut --force, but you have to add -H --hostonly-mode=sloppy as workaround for bug #2084809.

  1. Reboot

Reboot your machine. In case your system fails to boot, use the fallback boot entry. In case you only had one initrd in step 2, use the backed up initrd: If you use GRUB, edit the GRUB boot entry and change the initrd line to the backup by adding .orig to the initrd name.

  1. Restore the system.

6a. Restore the backup initrd:

sudo mv /boot/initrd.img-$(uname -r).orig /boot/initrd.img-$(uname -r)
ls -alh /boot/initrd.img-*

6b. Reboot

6c. Remove dracut-core:

sudo apt remove dracut-core

Reporting success

In case your system boots successfully with Dracut, please comment here with the information about your system and setup:

echo "System:"
cat /sys/devices/virtual/dmi/id/sys_vendor
cat /sys/devices/virtual/dmi/id/product_family
cat /sys/devices/virtual/dmi/id/product_name
echo "Root mount:"
mount | grep " / "

Please state if you use an uncommon setup.

Reporting failures

Please check if your problem is already reported. See the known issues listed below and Bugs : dracut package : Ubuntu for all reported bug. If your problem is not reported there yet, please report it using ubuntu-bug dracut-core.

Known issues

4 Likes

While this is a step in the right direction it is still a step behind everyone else which are currently testing mkosi-initrd. What is the reason for not directly going in that direction?

All the dracut and initramfs-tools scripts are just duplicating effort that have already been solved by package managers and systemd/udev and which mkosi is utilizing. Having deployed Debian based machines with initrds generated using mkosi I can say that is was a breath of fresh air to work with it.

2 Likes

Works here: Ubuntu 24.10

System:
ASRock - Zen 5 Ryzen 9900X
Default string
B650M Pro RS WiFi
Root mount:
/dev/nvme0n1p1 on / type ext4 (rw,relatime,errors=remount-ro)

It works with me. For some reason, cache maybe, I still see the Dell boot screen with Ubuntu 20 years below. I have multiple kernels but I tested using the latest one from Ubuntu 24.10.
System:
Dell Inc.
GSeries
Dell G15 5511
Root mount:
/dev/nvme1n1p2 on / type ext4 (rw,relatime,errors=remount-ro)

Works well for me too.

System:
QEMU

Standard PC (Q35 + ICH9, 2009)
Root mount:
/dev/mapper/vgxubuntu-root on / type ext4 (rw,relatime,errors=remount-ro)

For some reason, the image generated by dracut is much smaller.

root@agw:~# ls -lh /boot/initrd.img-6.11.0-061100-generic*
-rw-r–r-- 1 root root 22M Oct 19 11:07 /boot/initrd.img-6.11.0-061100-generic
-rw-r–r-- 1 root root 69M Oct 19 11:06 /boot/initrd.img-6.11.0-061100-generic.orig

root@agw:~# file /boot/initrd.img-6.11.0-061100-generic
/boot/initrd.img-6.11.0-061100-generic: ASCII cpio archive (SVR4 with no CRC)
root@agw:~# file /boot/initrd.img-6.11.0-061100-generic.orig
/boot/initrd.img-6.11.0-061100-generic.orig: ASCII cpio archive (SVR4 with no CRC)

Succesfully.

System:
Kubuntu 24.10
Gigabyte Technology Co., Ltd.
To be filled by O.E.M.
Root mount:
/dev/sdb1 on / type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,autodefrag,subvolid=256,subvol=/@)

ls -lh /boot/initrd.img*
lrwxrwxrwx 1 root root 27 říj 7 14:37 /boot/initrd.img → initrd.img-6.11.0-8-generic
lrwxrwxrwx 1 root root 27 říj 7 14:37 /boot/initrd.img.old → initrd.img-6.11.0-8-generic
-rw------- 1 root root 20M říj 19 11:50 /boot/initrd.img-6.11.0-8-generic
-rw------- 1 root root 71M říj 19 11:49 /boot/initrd.img-6.11.0-8-generic.orig

System:
Dell Inc.
XPS
XPS 8930
Root mount:
/dev/nvme0n1p2 on / type ext4 (rw,relatime,discard)

Worked well on my DesktopPC with Ubuntu 2410.

System:
Gigabyte Technology Co., Ltd.
Default string
AB350N-Gaming WIFI
Root mount:
/dev/sda2 on / type ext4 (rw,relatime)

For the use case we are talking about here, locally-generated initrds, mkosi-initrd is not intended in the first place. Dracut will remain around for that for the foreseeable future in all distros.

mkosi-initrd’s use case is pre-built initrds, and we already have a solution for that: core-initrd and snapped kernels, as used on FDE desktop images.