Subject: Re: Help: Injudicious use of "rm -r"
To: <>
From: T. Sean (Theo) Schulze <71410.25@compuserve.com>
List: port-mac68k
Date: 12/01/1997 00:39:13
To those who responded to my call for help, thank you.  I fixed it last 
night by turning the system off, using Installer to cpin the base, comp, 
misc and text files and then rebooting single user.  When the shell 
prompt came up, I entered /usr/local/bin/bash, fsck'd, mounted the usr2 
drive, and untarred the files.

The biggest hinderence I had to resolving this without shutting down was 
that I could not become root.  When I first spotted trouble, I should 
have stayed su'd to root, but I didn't.  Colin, your advice here below, 
to use su -m would have been the ticket, but I rushed to a solution last 
night and your emial came in this morning.  I had thought that su might 
have been of some help still, but when I tried man su last night, it just 
returned me to the command prompt.

>
>Try 'su -m'.  This will su you to root, and keep your current shell.
>Since you didn't seem to have deleted /usr/bin (which is where su is),
>this should work just fine.  Then you can do whatever you need to do as
>root.
>

Paul Goyette suggested:
>Since you've still got a valid shell why not just copy bash to /bin/csh
>and then log in as root?  Granted, you'll be running under bash but at
>least you'll be running! 
>
I tried to copy bash to csh, but that didn't work because I wasn't root.  
No permissions.

Benoit Martel offered this:

>Take a look at 
>http://www.CS.McGill.CA/~magus/unixrescue.txt
>for a legendary story of "rm -rf" rescue. It may even give you ideas.
>
>Is the machine connected (or can it be) through modem or ethernet? (this 
>is a case where a floppy support could be useful).
>If so, you can probably retrieve enough to start fixing things.
>

I took a look at this, and I would have done something similar (i.e, load 
the files by ftp) had I had the right permissions to cp into /.  I could 
ftp base into my home directory, but couldn't copy it out.

Ken Nakata sent me:
>Is /usr/local (or /usr) a separate partition from /?  If not, you
>should be able to fix things by booting into single-user mode,
>answering to init's question about shell with "/usr/local/bin/bash",
>and editing /etc/passwd, etc, shouldn't you?
>
Eventually, I did re-enter single user and use /usr/local/bin/bash.  A 
question that came out of this:  If I am running multi-user, how can I 
switch to single user without shutting down?

Bottom-line: what I learned from this is that it is good to be root :-)  
I also learned that tar has an option --keep-old-files that will prevent 
the replacement of an existing file.  I wasn't sure what all I lost, so I 
untarred base, comp, misc and text.  Not wanting to clobber what I had, 
the --keep-old-files came in handy.

Again, thanks for you help!

Cheers,

Sean.


                 T. Sean (Theo) Schulze
71410.25@compuserve.com            TSSchulze@aol.com
****************************************************
Custom reconciles us to everything.  -- Edmund Burke