Portal Home > Knowledgebase > Articles Database > Deleted all files from server by mistake


Deleted all files from server by mistake




Posted by mysborg, 12-11-2011, 01:32 PM
Hello guys, Topic says half and the half story is my whm was always showing 95% disk space full warning, when I checked the clients accounts no account was above the quota limit, then when I googles I found this thread --> webhostingtalk.com/showthread.php?t=947629 As User "rghf" told to run 'du -sh /*' , I did and found '/files' folder was filled with 281G files in it, then I did this # cd /files in files: rm -rf / then Enter, then it started showing some errors and everything was getting deleted in background, soon I closed the putty and checked my sites and it shows 'Internal Server Error' and I can't even access to WHM or server thru putty, Please somebody help me recover everything I messed up *SAD*

Posted by lastminutehosting, 12-11-2011, 01:36 PM
do you have backups?

Posted by mysborg, 12-11-2011, 02:07 PM
not maybe, my host said they won't backup dedi servers and I didn't knew how to back, I was lazy as I never expected this situation T_T

Posted by lastminutehosting, 12-11-2011, 02:18 PM
it does happen and honestly it is your job to do backups. if you have none basically need to rebuild your server from scratch rm -rf removes everything so do not use it unless you know what you are doing.

Posted by frozen74, 12-11-2011, 02:19 PM
ıf you do not have backup try to get your pages from gogle cache ıf you do not have 1000 of pages

Posted by bear, 12-11-2011, 03:39 PM
You weren't deleting the files in that folder, you were deleting from root. You'd likely need to reinstall the server OS, Cpanel and all from this point, then restore accounts from the backups you hopefully have. You might ask the NOC guys to install a new main HDD for the OS and all, and add this one on as a secondary. Maybe you can access that way to locate files, but it's a long shot, basically.

Posted by hoststopuk, 12-11-2011, 03:45 PM
You have not deleted all the date, rm works alphabetically. rm binary is at /bin/rm. So, it won't delete anything directories after b as it has already deleted itself. Attach a new drive to the server, install OS on new drive. Attach original drive as secondary and restore all the data. <> Last edited by Mike V; 12-11-2011 at 03:57 PM.

Posted by lynxus, 12-11-2011, 03:47 PM
Actually, It normally loads into memory so it can and will delete itself. -r = recursive -f = force In most cases, You will be shafted after doing what you have done. Sorry Normally you will need to use a backup. As hotstop said, You never know. It MAY* of not got too far into the delete, But i think it will of. Last edited by Mike V; 12-11-2011 at 03:57 PM.

Posted by hoststopuk, 12-11-2011, 04:00 PM
I have gone through such a situation. One of the junior member fired rm -fr /*. But, performing the steps I mentioned, we were able to recover all the data from the original HDD. Did not even had to touch the backup server. Last edited by hoststopuk; 12-11-2011 at 04:05 PM.

Posted by Server Management, 12-11-2011, 04:12 PM
Another one who doesnt know what their doing in SSH...

Posted by bear, 12-11-2011, 04:23 PM
We all learned at some point. Odds are good this was a lesson not soon forgotten.

Posted by Michaelz, 12-11-2011, 04:45 PM
Too true. Wonder who could be the first to throw a stone here with some justification.

Posted by fshagan, 12-11-2011, 11:56 PM
I sometimes warn about the 8 keystrokes that can erase all your data ... The concern I have is the OP mentions 'clients' on this server, and his negligence opens him up to liability if any of his clients see this. Hopefully, his clients have non-critical sites where there's no financial harm done to the customer.

Posted by mysborg, 12-12-2011, 01:44 AM
Don't make fun of somebody else problem mate. you're not a god or you didn't know everything since you're born, you have learnt at somepoint. true mate, thanks. Good thing this server is not the shared mate, so loss cause to any client. They just use this server to download files from somewhere and upload it somewhere and delete as the process complete. So no financial harm caused, only some break till I bring back the site up.

Posted by ssfred, 12-12-2011, 02:37 AM
If you don't have a backup, the chances of recovering is quite slim. Better reinstall the OS, as the command could have affected other binaries and libraries which can turn the server to an unstable one if used as it is.

Posted by mysborg, 12-12-2011, 02:43 AM
Not all files gone and I can still accesses to some pages(I'm not allowed to post links ) I'm waiting for my host to reinstall the OS, I could do myself but I can't access to the server thru WHM or ssh

Posted by iLoveHosting-UK, 12-12-2011, 05:58 AM
Everyone makes mistakes. I hope you have learnt your lesson. Maybe it is time to hire a server manager. - Ashton

Posted by mysborg, 12-12-2011, 06:04 AM
yeah! I learnt the lesson already. Hiring a tech from my host.

Posted by iLoveHosting-UK, 12-12-2011, 06:19 AM
Wise decision - Ashton

Posted by fshagan, 12-12-2011, 11:21 AM
That's very good news. I was afraid your problems extended to more than just lost data!

Posted by ssfred, 12-13-2011, 02:29 AM
Best wishes for a speedy recovery

Posted by mysborg, 12-13-2011, 02:40 AM
Still waiting for my provider to reinstall it for me I would do it myself but I can't access to server thru whm or putty It's 2+ days already and I'm still waiting

Posted by 2vibrant, 12-13-2011, 03:50 AM
2 days of waiting for an OS reinstall? I would be cancelling the server and taking your business elsewhere. Gonna have to start from scratch anyway...



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
AllAboutHosting (Views: 642)
Exploit Scanner s (Views: 609)