Friday, August 23, 2013

Add Swap Partition in Ubuntu after System Installation

I always create swap partition every install new linux distro, and the size usually twice then my RAM around 2 GB to make the system work properly.

But when I was installing debian and used the same swap partition for debian, the swap partition in ubuntu is not available when I checked in system monitor so here what I do to add swap partition in ubuntu after system installation.

This way work for other distro not only in ubuntu, I also try this in arch linux.

For example my swap partition is /dev/sda2

sudo mkswap /dev/sda2
sudo swapon /dev/sda2

To enable this swap partition on boot, add an entry to /etc/fstab

sudo gedit /etc/fstab

then add this entry

/dev/sda2    none    swap   defaults     0   0

Then my swap available again.

No comments:

Post a Comment