Server's Output shows the following:
# free -h
total used free shared buffers cached
Mem: 7.7G 7.6G 123M 156K 1.8M 248M
-/+ buffers/cache: 7.3G 373M
Swap: 9G 4.9G 5.1G
I tried to turn off the swap but unable to do so!
#swapoff /dev/dm-1
swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory
Then, to resolve this problem, I did:
Step 1: I tried to create a new swap file: /home/swap of 2G Size:
# dd if=/dev/zero of=/home/swap bs=1024 count=2097152
# mkswap /home/swap
# swapon /home/swap
**Step 2:**I tried to disable main swap since I have created a new swap file: /home/swap (But again getting error)
# swapoff /dev/dm-1
swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory
When I tried to look whether new swap file created is actually using swap: It showed nothing! why??
# swapon -s
Filename Type Size Used Priority
/dev/dm-1 partition 8388604 5129864 -1
/home/swap file 2097148 0 -2
Any solution to the above problem?