By bharatbhole
I was trying to delete the swapfile on a digital ocean virtual server using the instructions given here:
https://www.digitalocean.com/community/questions/delete-swap-file
However, when I type:
sudo rm /swapfile
I get the following error:
rm: cannot remove `swapfile': Operation not permitted
I have changed the permissions on the swap file to 777 and I believe I have root privileges. I still cannot delete it. It may be helpful to know that I created this instance of a server from an image of another server that I had configures. The swap was enabled in that original server.
How do I delete this file?
Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You maybe missing an entry in /etc/fstab and turn on the swap somewhere else. <br> <br>Therefore sudo swapoff -a -v take no effect. <br> <br>If that’s the case, check init scripts and remove the swapon script. <br> <br>The following command may helps. <br> <br>~~~~ <br>grep -r “swapon” /etc/init* <br>grep -r “swapon” /etc/rc* <br>~~~~
Thank you, Jerzy. I am almost certain that I had run swapoff /swapfile. <br>Anyhow, I did it again and this time it worked. <br> <br>Thanks again.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.