disaster recovery - did I do the right thing?

Ian Smith smithi at nimnet.asn.au
Tue May 8 05:17:11 UTC 2007


On Sat, 5 May 2007 17:05:42 -0600 Ray <ray at stilltech.net> wrote:

 > Hello all,
 > I did something stupid the other day (sleep deprivation combined with 
 > a "clever" hack were the main reasons), and I'm just curious if I did the 
 > right thing afterwards.
 > 
 > The mistake:
 > /usr/local/# rm -f *
 > note that root was running bash as a shell at the time, found 
 > in /usr/local/bin or something.
 > 
 > What I did was to start over, reinstall from scratch.
 > my question, was there an easier way?

Ray, I've been watching this thread, and you've had some good advice
about backups etc, but if you really did 'rm -f *' in /usr/local (NOT
'rm -rf *') then it's very likely that you deleted no files at all.

paqi% ll -rt /usr/local
total 134
drwxr-xr-x    3 root  wheel    512 Feb  9  2006 VFS
-rw-r--r--    1 root  wheel      0 Aug 27  2006 moved_portsnap_from_var_db
drwxr-xr-x    3 root  wheel    512 Dec  3 22:31 src
drwxr-xr-x    8 root  wheel    512 Dec 10 17:17 www
drwxr-xr-x    7 root  wheel    512 Dec 10 19:34 libdata
drwxr-xr-x    2 root  wheel    512 Dec 10 19:52 build-1
drwxr-xr-x    9 root  wheel    512 Dec 10 21:59 libexec
drwxr-xr-x    2 root  wheel    512 Dec 10 22:14 env
drwxr-xr-x    2 root  wheel   2048 Dec 10 22:53 info
drwxr-xr-x    6 root  wheel    512 Dec 10 23:23 gnu-autotools
drwxr-xr-x    7 root  wheel    512 Dec 27 16:33 diablo-jre1.5.0
drwxr-xr-x    3 root  wheel  25088 Jan 28 01:36 bin
drwxr-xr-x   83 root  wheel   1536 Feb 11 22:37 share
drwxr-xr-x  139 root  wheel  24064 Feb 12 18:35 include
drwxr-xr-x   33 root  wheel  55296 Feb 12 18:35 lib
drwxr-xr-x   27 root  wheel   1536 Feb 12 18:38 etc
drwxr-xr-x    2 root  wheel   1024 Mar  3 20:53 sbin
drwxr-xr-x    3 root  wheel    512 Mar 29 23:20 portsnap
drwxr-xr-x   28 root  wheel   1024 May  5 04:22 man

The only file 'rm -f *' in /usr/local would remove here is a comment I
made for myself with 'touch moved_portsnap_from_var_db'; 'rm *' (with or
without -f) does not remove directories (unless you also use -r).

I can't say what was in _your_ /usr/local, but I've just checked on 4.8,
4.10, 5.5-STABLE and 6.1-RELEASE systems, and none of them install plain
files in /usr/local at all, just directories.  So you may be lucky .. 

Cheers, Ian



More information about the freebsd-questions mailing list