-1

I made huge mistake today. Actually i have to delete a specific directory files but by mistakenly i have executed the below command,

rm -rf /*

I think, It started to delete all file from the root (Suddenly stopped the command after a priod of time).

Now even, i am not able to login in my terminal and mysql database and everything. But I still able to access my websites.

Can anyone suggest how to get back the server to its original condition?

7
  • You should look up on Google Linux data recovery tools. Oct 5, 2015 at 14:07
  • Definitely start by backing up whatever you can.
    – choroba
    Oct 5, 2015 at 14:09
  • Yep HUGE. :( In this moment the data on that computer is erased: it means that its index is erased. The real data is still there and you can try to rescue if not overwritten in the meanwhile. Search for a Linux data recovery tools, make a bootable system and see which is the situation. Remember that it can be in part corrupted, so probably you will opt for a full new install of the system trying to save the /home/* and some settings. Good luck.
    – Hastur
    Oct 5, 2015 at 14:27
  • Did you run it as root? If not, you shouldn't have seen any files get deleted if you stopped it in a reasonable period. If you were running as root, you shouldn't do that on a server (IMO: ever) and should start disabling ssh for the root user.
    – nerdwaller
    Oct 5, 2015 at 15:07
  • Disabling SSH wouldn't make any difference for the numerous occasions someone might need to run someone under sudo or su
    – qasdfdsaq
    Oct 5, 2015 at 15:38

1 Answer 1

3

Restore from backup... You had a backup, right?

Barring that, if the files you care about are all on non-systems mountpoints (such as /home), then you should be able to reinstall your Linux distro without disturbing them. You will probably need to reinstall/reconfigure system services such as Apache and MySQL.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .