The Problem:
When trying to increase the size of my swap partition in my Linux server I got the following:
root@server:~# sudo fallocate -l 1G /swapfile
fallocate: fallocate failed: Text file busy
Trying to turn off the swap partition returns:
root@pilot888:~# sudo swapoff -a
swapoff: /swapfile: swapoff failed: Cannot allocate memory
The Solution:
Leave that swap partition alone and create multiple partitions instead:
root@server:~# sudo fallocate -l 1G /swapfile2root@server:~# ls -lh /swapfile2-rw-r--r-- 1 root root 1.0G Jul 12 09:55 /swapfile2root@server:~# sudo mkswap /swapfile2Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)no label, UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxroot@server:~# sudo swapon /swapfile2root@server:~# sudo swapon --showNAME TYPE SIZE USED PRIO/swapfile file 512M 512M -1/swapfile2 file 1024M 193.6M -2root@server:~# free -htotal used free shared buff/cache availableMem: 992M 784M 69M 60M 138M 25MSwap: 1.5G 1.4G 124M
No comments:
Post a Comment