+4 votes
in Operating Systems by (39.4k points)

I am trying to allocate swap space using the following command, but the command throws an error: fallocate: fallocate failed: Text file busy.

sudo fallocate -l 16G /swapfile

How to fix this error? 

1 Answer

+1 vote
by (281k points)
selected by
 
Best answer

It looks like you already have swap space on your machine, and the swapfile is currently in use. You can turn off the swap by running the following command, and then you can run fallocate to allocate more swap space.

sudo swapoff -a

Related questions

+3 votes
1 answer
+4 votes
1 answer
+4 votes
1 answer
+1 vote
1 answer

...