from my linux machine swap is - 0 why , and how to increase the swap?
[root@my_small_linux free total used free shared buffers cached Mem: 8172212 2087904 6084308 0 270020 1376776 -/+ buffers/cache: 441108 7731104 Swap: 0 0 0
from my linux machine swap is - 0 why , and how to increase the swap?
[root@my_small_linux free total used free shared buffers cached Mem: 8172212 2087904 6084308 0 270020 1376776 -/+ buffers/cache: 441108 7731104 Swap: 0 0 0
That means, that no swap partition is available. If you have some unused space on hard drive, you can make it a swap partition (via fdisk). Or you can make swap on file. This creates 2GB swap:
dd if=/dev/zero of=/swap bs=1048576 count=2048 mkswap /swap swapon /swap
And add it to /etc/fstab to be mounted at boot.
swapon -s
says nothing? Please send result of ls -lh /swap
. That will show how the swap file is created. By the way, you have to do this under root or via sudo
. Could also be that in your /etc/fstab
the swap partition is listed by uuid
instead of /dev/sd*
. If for some reason the uuid changed, it cannot be automatically mounted.
Check with fdisk -l
as root/with sudo if it lists some swap partions. My output is:
[snip] Device Boot Start End Blocks Id System /dev/sdb1 * 1 34 273073+ 83 Linux /dev/sdb2 35 1340 10490445 83 Linux /dev/sdb3 1341 1449 875542+ 82 Linux swap / Solaris <<--- here it is! /dev/sdb4 1450 9729 66509100 83 Linux
and then check the symbolik link to UUID with: ls -l /dev/disk/by-uuid/
. Im my case:
0 lrwxrwxrwx 1 root root 10 2011-03-08 08:39 3565be89-f1fe-478c-9653-a1dbeb9406a9 -> ../../sdb3
So in /etc/fstab
I have:
UUID=3565be89-f1fe-478c-9653-a1dbeb9406a9 none swap sw 0 0
Disclaimer: i'm under Ubuntu now, so actual paths might be different under other distros.