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 06-28-2011, 11:51 PM   #1
diteshshetty
LQ Newbie
 
Registered: Jun 2011
Location: mumbai
Posts: 5

Rep: Reputation: Disabled
Help: I accidentally deleted /usr directory


Hi everyone,
I accidentally deleted /usr directory and now i am not able to get that file and i don't have any backup of that directory, is it possible to recover or restore all my deleted files if not please give me the suggestion so that it never happens again.

It was not showing the partition in which it was stored.

Please help me!

Thank you
 
Old 06-28-2011, 11:57 PM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
What OS are you running?
Were you running as root, because you can only delete directory if you have permission.
Another thing you can try if you only deleted the usr directory from only that user account log in through cli or recovery and create new user.
Then you can as root copy all of your documents to the new user account.
I hope that helps.
 
1 members found this post helpful.
Old 06-29-2011, 02:28 AM   #3
diteshshetty
LQ Newbie
 
Registered: Jun 2011
Location: mumbai
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you EDDY1 for reply : Redhat Linux enterprise edition 4

RedHat linux version 4, yes i was accessing through root user and
i am not able to access terminal window and also there is no desktop icon everything from the desktop is removed nothing i can access ,
only through putty from remote machine i can access the linux.
Sorry but I have no idea about the machine it is at remote location on which i was working.
It is very long story how i messed up, I am a java developer and wrote a code to create directory to store files and to delete the directory if it is no longer in use but i messed up big time while testing i accidentally deleted the /usr directory.
Jun 28 is worst day of my life and i m trying to recover from havoc.
 
Old 06-29-2011, 02:42 AM   #4
zer0signal
Member
 
Registered: Oct 2010
Location: Cleveland
Distribution: Slackware, Fedora, RHEL (4,5), LFS 6.7, CentOS
Posts: 258

Rep: Reputation: 29
nevermind saw you did not have a backup... nothing on tape?

Last edited by zer0signal; 06-29-2011 at 02:43 AM.
 
1 members found this post helpful.
Old 06-29-2011, 04:27 AM   #5
diteshshetty
LQ Newbie
 
Registered: Jun 2011
Location: mumbai
Posts: 5

Original Poster
Rep: Reputation: Disabled
thank u but hey all my other partitions are intact how can i take backup of other partition data the only partition which were affected was where /usr directory was stored!
Now anybody can help me!
 
Old 06-29-2011, 05:05 AM   #6
Bjerrk
Member
 
Registered: Aug 2005
Location: Denmark
Distribution: Debian, Slackware
Posts: 70

Rep: Reputation: 19
diteshshetty: If you've deleted the /usr directory and it's subdirectories, and you don't have a backup, there isn't much you can do save reinstalling. The /usr directory holds most of the executables, libraries and application data.
That doesn't mean that you have to start from scratch, however. You could backup the /etc directory (which holds system configuration files) and other important data (/home and so on), reinstall your operating system and put the old /etc directory back in.
 
2 members found this post helpful.
Old 06-29-2011, 06:10 AM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
For backup non-working system you must run your PC for example from any LiveCD. From there you can mount old partitions and make copy on DVD or other hard disk. There is also undelete for ext2 filesystems and "testdisk" application also can do it, you can try it after backuping old data if your /usr had important data.
 
1 members found this post helpful.
Old 06-29-2011, 06:43 AM   #8
diteshshetty
LQ Newbie
 
Registered: Jun 2011
Location: mumbai
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs up Thank u

Thank u to all.
I will try possible steps to take backup of my other partitions.
Thank u once again to one n all.
 
Old 06-29-2011, 07:51 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
You may be able to get away with doing an (forced) 'Upgrade' version of install; this should restore your /usr dir. OTOH, this may wipe out your data. Definitely do a backup first.
 
Old 06-29-2011, 09:55 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
If you have a spare hdd clone it,not image that way whatever you do, even a fresh install you can go back and retrieve any data or documentation that is left.
 
  


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
/usr/lib/pkgconfig content accidentally deleted pataprout Gentoo 3 11-07-2010 03:52 PM
[SOLVED] I accidentally deleted /usr/lib64/mozilla/plugins/libnpjp2.so, please help tjwoosta Slackware 3 05-04-2010 06:28 PM
I just accidentally deleted my /tmp directory Daedra Slackware 3 05-30-2009 09:19 PM
Accidentally deleted /usr/bin/net larley Linux - General 2 07-26-2004 10:22 PM
help, accidentally deleted /root directory ahimsel08 Linux - Software 6 07-01-2004 02:02 AM

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

All times are GMT -5. The time now is 07:28 AM.

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