You are not logged in.

#1 2010-06-09 19:19:31

Bob Day
Member
Registered: 2005-11-26
Posts: 43

accidently did: # rm -r /usr ... how to recover?

I accidently deleted my /usr directory...how to recover from that?

luckely I noticed my mistake quite fast and was able to abort the operation...so most of the data is probably still available

Last edited by Bob Day (2010-06-09 19:28:39)

Offline

#2 2010-06-09 19:27:16

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: accidently did: # rm -r /usr ... how to recover?

Ouch!

If you have home on a separate partition reinstall would be far the fastest and definetely the cleanest way. Just remember not to format /home.

Another possibility would be to boot with a live cd backup /home and any dot files of importance from /etc then reinstall.

Offline

#3 2010-06-09 19:43:36

Bob Day
Member
Registered: 2005-11-26
Posts: 43

Re: accidently did: # rm -r /usr ... how to recover?

I think I only lost the content in /usr/man
Could someone compare his /usr with mine?

[ronald@thinkpad /usr]$ ls -l /usr/
total 260
drwxr-xr-x   3 root root  69632 Jun  8 23:11 bin
drwxr-xr-x 313 root root  32768 Jun  8 23:11 include
drwxr-xr-x 145 root root 126976 Jun  9 20:07 lib
drwxr-xr-x  10 root root   4096 Mar  1 01:05 local
drwxr-xr-x   3 root root   4096 Feb 27 04:11 man
drwxr-xr-x   3 root root  12288 Jun  3 21:39 sbin
drwxr-xr-x 196 root root   4096 Jun  8 23:11 share
drwxr-xr-x   3 root root   4096 Apr 19 00:07 src
[ronald@thinkpad /usr]$ ls -l /usr/man
total 4
drwxr-xr-x 2 root root 4096 Feb 27 04:11 man1

Offline

#4 2010-06-09 19:46:08

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: accidently did: # rm -r /usr ... how to recover?

Try pacman  -Qk

-k --check
           Check that all files owned by the given package(s) are present on the system. If packages are not specified or filter
           flags are not provided, check all installed packages.

Offline

#5 2010-06-09 19:50:10

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: accidently did: # rm -r /usr ... how to recover?

ls -l /usr/
total 296
drwxr-xr-x   3 root root  69632 Jun  9 07:19 bin
drwxr-xr-x 388 root root  49152 Jun  9 07:19 include
drwxr-xr-x 186 root root 135168 Jun  9 19:58 lib
drwxr-xr-x   2 root root   4096 May 26 13:23 libexec
drwxr-xr-x  10 root root   4096 Feb 26 04:56 local
drwxr-xr-x   3 root root  12288 Jun  6 20:05 sbin
drwxr-xr-x 258 root root  12288 Jun  8 19:27 share
drwxr-xr-x   3 root root   4096 Apr  9 19:22 src
drwxr-xr-x   3 root root   4096 Apr 29 22:25 var

All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#6 2010-06-09 19:55:25

Bob Day
Member
Registered: 2005-11-26
Posts: 43

Re: accidently did: # rm -r /usr ... how to recover?

hmmmm...much more is missing...looks like I have to reinstall sad
Thanks for you help all

Offline

#7 2010-06-09 20:01:44

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: accidently did: # rm -r /usr ... how to recover?

My /usr/var and /usr/libexec are actually empty now I take a closer look, so don't take any notice of those.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#8 2010-06-09 20:09:55

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: accidently did: # rm -r /usr ... how to recover?

schuay wrote:

Try pacman  -Qk

-k --check
           Check that all files owned by the given package(s) are present on the system. If packages are not specified or filter
           flags are not provided, check all installed packages.

that's an awesome suggestion that i wouldn'tve though of.  nice!

Offline

#9 2010-06-09 20:24:29

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: accidently did: # rm -r /usr ... how to recover?

For the future:

alias rm="rm -i"

Offline

#10 2010-06-09 20:39:46

lymphatik
Member
From: Somewhere else
Registered: 2009-03-07
Posts: 119

Re: accidently did: # rm -r /usr ... how to recover?

Ramses de Norre wrote:

For the future:

alias rm="rm -i"

Less intrusive rm -I (notice the capital I, have a look at man rm)

Offline

Board footer

Powered by FluxBB