Rescue kernel removal

Hi, I am running a Windows/F40 dual boot machine on some older hardware (i7 7th gen, 32GB RAM, RX580).
Unfortunately, the partition mounted at /boot is only 474M in size and I had to decrease the number of kernels retained in order to install a kernel update. The machine has a number of SSDs and HDDs but I am not ready to re-arrange and make more space for /boot. (I am also afraid of resizing file systems :wink: .
My short-term goal is to remove the rescue-kernel and dont have automatically reinstall. I use Linux since quite some time and never needed the rescue kernel, so it can go (as it also consumes a lot of space).

I did a sudo rm -f /boot/*-rescue-*, but is there anything else I have to configure so the rescue kernel doesn’t get installed anymore?

edit1: I have a package dracut-config-rescue-102-2.fc40.x86_64[1] installed. Should I remove that one? Can I, or does that have other negative consequences?

edit2: I also found:

sudo cat /usr/lib/dracut/dracut.conf.d/02-rescue.conf 
dracut_rescue_image="yes"

Should I simply set this to ‘no’ instead of removing the package mentioned above?

Thank you for your help.


  1. “This package provides the configuration to turn on the rescue initramfs generation with dracut.”
    ↩︎

The rescue kernel should be automatically recreated the next time there is a kernel update.

Resizing partitions is relatively simple if you install and use gparted.
My system uses approximately 470M in /boot and an additional 20M in /boot/efi with the default 3 kernels plus rescue kernel.

Don’t be afraid to expand /boot since the default size of /boot on a new install is near 1G. Below is the arrangement on my primary SSD.
The size of /boot was created by default when I did a clean install for f39 with Workstation.

$ sudo fdisk -l /dev/nvme0n1


Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: CT2000P5PSSD8                           
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2072D08C-637C-4B03-A3D9-121E741E5EDC

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048     688127     686080  335M EFI System
/dev/nvme0n1p2  688128    2441215    1753088  856M Linux extended boot
/dev/nvme0n1p3 2441216 3907028991 3904587776  1.8T Linux LVM

$ lsblk /dev/nvme0n1
NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
nvme0n1              259:0    0  1.8T  0 disk 
├─nvme0n1p1          259:1    0  335M  0 part /boot/efi
├─nvme0n1p2          259:2    0  856M  0 part /boot
└─nvme0n1p3          259:3    0  1.8T  0 part 
  ├─fedora_root-root 253:0    0  400G  0 lvm  /
  └─fedora_root-swap 253:1    0  256G  0 lvm  

I wouldn’t know how to shift paritions here…

Disk /dev/sda: 238,47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG SSD SM84
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    616447    614400   300M Windows recovery environment
/dev/sda2     616448    821247    204800   100M EFI System
/dev/sda3     821248   1083391    262144   128M Microsoft reserved
/dev/sda4    1083392 138535919 137452528  65,5G Microsoft basic data
/dev/sda5  138536960 139669503   1132544   553M Windows recovery environment
/dev/sda6  139671552 140695551   1024000   500M Linux filesystem
/dev/sda7  140695552 500117503 359421952 171,4G Linux filesystem


The install is from Dec 4 2016 anaconda-ks.cfg, so it its quite old but has been stable on dist-upgrades…year after year.

The 2 partitions, sda6 & sda7, appear to be the ones of interest.
You could boot to a live environment from USB and resize those 2 partitions with gparted.

Doing so would involve first resizing /dev/sda7 and shrink the size leaving approx 500M at the beginning (between sda6 & sda7). Once that is done then expand sda6 to use the now free space. Treat this as 2 completely separate steps with resizing sda7 first.

Gparted should take care of relocating the data and resizing the partitions without significant risk, though as always suitable backup is recommended.

Since Dec 2016 implies that the first fedora version installed may have been fedora 25? Congratulations on the stable upgrade process over the past 8 years.

Fedora has improved dramatically so it is time to accept the status and make slight configuration changes to allow continued progress.

1 Like

this package contains dracut config, which generates the rescue kernel after a kernel install. if you uninstall it and manually remove the existing rescue kernel, you won’t have a rescue kernel generated after the next kernel update. i removed it and didn’t see any negative effects.

1 Like

You could simply set that to ‘no’ and avoid any package changes, (though upgrades to dracut may restore it)

I would personally choose to enlarge the /boot partition instead of removing the rescue kernel.