Upgrading to Fedora 33: Removing Your Old Swap File on EFI Machine

Fedora 33 adds a compressed-memory-based swap device using zram. Cool! Now you can remove your old swap device, if you were a curmudgeon like me and even had one in the first place.

If you are NOT on an EFI system or not using LVM, be aware of this and make changes to these steps as needed. (Specifically, the path given in step 6 will be different.)

  1. After upgrading to Fedora 33, run free. Notice that swap size is the sum of the 4G zram device plus your previous disk-based swap device. Try zramctl and lsblk commands for more info.
  2. Stop swapping to the swap device we’re about to remove. If using LVM, expect the VG and LV names to be different.
    swapoff /dev/vg0/swap
  3. If LVM, remove the no-longer-needed logical volume.
    lvremove /dev/vg0/swap
  4. Edit /etc/fstab and remove (or comment out) the line for your swap device.
  5. Edit /etc/default/grub.
    In the GRUB_CMDLINE_LINUX line, remove the “resume=” part referring to the now-gone swap partition, and the "rd.lvm.lv=” part that also refers to it.
  6. Apply above changes to actual GRUB configuration:
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Reboot and your system should come back up. Enjoy using that reclaimed disk space for more useful things — it’s now unused space in the LVM volume group. If you want to actually use it, look into lvextend, and also resize2fs or xfs_growfs.

4 thoughts on “Upgrading to Fedora 33: Removing Your Old Swap File on EFI Machine

  1. Stefano Costa

    Thank you! This post is exactly what I was looking for and I’m already enjoying those 8 GB. It may be useful to point less experienced readers to instructions about LV resizing, especially the need to use resize2fs after lvextend.

  2. Ricardo

    Well, I don’t know if I’m a curmudgeon, but I do have a notebook that I hibernate from time to time.

    In that case, you should *not* follow these instructions or you’ll lose that capability 🙂

    Also, to find out the name of your physical swap device you can use ‘swapon -s’.


Leave a Reply

Your email address will not be published. Required fields are marked *