Ubuntu – Need to move the swap partition to let the root partition grow. How


I have a Virtual Box Ubuntu guest and i need to have more space on my disk (actually it's 8 gb). I have already increased the space allocated for the VDI to 16 gb.

Now with GParted Live i'm trying to expand my partition, but the swap blocks the expansion, as is in this image

the situation now

I'm going to do some move/resize to get the unallocated space near the /dev/sda1.

The operations are these:


Now, if i do this, surely i will have problems with the next boot. What i have to do to fix that?

Best Answer

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.