You are not logged in.

#1 2022-11-21 08:42:17

telometto
Member
From: Braunau
Registered: 2020-09-30
Posts: 23

Which files are okay to remove from /boot when switching to dracut?

I made another post a couple of days ago (which no one responded to, unfortunately sad) where I asked why trying to generate images for installed kernels resulted in a "no space left on device" error. Well, I found that there actually wasn't any space left on my /boot partition. I deleted one of the kernels, and manually removed an image, which led `dracut` to rebuild successfully. I followed this reddit post and now I'm just waiting for a new kernel to be released so that I can see if it rebuilds everything properly.
I used the `archinstall` script when I installed Arch and chose `systemd-boot` and, since Arch uses `mkinitcpio` as the default initramfs, it has created system images using `mkinitcpio`, so my question is what can I safely remove from /boot?

This is the result of `tree /boot`:

/boot
├── amd-ucode.img
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Linux
│   │   ├── linux-6.0.9-arch1-1-6cbacb3c969c4299bfa70572a86032d6-rolling.efi
│   │   └── linux-6.0.9-zen1-1-zen-6cbacb3c969c4299bfa70572a86032d6-rolling.efi
│   └── systemd
│       └── systemd-bootx64.efi
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── initramfs-linux-lts-fallback.img
├── initramfs-linux-lts.img
├── initramfs-linux-zen-fallback.img
├── initramfs-linux-zen.img
├── loader
│   ├── entries
│   │   ├── 2022-11-13_19-12-22_linux.conf
│   │   └── 2022-11-13_19-12-22_linux-lts.conf
│   ├── entries.srel
│   ├── loader.conf
│   └── random-seed
├── vmlinuz-linux
├── vmlinuz-linux-lts
└── vmlinuz-linux-zen

This is the result of `# sbctl verify`:

✓ /boot/EFI/BOOT/BOOTX64.EFI is signed
✓ /boot/EFI/Linux/linux-6.0.9-arch1-1-6cbacb3c969c4299bfa70572a86032d6-rolling.efi is signed
✓ /boot/EFI/systemd/systemd-bootx64.efi is signed
✓ /boot/vmlinuz-linux is signed
✓ /boot/vmlinuz-linux-lts is signed
✓ /boot/vmlinuz-linux-zen is signed
✓ /boot/EFI/Linux/linux-6.0.9-zen1-1-zen-6cbacb3c969c4299bfa70572a86032d6-rolling.efi is signed

This is the result of `# df -h /dev/nvme0n1p1`:

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  510M  426M   85M  84% /boot

I have uninstalled `mkinitcpio`, since the images created by `dracut` work as they should, so I'd like to remove the unneeded images created by the former in a safe manner.

  - Cheers


"Concern should drive us to action and not into depression."
    -- Pythagoras

Offline

#2 2022-11-21 09:09:56

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Which files are okay to remove from /boot when switching to dracut?

The brave trail:
1. Create an Arch installer on a USB stick.
2. Backup "/boot" as a tarball to that Arch installer stick.
3. Purge everything that isn't microcode and bootloader.
4. Run the dracut commands according to the wiki (or whatever you've been cooking)
5. Restore boot from your tarball via the Arch installer USB stick in case you killed it.

The still-brave-but-not-as-whack trail:
1. Mount something empty (a ram-disk?) over /boot and run your dracut commands and see what it generates.

I call this one "the lazy scholar":
1. Read the dracut wiki article COMPLETELY.
2. There is a "/usr/local/bin/dracut-install.sh" mentioned in the article with some simple rm commands.

Offline

#3 2022-11-21 10:02:07

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Which files are okay to remove from /boot when switching to dracut?

telometto wrote:

Which files are okay to remove from /boot when switching to dracut?

None of them.
Both mkinitcpio and dracut create files with the same names, they just use different methods to do so.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-11-21 10:03:22

telometto
Member
From: Braunau
Registered: 2020-09-30
Posts: 23

Re: Which files are okay to remove from /boot when switching to dracut?

Awebb wrote:

The brave trail:
The still-brave-but-not-as-whack trail:
1. Mount something empty (a ram-disk?) over /boot and run your dracut commands and see what it generates.

I have now created a `tmpfs` by doing `# mount -t tmpfs -o size=2g /boot /mnt/tmp` but running `# dracut --force --uefi` does not create any files inside `/mnt/tmp/` - how can I make it create files in the given dir?


"Concern should drive us to action and not into depression."
    -- Pythagoras

Offline

#5 2022-11-21 10:04:34

telometto
Member
From: Braunau
Registered: 2020-09-30
Posts: 23

Re: Which files are okay to remove from /boot when switching to dracut?

Slithery wrote:

None of them.
Both mkinitcpio and dracut create files with the same names, they just use different methods to do so.

Hmmm... so, basically, I cannot have more than two kernels installed at the same time, unless I expand the size of the /boot partition?

Last edited by telometto (2022-11-21 10:04:58)


"Concern should drive us to action and not into depression."
    -- Pythagoras

Offline

#6 2022-11-21 10:25:06

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Which files are okay to remove from /boot when switching to dracut?

That is correct. Some bootloaders support reading from ext4 or btrfs. In those scenarios, you could have your kernel on your root partition in a folder called /boot and mount the ESP elsewhere.

Refer to this article for an overview: Arch_boot_process#Boot_loader
Refer to this article's 4.1 for more about ESP mount points: EFI_system_partition#Mount_the_partition

Last edited by Awebb (2022-11-21 10:26:09)

Offline

#7 2022-11-23 00:28:03

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: Which files are okay to remove from /boot when switching to dracut?

telometto wrote:

Hmmm... so, basically, I cannot have more than two kernels installed at the same time, unless I expand the size of the /boot partition?

It depends. In general, a partition of that size could accommodate more than two kernels. But it obviously depends on the sizes of things, what other files you want and so on. Since I'm using 178M for two kernels, I could certainly install an additional kernel (or two) without exceeding 512M. So it is certainly possible, but whether it is possible for you with your particular needs is obviously a different question.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB