Increase swap memory without partitioning or after install Ubuntu/Mint/Debian


Swap memory is very important for every distro. on hibernate system save all data from ram to Swap. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. If the system happens to need more memory resources or space, inactive pages in physical memory are then moved to the swap space therefore freeing up that physical memory for other uses.

What happen if you have already installed your system without swap partition? yep you can create a swap as a file.

1. create a file for swap “sudo fallocate -l 2048m /mnt/swap_file.swap” //2048 for 2GB it based on your requirements
2. Change the permission “sudo chmod 600 /mnt/swap_file.swap
3. Format the file for swapping device “sudo mkswap /mnt/swap_file.swap
4. Add swap “sudo swapon /mnt/swap_file.swap
5. Edit fstab file “gksudo gedit /etc/fstab
6. Add this line at the end of the file “/mnt/swap_file.swap none swap sw 0 0
7. Reboot your machine “sudo reboot

Ref: Ubuntu help page
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s