LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 06: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, 07:02 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,711
Blog Entries: 12

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

Rep: Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529
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, 12:59 PM   #4
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,570
Blog Entries: 14

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

Rep: Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505Reputation: 2505
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 01:53 PM.
 
Old 01-07-2015, 01:57 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914
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, 02:08 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,184

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

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

Rep: Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973
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, 02:47 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,183

Rep: Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403
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, 01: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, 02:15 AM   #11
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,671

Rep: Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855
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 09:05 PM
LXer: Sir Bill and Sir Tim: A Tale of Two Knights LXer Syndicated Linux News 0 07-02-2008 12:00 AM
command want list all in root / by filtering file and directory? hocheetiong Linux - Newbie 2 11-01-2007 02:16 AM
df command not list root directory wabaha Linux - Server 9 10-26-2007 06:49 AM
123 file input is not taking for i in $(cat ./123) procfs Programming 3 07-20-2006 04:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:40 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