LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2015, 07:32 AM   #1
srrmohan
LQ Newbie
 
Registered: Jan 2015
Posts: 1

Rep: Reputation: Disabled
Smile Sir my subordinate used rm -rf command in root directory by name direcectory as 123.


Sir my sub-ordinate used rm -rf command in /root derectory duly deleting 123 directory which is in /root which has 5years periodicals data lost. Duly undelete command unable to rectify because gcc was not installed in that client. Tell me the correct way to recover
-SRR MOHAN
 
Old 01-07-2015, 08:02 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Try PhotoRec. I've used it to recover files which were deleted using an rm -rf command.
 
Old 01-07-2015, 08:27 AM   #3
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Sir, my usual response to a first time poster is to say "Welcome to LQ!', but here I am constrained by my troll detection meter being hard on the peg in the red zone.
Your post says nothing about the file system in use.
There is no undelete command in Linux.

Recovery procedures should include:
1. Firing the incompetent who allowed a subordinate access to such a powerful command.
2. Firing the incompetent who allowed 5 years of data to be lost without a backup strategy.
3. Firing the incompetent who needs to ask a question like this on this forum.

If this is serious, first isolate and image the disk. You may be able to recover using a tool like extundelete or similiar. http://extundelete.sourceforge.net/
 
4 members found this post helpful.
Old 01-07-2015, 01:59 PM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Ouch. So you've had a backup plan for 5 years you say?
 
Old 01-07-2015, 02:49 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
NEXT time
DO NOT GIVE THAT PERSON THE ROOT PASSWORD!!!!!!!!!!
if that person STILL has a job
and if YOU STILL have you for allowing someone to do that


reinstall and learn a valuable lesson

also NEXT TIME
do not use the root $HOME folder to store files
"/root" is not a good place to STORE things

Last edited by John VV; 01-07-2015 at 02:53 PM.
 
Old 01-07-2015, 02:57 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,001

Rep: Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520
Quote:
Originally Posted by allend View Post
Recovery procedures should include:
1. Firing the incompetent who allowed a subordinate access to such a powerful command.
2. Firing the incompetent who allowed 5 years of data to be lost without a backup strategy.
3. Firing the incompetent who needs to ask a question like this on this forum.
4. Firing the incompetent who stored that much important data in /root and nowhere else.
 
Old 01-07-2015, 03:08 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
ok i think the OP is getting the point

WE ALL have done things like this in the past ......
 
Old 01-07-2015, 03:16 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Yeah, yeah. OP, go add your experience to the following thread I'm an idiot moments.

Like others have said, do not store stuff in the /root tree. Be more cautious about backing up critical data, and how you disseminate control/access to the system.

You're not much of a mentor if you've let a subordinate cause this much mayhem.

In the meantime, try Photorec, as it really does work.
 
Old 01-07-2015, 03:47 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by srrmohan View Post
Sir my sub-ordinate used rm -rf command in /root derectory duly deleting 123 directory which is in /root which has 5years periodicals data lost. Duly undelete command unable to rectify because gcc was not installed in that client. Tell me the correct way to recover
Others have covered the big points here, so there's no need to rehash them. That said, you really do need to read the "Question Guidelines" link in my posting signature.

You say you 'duly' ran the undelete command...which wont' do anything, especially since Linux doesn't HAVE an 'undelete' command. You don't tell us what version/distro of Linux you're using, what the message(s) were that you got when you tried this (only something vague about gcc), or what (if anything) your backup strategy consisted of.

If you are an administrator, and you have been:
  • Letting users log in as root (or have root privileges)
  • Going for YEARS without a backup
  • Keeping files in the /root directory
...you really need to perform some basic job training. I'm sorry if it sounds harsh, but there are MANY good reasons why you don't do these things. The best way to recover what you lost (that is, five-years worth of periodicals), is this:
YOU and your subordinate get the hard copies of the five years of periodicals, and start typing them back in.
It will be a hard job, and take many, MANY hours. It will also be a lesson you and your subordinate never, EVER forget. You MAY be able to dodge a bullet by using photorec, but at this point, I'd say your chances are slim. Take your medicine, no matter how bitter it is, and learn from it. And the next time, this won't happen to start with, and if it DOES, you'll be totally prepared.
 
Old 01-08-2015, 02:05 AM   #10
Andy_Crowd
Member
 
Registered: Jan 2014
Posts: 62

Rep: Reputation: Disabled
Smile

By myself I am using /root only for back up of system settings when I testing or removing some of system files folders. User backups I use to make in the /opt folder, usually user settings for people to whom I install Linux too in case if they will play with installed programs or will remove files, they will be able to run a script that will restore them, e.g. by writing restore in the command line or in run window.

It takes a lot of time to restore deleted file so I recommend to make an compressed image of the whole disk or partition where files were deleted from that you will be able to mount. Then mount it and run photorec.
 
Old 01-08-2015, 03:15 AM   #11
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
it was already mentioned: noone can be admin without executing rm -rf / at least once in his/her life....
The solution should be to restore files from backup - that is a serious issue if there was no backup (but actually it was mentioned too: important data always saved, if your files were not saved they were not important at all).
There is a tool named testdisk, you can try to use that to recover lost files, but first you need to lock that drive or make a full image (using dd) of it, otherwise you will lost even the possibility to find anything on that drive).
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect a m.domain.com/abc to a ip address 123.123.123.123/abc? elok Linux - Server 5 05-27-2010 10:05 PM
LXer: Sir Bill and Sir Tim: A Tale of Two Knights LXer Syndicated Linux News 0 07-02-2008 01:00 AM
command want list all in root / by filtering file and directory? hocheetiong Linux - Newbie 2 11-01-2007 03:16 AM
df command not list root directory wabaha Linux - Server 9 10-26-2007 07:49 AM
123 file input is not taking for i in $(cat ./123) procfs Programming 3 07-20-2006 05:10 AM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration