This is the status of my system:
$ grep 'Swap' /proc/meminfo
SwapCached: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Please let me know how can I increase the swap area without re-installing.
This is the status of my system:
$ grep 'Swap' /proc/meminfo
SwapCached: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Please let me know how can I increase the swap area without re-installing.
To add 1GB of swap to your computer follow these steps:
Open a terminal,
Press Ctrl+Alt+T
And run:
To create the file myfile.swap in /mnt, to be used for swap:
sudo dd if=/dev/zero of=/mnt/myfile.swap bs=1024 count=1048576
To format the file for swap:
sudo mkswap /mnt/myfile.swap
To add the file to the system as a swap file:
sudo swapon /mnt/myfile.swap
You must edit file /etc/fstab to make the change permanent:
sudo nano /etc/fstab
Add this line to the end of file:
/mnt/myfile.swap none swap sw 0 0
Ctrl + O, save file. Ctrl + X, close nano.
Reboot your computer to ensure that the changes go into effect.
First off:
sudo apt-get install gparted && sudo gparted
Then make yourself your swap partition (using these steps), save, exit, and be relieved that you have easy access to as partition editor.
Go to the choice tab in the top right, and choose the drive you want the swap on.
If the device isn't already partitioned, go to Device -> Create Partition table -> Make FileSystem Type "EXT4" and make the memory Close to all of it (I'd say 93%.) Now save this and proceed.
Now create another partition from that, make the FileSystem type "Swap" Make it use the rest of the memory, and save. DO NOT DO THIS IF THIS IS THE BOOT DRIVE. IF THIS IS THE BOOT DRIVE, TELL ME.
If the device is already partitioned and you need to re partition it, just remove all partitions, and start from scratch. (Follow step 3)
Now do
sudo apt-get install gedit && sudo gedit /etc/fstab
You will see a line all the way at the bottom that looks like this:
/dev/sda1 /home ext4 defaults 0 0
Now make new lines copying this format for the partitions you just made. The only thing you will have to change is the FileSystem, the mount point, and the options. For example my swap line looks like this:
/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0
After that, save and exit.
The next step is crucially important to use root.
sudo -i
Now
whoami
If whoami doesn't return root you've done something wrong, and you need to do
sudo -i
Now type
mount -a
Into the terminal. THIS SHOULD NOT RETURN ANYTHING, IF IT DOES, STOP, AND LEAVE A COMMENT
If it didn't return any lines, do
reboot now
When your computer boots back on, do free -m.
You should see something like
Swap: 8043 0 8043
If you see that, you're done! If not, go back and do everything again.