Need to move my swap partition to let my root partition grow. How?

The resizing operations won't cause any issues with the filesystem, but you may need to update your /etc/fstab to point at the new partition ID.

  1. use GParted as you've described.

  2. Find the updated UUID of the swap partition from the output of:

    sudo blkid

  3. edit /etc/fstab in the guest OS to have the new UUID in the line with a 'type' of 'swap'

That should do it.


Just delete the swap partition and use a swap file. To do this type: This example is for a 1GB swap file

dd if=/dev/zero of=/swapfile bs=1024 count=1048576
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile

Be sure to tell the OS to stop using the swap partition before you delete it, like this.

swapoff /dev/nameOfCurrentSwap

And remove or comment out the line in fstab that points to it.

Then you have to enable the swap space at boot time, add this line in fstab:

/swapfile none swap sw 0 0