Page 1 of 1

resized drive and now swap drive not working - help

Posted: 15. Aug 2013, 17:22
by WayneG
I used Gparted to resize a virtual drive. The swap drive is there but is not being used by ubuntu.

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 186660863 93329408 83 Linux
/dev/sda2 186660864 194117631 3728384 5 Extended
/dev/sda5 186662912 194117631 3727360 82 Linux swap / Solaris
root@ubuntu-coldfusion:~# swapon -s
Filename Type Size Used Priority
root@ubuntu-coldfusion:~#


When I pull the drive up in Gparted the Swap is OFF. I can successfully turn it On and exit Gparted... but when I boot up the machine there is no swap. Then, when I go back in to Gparted (after having booted the machine) the swap is off (again).

Thanks for any help. Wayne

Re: resized drive and now swap drive not working - help

Posted: 15. Aug 2013, 18:02
by mpack
Why ask about that here? If you used gparted then all you did was move data around on the disk, not something which VirtualBox cares about or supports.

ps. GParted resizes partitions, it is incapable of resizing drives. GParted is designed for use on physical PCs, where the notion of changing the size of the disk drive would be nonsensical. A failure to correctly distinguish between drives and partitions could be at the root of your problem.

Also, when you say "swap drive", is that what you really mean, or do you mean swap partition? If the latter then I'm interested to know why you think Ubuntu isn't using it. If the Ubuntu installer creates a swap partition then presumably it's intended to be used. If you were to shrink that swap partition then that could have unfortunate effects, especially if you did it e.g. while the VM was suspended instead of shut down.

FYI: A drive is a physical object with a fixed capacity. A virtual drive behaves as if it has a fixed capacity even when it only allocates that capacity on demand. A partitition is a software object, i.e. it forms the first level of the division of disk space into usable regions. E.g. this area for bootstrap code, this area for Ubuntu, this area to be used as a memory swap region.

Re: resized drive and now swap drive not working - help

Posted: 15. Aug 2013, 18:41
by Perryg
I would be more interested in seeing the results of the following from the guests terminal

Code: Select all

free -m
Also if you deleted the swap partition to be able to extend the primary partition & created it again then the swap UUID will be different and you would need to see if
blkid = the same UUID in the /etc/fstab and if they differ you would need to edit accordingly.

Still as Dan says this is not a VirtualBox issue but an issue with the guest OS.

Re: resized drive and now swap drive not working - help

Posted: 15. Aug 2013, 18:46
by WayneG
Hi Perryg,

Thanks for the reply... I'll check the UUid in the fstab but I did not delete the swap partition.

root@ubuntu-coldfusion:~# free -m
total used free shared buffers cached
Mem: 2449 824 1625 0 296 154
-/+ buffers/cache: 373 2076
Swap: 0 0 0

Re: resized drive and now swap drive not working - help

Posted: 15. Aug 2013, 19:29
by WayneG
Hi Perryg,

you were correct regarding the UUID not matching the fstab file... I changed it and it works fine

Thanks again for pointing me in the right direction.