Filtri Menu 0 0.00

Extend swap file on Ubuntu

Extend swap file on Ubuntu

Sometimes happen that you need to extend the swap space on your system, so it happens to me when i tried to install Oracle10ex on my ubuntu system.
So i found the solution on this ubuntu forum : http://ubuntuforums.org/showthread.php?t=89782

To extend the swap file to 1gb :

First, create a large empty file:

Code:
sudo dd if=/dev/zero of=/swap_file bs=1M count=1000

Replace 1000 with the size of the swap file desired, in MB. You can also put the swap_file in a different location if desired.

Next, we’ll secure the swapspace, so ordinary users cannot read the contents (potential security breach):

Code:
sudo chown root:root /swap_file
sudo chmod 600 /swap_file

Then, turn it into swap space:

Code:
sudo mkswap /swap_file

Next, turn it on:

Code:
sudo swapon /swap_file

To make it turn on at every bootup, open up /etc/fstab:

Code:
sudo gedit /etc/fstab

Add this line to the end of the file:

Code:
/swap_file       none            swap    sw              0       0

I know that this article is only a copy of a forum but only for more simple search and report.

bye

ivan

Condividi:

Iscriviti alla newsletter

Iscriviti alla nostra newsletter per ricevere offerte di sconto anticipate, aggiornamenti e informazioni sui nuovi prodotti.
Top