Difference between revisions of "User:Krathalan"

From ArchWiki
Jump to navigation Jump to search
(Inital draft of dracut page)
 
m (Minor organizational edit)
Line 8: Line 8:
 
{{Note|Read the mailing list announcement for a possible [https://lists.archlinux.org/pipermail/arch-dev-public/2019-May/029570.html Mkinitcpio replacement with Dracut].}}
 
{{Note|Read the mailing list announcement for a possible [https://lists.archlinux.org/pipermail/arch-dev-public/2019-May/029570.html Mkinitcpio replacement with Dracut].}}
  
[https://dracut.wiki.kernel.org/ dracut] creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem. This might replace [[mkinitcpio]] in Arch Linux in the near future.
+
[https://dracut.wiki.kernel.org/ dracut] creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem. This might replace [[mkinitcpio]] in Arch Linux in the near future. dracut is used by Fedora, RHEL, Gentoo, and Debian, among others.
  
 
At this time dracut usage should be considered experimental and not supported. If you are having issues using dracut, go back to [[Mkinitcpio|mkinitcpio]].
 
At this time dracut usage should be considered experimental and not supported. If you are having issues using dracut, go back to [[Mkinitcpio|mkinitcpio]].
 
dracut is used by Fedora, RHEL, Gentoo, and Debian, among others.
 
  
 
You can read the full project documentation for dracut [https://mirrors.edge.kernel.org/pub/linux/utils/boot/dracut/dracut.html in the kernel documentation].
 
You can read the full project documentation for dracut [https://mirrors.edge.kernel.org/pub/linux/utils/boot/dracut/dracut.html in the kernel documentation].

Revision as of 23:10, 6 October 2019

This is a WIP draft for the dracut wiki page.

Note: Read the mailing list announcement for a possible Mkinitcpio replacement with Dracut.

dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem. This might replace mkinitcpio in Arch Linux in the near future. dracut is used by Fedora, RHEL, Gentoo, and Debian, among others.

At this time dracut usage should be considered experimental and not supported. If you are having issues using dracut, go back to mkinitcpio.

You can read the full project documentation for dracut in the kernel documentation.

Installation

dracut can be installed with the dracut package.

Usage

dracut is easy to use and typically does not require user configuration, even when using non-standard setups, like LVM on LUKS.

To generate an initramfs for the running kernel:

# dracut --hostonly --force /boot/initramfs-linux.img

The --hostonly flag creates an image that only contains the files needed to boot the local host system, instead of creating a generic image with more files. Using this flag

The --force flag overwrites the file if it's already there.

/boot/initramfs-linux.img refers to the output image file. If you are using the non-regular kernel, consider changing the file name. For example, for the linux-lts kernel, the output file should be named /boot/initramfs-linux-lts.img. However, you can name these files whatever you wish as long as your bootloader configuration uses the same filenames.

Tips and tricks

Change compression program

To reduce the amount of time spent compressing the final image, you may change the compression program/format.

Warning: Make sure your kernel has your chosen decompression support compiled in, otherwise you will not be able to boot. You must also have the chosen compression program package installed.

Simply add any of the following flags to your dracut command:

--gzip (default)
--bzip2
--lzma
--xz
--lzo
--lz4
--zstd

You can also use a non-officially-supported compression program:

--compress <program>

Or specify no compression at all:

--no-compress

See also