Linux – Changing Linux swap partition

linuxpartitioningswapUbuntuubuntu-10.04

I want to change the swap partition to another partition. Is there a gui that can make this process easier so I don't have to do things like manually editing files?

Best Answer

This is in case you don't find a GUI method, you will find the terminal method quite flexible and easy. Run the following commands:

sudo swapoff /dev/hda3
sudo mkswap /dev/hda4
sudo swapon /dev/hda4

Then update /etc/fstab. Change the line containing "/dev/hda3" to "/dev/hda4".

Here is the Ubuntu page on Swap FAQ. Also note (from that page):
With the 2.6 kernel, "a swap file is just as fast as a swap partition."
Which means that you don't need to lock down a partition for swap space; you can tune it locally in a data partition as a swap-file.