I just can’t understand why can’t I remove the swap partition after upgrading to Fedora 33. I have got ext4 filesystem in all partitions. I do the following steps:
Boot up with a USB pen drive.
Remove LVM swap partition.
Extend LVM home partition.
chroot to comment swap line in /etc/fstab so as not to mount it during boot up.
Everything is OK up to this point but Fedora freezes and doesn’t boot up. I have to roollback all changes in order to get Fedora working again. The funniest is that I didn’t uncomment swap line in /etc/fstab, however, it worked! Moreover, it is not used by Fedora any longer, since monitor app reports 5 GB of zram memory while I only have 1 GB of swap memory. I mean, swap partition must exists despite being useless!
The problem was the order which I was doing things in. It was much simpler than everything I posted before. I summarize it all for everybody wanting to remove swap partition after upgrading to Fedora 33.
Boot up your computer normally.
Disable swap partition: # swapoff -va
Rebuild grub2 configuration. Since /etc/default/grub still mentions swap partition, I decided to do something risky, but fortunately I hadn’t got any issue: # rm -rf /etc/grub2* # rm /etc/default/grub # dnf remove *grub2* # dnf install grub2-pc grub2-tools # grub2-mkconfig -o /boot/grub2/grub.cfg # grub2-install /dev/sdc ==> Your device here. Warning! Your device, not the partition as vgaetera said before.
Perhaps it might be enough to make only a grub2-mkconfig instead of a full reinstallation of grub2 but, as I explained before, I didn’t trust because /etc/default/grub made references to swap partition. Anyway, I repeat that I hadn’t got any issue. Another thing to take into account is that I have got BIOS. You might need install grub2-efi instead, if your computer is more modern than mine.
Remove swap partition. # lvremove /dev/mapper/vg_hogar_ssd-swap ==> your LMV here
Delete swap line in /etc/fstab.
You can now resize home partition by using a USB pen drive. My home partition is /dev/mapper/vg_hogar_ssd-home, so in my case I made: # lvextend --extents +100%FREE --resizefs /dev/mapper/vg_hogar_ssd-home
You might need reinstall NVIDIA/AMD proprietary driver owing to step 3.
Bye, bye, swap!
I hope this help others remove swap partition if they don’t need btrfs filesystem or don’t want to make a fresh install of Fedora 33.