+4 votes
in Operating Systems by (9.6k 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 (42.1k points)

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

+4 votes
1 answer
+4 votes
1 answer
+2 votes
1 answer
...