Pages

Thursday, June 5, 2014

Adding SWAP space

First method : on hard disk

create a new filesystem

# mkswap /dev/sdc1
swapon /dev/sdc1
# vim /etc/fstab
/dev/sdc1               swap                    swap    defaults        0 0
# swapon -s
Filename                        Type            Size    Used    Priority
/dev/sda2                       partition       4192956 0       -1
/dev/sdc1                       partition       1048568 0       -2

# free -k
             total       used       free     shared    buffers     cached
Mem:       3082356    3022364      59992          0      52056    2646472
-/+ buffers/cache:     323836    2758520
Swap:      5241524          0    5241524
The SWAP sizer formula : if RAM is < 8 GB , SWAP should be equal to 8GB
If RAM is > 8 GB, the SWAP is half of the RAM size

No comments: