What were the reasons for :enos: to choose `dracut` over `mkinitcpio`?

Sure. Since you are an ISO tester, I hope I can be more terse:

System

The most important thing is to have systemd in the initramfs so that we can use systemd-gpt-autogenerator. I use mkinitcpio with the following hooks line:

HOOKS=(systemd autodetect modconf kms keyboard keymap block filesystems fsck)
cat /etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>

It wasn’t existing before the restart, but some cheeky script or service seems to have regenerated an empty /etc/fstab. Good enough for me.

sudo cat /boot/loader/entries/arch.conf

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options quiet loglevel=3

You can get by without the options, but for cosmetic reasons (clutter of bluetooth unrecognized command), I added these. Note the absence of any root=... stanza.

Install

sudo gdisk -l /dev/sda
Disk /dev/sda: 3907029168 sectors, 1.8 TiB
Model: Samsung SSD 870 
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): BC298696-417A-412F-870A-0CE790682171
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 3907029134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2157 sectors (1.1 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          239615   16.0 MiB    0C01  Microsoft reserved ...
   3          239616       204802047   97.5 GiB    0700  Basic data partition
   4       204802048       205926399   549.0 MiB   2700  Windows RE
   5       205926400       206950399   500.0 MiB   EA00  XBOOTLDR partition
   6       206950400       215339007   4.0 GiB     8200  Linux swap
   7       215339008       267767807   25.0 GiB    8304  Linux x86-64 root (/)
   8       267767808       372625407   50.0 GiB    8302  Linux /home
   9       372625408      3907028991   1.6 TiB     8306  Linux /srv

This is how the system was set up. Note the specific Linux partitions (8304 instead of 8300 for an x86-64 root etc). See Poettering’s Linux Boot Partitions and How to Set Them Up (to work with systemd-gpt-auto-generator, available in every systemd install).

Setup itself was very easy, I just had to mount the partitions to their respective directories:

dysk
┌──────────┬────┬────┬────┬─────────┬────┬────┬───────────┐
│filesystem│type│disk│used│   use   │free│size│mount point│
├──────────┼────┼────┼────┼─────────┼────┼────┼───────────┤
│/dev/sda9 │ext4│SSD │ 74G│ 9% ▌    │723G│798G│/srv       │
│/dev/sda8 │ext4│SSD │2.8G│ 5% ▎    │ 50G│ 53G│/home      │
│/dev/sda7 │ext4│SSD │4.2G│16% ▊    │ 22G│ 26G│/          │
└──────────┴────┴────┴────┴─────────┴────┴────┴───────────┘

lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda       8:0    0 931.5G  0 disk 
├─sda1    8:1    0   100M  0 part /efi
├─sda2    8:2    0    16M  0 part 
├─sda3    8:3    0  91.9G  0 part 
├─sda4    8:4    0   773M  0 part 
├─sda5    8:5    0   500M  0 part /boot
├─sda6    8:6    0   7.3G  0 part [SWAP]
├─sda7    8:7    0    25G  0 part /
├─sda8    8:8    0    50G  0 part /home
└─sda9    8:9    0 755.9G  0 part /srv
nvme0n1 259:0    0   3.7T  0 disk 

The difference between dysk and lsblk is that the latter uses the cached data and dysk gets the info real-time, so it cannot see /boot and /efi which are only accessible for root. /dev/sda2 to /dev/sda4 are the MSWindows partitions.

After mounting, the rest of the install followed the Arch Install Guide.

Advantages

  • Shorter boot time (gut feeling)
  • Clean system:
    System is not relying on UUID, Labels or device names.
    /etc/fstab can be used exclusively for added fixed storage.

I mount removable storage at login with the following snippet in

~/.profile

# mount unmounted disks with unspecified labels

for disk in /dev/disk/by-uuid/*; do
    if ! [[ $(lsblk -no FSTYPE $disk) =~ ^(swap|zfs-member)$ ]]; then
    findmnt $disk >/dev/null || udisksctl mount -b $disk
    fi
done

so everything has a separate section. System partitions are not visible, fixed storage is in /etc/fstab, removable stuff gets mounted to /run/media/user at login.

  • Easy backup and restore without adjustments in initrd and /etc/fstab for new UUIDs.
  • Lower possibility of screwups due to user errors, /boot and /efi are shielded.
  • No need to make the risky enlargement of the MSWindows-generated UEFI partition.

Disadvantages

  • Only possible for first Linux system on disk
  • More complicated disk partioning

If only this would work with dracut. But the standard :enos: install won’t install kernels, they all end up in /dev/null (wtf?). Maybe @dalto can help here…

1 Like