How do I reduce the size of swap after accidentally enlarging it by 100GB? I imagine it would be via fdisk somehow. Do I need to delete the partition and remake it?
Use gparted, it's easy to use! You just need to find your swap partition (
/dev/sda4 on my system as you can see in the screenshot below) and then resize it.
However, unless your swap artition is the last partition on the disk, this will leave unallocated space in the middle. Depending on how your partitions are set up, you may or may not be ab;e to add that to one of the other partitions. For more details, please edit your question and show us the output of
sudo parted -l or a screenshot like the one above.
You can find a step by step howto on using gparted to reassign and move unallocated space here.
As you use LVM, the easiest (and safest) way is to simply
lvcreate new swap partition with size you want,
swapon it, and then 'lvremove' old oversized partition. That sequence insures you won't run out of virtual memory in the middle of process, and leaves you just with partition of wanted size. Do not forget to update
If you're flat out of disk space though, you will need to swapoff and lvremove first (or use temporary swap file if you do not have enough physical memory)