How to reclaim the space which i used to increse the swap space on Xen,

Hi,
i have done a blunder here, i increased the swap space on Xen5.6 server machine using below steps :-

1056  dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
 1057  ls -l /root/myswapfile
 1058  chmod 600 /root/myswapfile
 1059  mkswap /root/myswapfile
 1060  swapon /root/myswapfile
 

but it has used all the space on /root and hence to recover the space on /root i removed /root/myswapfile using rm -rf. But still i see the space is full and swapon give below output:-

Filename Type Size Used Priority
/root/myswapfile\040(deleted) file 968764 0 -1

Can any help me here please, how to resolve this and get my system to previous state?

Thanks in advance....

It shouldn't have allowed you to delete a swapfile that's in use! Mine certainly doesn't, not even as root.

Try swapoff /root/myswapfile If that doesn't fix it, swapoff -a. If that doesn't do it, a reboot may be required.

1 Like