dracut

From Kicksecure
Jump to navigation Jump to search
Advanced Documentation Previous page: grub Index page: Advanced Documentation Next page: Installation of Debian based Linux distributions in a folder chroot dracut
dracut logo

dracut is an initial ramdisk (also called initrd or initramfs) generator. It assembles the early userspace image used during boot.

Introduction

[edit]

This page documents dracut usage, terminology, and common tasks such as checking which initrd generator is installed, installing dracut, and re-generating the initrd. It also highlights important warnings, typical pitfalls, and where to look for upstream development and bug reports.

Initial Ramdisk Based Encryption Password Prompt

[edit]

Please enter passphrase for disk ... (press TAB for no echo)

Figure: initramfs (initramfs-tools or dracut) Based Encryption Password Pre-Boot Authentication Prompt - Example (cropped)

Kicksecure GRUB

Figure: initramfs (initramfs-tools or dracut) Based Encryption Password Prompt - Example (full)

This is related to Full Disk Encryption (FDE).

Terminology

[edit]

initrd

initrd is the initial ramdisk. It is a small filesystem used as part of the boot process to provide an early userspace environment, so the system can load drivers and mount the real operating system (OS) root filesystem. A common synonym is initramfs. [1] [2]

In modern Linux systems, the initramfs is typically a compressed cpio archive that the kernel unpacks into RAM and then runs /init from. Older systems used an initrd image as a RAM disk style filesystem image. [3]

exitrd

exitrd [4] is the shutdown ramdisk (also called a shutdown initramfs). It is conceptually symmetrical to initrd, but it is not a standalone kernel feature: it is implemented in user space (most commonly by systemd). During late shutdown, if /run/initramfs/shutdown exists, systemd can switch root into /run/initramfs and execute /shutdown from there, so the old root filesystem can be unmounted cleanly and complex storage stacks can be dismantled. [5] [6]

On systems using dracut, this commonly involves restoring (unpacking) an initramfs into /run/initramfs during shutdown, so it is available for the exitrd switch-root step. [7]

A synonym is initramfs-shutdown.

Find out which initrd Generator is installed

[edit]

To check if dracut is already installed, run. On Debian based operating systems such as Kicksecure this can be done using the following commands.

dpkg -l | grep dracut

To check if initramfs-tools is already installed, run.

dpkg -l | grep initramfs-tools

Installation

[edit]

1 Notices.

Info Platform specific.

  • Debian: The following warning is applicable because dracut is not installed by default in Debian.
  • Kicksecure: The following warning is only applicable if dracut is not yet installed. In newer Kicksecure versions, dracut is installed by default.

To check your currently installed initrd generator, see Find out which initrd Generator is installed.

2 Warning.

warning Warning: There is a risk of the system becoming unbootable due to changes in the initrd creation tool.

  • General risk: The system may become unbootable when changing the initrd creation tool.
  • Backups: Always maintain backups and proceed with caution when making changes.
  • Dracut bug reports: If issues with dracut occur, do not report them here, as they are unrelated to Kicksecure.

3 Create folder /etc/dracut.conf.d.

sudo mkdir --parents /etc/dracut.conf.d

4 Create a new configuration file. [8]

Open file /etc/dracut.conf.d/60_user.conf in an editor with administrative ("root") rights.

1 Select your platform.

Kicksecure

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.

3 Open the file with root rights.

sudoedit /etc/dracut.conf.d/60_user.conf

Kicksecure-Qubes

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.
  • Template requirement: When using Kicksecure-Qubes, this must be done inside the Template.

3 Open the file with root rights.

sudoedit /etc/dracut.conf.d/60_user.conf

4 Notes.

  • Shut down Template: After applying this change, shut down the Template.
  • Restart App Qubes: All App Qubes based on the Template need to be restarted if they were already running.
  • Qubes persistence: See also Qubes Persistence
  • General procedure: This is a general procedure required for Qubes and is unspecific to Kicksecure-Qubes.

Others and Alternatives

2 Notes.

  • Example only: This is just an example. Other tools could achieve the same goal.
  • Troubleshooting and alternatives: If this example does not work for you, or if you are not using Kicksecure, please refer to Open File with Root Rights.

3 Open the file with root rights.

sudoedit /etc/dracut.conf.d/60_user.conf

5 Paste.

hostonly=yes hostonly_mode=sloppy

6 Save.

7 Install dracut and systemd-cryptsetup.

sudo apt install --no-install-recommends dracut systemd-cryptsetup

8 Done.

Installation of dracut has been completed.

Re-Generate dracut Initrd

[edit]

1 Run.

sudo dracut -f

2 Done.

The dracut initrd has been re-generated.

Development

[edit]

Bugs

[edit]

Advanced Documentation Previous page: grub Index page: Advanced Documentation Next page: Installation of Debian based Linux distributions in a folder chroot

Notification image

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 14 year success story and maybe DONATE!