Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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!
Location: Some institute of physics, somewhere ...
Distribution: Debian, Slackware
Posts: 76
Rep:
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.