Report this

What is the reason for this report?

By mistake execute the rm command in /

Posted on January 11, 2020

When I mistakenly execute the command rm in / I delete some things and now I cannot enter the console, I get an error (error file ‘/boot/grub/i386-pc/boot.mod’ not found) try to fix it with tutorials but none worked and I wanted to know if they know any way to fix it since I need to log in to take a backup of my database since I can’t access it remotely



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @zamorabryan,

It seems like you’ve deleted a really crucial part of the files. Unfortunately, the best and only way would be a backup restore. If you don’t actually have one, I’ll recommend just recreating your droplet.

I know it sounds like a drag however doing an rm on / is pretty much irreversible.

Regards, KDSys

Hey @zamorabryan

@KDSys is right in saying the RM command is a game over moment.

I would restore from your latest backup, if it exists.

If not maybe there is a slim chance you could look at the recovery console to see if any files you wanted where left. However I would not place much hope in that.

Regards Simon SnapShooter - DigitalOcean backups

It’s worth checking if you have enabled snapshots or backups for your droplet. To check this follow these steps:

  1. DigitalOcean Snapshots:
  • Log in to your DigitalOcean Control Panel.
  • Navigate to the “Droplets” section.
  • Check if there are any snapshots that were taken automatically or manually. If you find one, you can create a new droplet from the snapshot to recover your files.
  1. Backups:
  • Again, check if you might have enabled backups at any point. These are different from snapshots and might provide another route to recovery.

If snapshots and backups are not available, you can try using testdisk to recover deleted files. testdisk is a powerful data recovery tool that can work in some cloud environments. You can also check this article:

https://www.digitalocean.com/community/tutorials/how-to-install-testdisk-on-linux-and-recover-deleted-files

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.