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?
linux – How to Reduce Swap Partition
linuxpartitionswap
linuxpartitionswap
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?
Best Answer
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.