I would like to increase swap space on my existing Ubuntu machine. At present it is merely 10 % of RAM available.
I would like to make it as 50 % more than RAM.
How can I do it on a machine which is already configured ?
Use the gparted
Live cd (or any other live cd with gparted
) and carve out the extra space and resize the swap
partition to whatever size you want.
Make an empty file of the desired size,
dd if=/dev/zero of=swapfile count=1M bs=1k # 1GB
(make sure this is owned by root
and has permissions 0600
), then
mkswap swapfile
swapon swapfile
You need superuser rights for swapon
. To make the swapfile persist across reboots, put it in /etc/fstab
.