Steps to increase the swap space on Linux.
Introduction:
Swap in the addition space allocate on the hard disk of the system which will acts as extension to the RAM on the system. Hence Swap space plays an important role in performance of the system.
This post describes steps to increase the swap space on Linux . Hence using this information you can able to increase the swap space on Linux which will boost the performance.
1. Create file using dd commands as below: (Note here we are adding 10MB swap to system.)
[root@kalwa1 tmp]# dd if=/dev/zero of=testswap bs=10M count=1 1+0 records in 1+0 records out 10485760 bytes (10 MB) copied, 0.0115516 s, 908 MB/s
2. Now change the permission so that nobody can delete it.
[root@kalwa1 tmp]# chmod 0 testswap
3. Now setup the swap area on the newly created file using mkswap command.
[root@kalwa1 tmp]# mkswap testswap mkswap: testswap: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 10236 KiB no label, UUID=703cadb4-5d2f-44e8-8ed7-eb76f71998cb
Rajesh says
swapon /tmp/testswap is missing