Re: Help! Accidentally started deleting /usr
On Sun, Apr 08, 2001, Mark Phillips wrote:
> Thanks Gavin for your help!
> I managed to restore my system!!
> What I did, was use "dpkg --get-selections" to find out what packages were
> installed on my system. I redirected this to a file and then edited it.
> I turned it into a script which ran
> apt-get --reinstall install <list of packages>
> on every package of the system. I broke the list into several chuncks and
> did the above apt-get on each chunk.
> Anyway, I believe the above process should have restored my system to
> fully working order. Certainly it seems to be working.
> Hopefully this email will be helpful if anyone else experiences the same
> By the way, is there any way of setting up an "undelete" for averting this
> kind of disaster? My Dad mentioned that Novell Netware has an undelete
> which basically puts off really deleting stuff for about 5 days --- unless
> it has to because of lack of space. This sounds like a _very_ useful
I'm sure many people have many different ways of dealing with this. Here
are a few, off the top of my head:
1. Back up (onto cdrw/tape/network storage, etc) once or twice a week
so there's no great worry if something is deleted.
2. Alias 'rm' to 'rm -i' and then use 'rm -f' when you're certain you
want to delete large numbers of files. I've found the extra typing of
'-f' is likely to prevent mistakes.
3. Set up some form of two-stage delete system. A very rudimentary
one could be to alias 'rm' to a script that instead of deleting files
moves them to hidden status (prepends '.') and maybe appends some
known unique extensions '<whoami>-DEL' (or whatever). Then you can
setup a cron job to delete this nightly or the like. Surely, others
can make this much more elegant (delete them when free space is low,
prevent possible namespace clashes, ensure security issues); I just
wanted to throw out an idea.
Hope this helps,
> "They told me I was gullible ... and I believed them!"
> To UNSUBSCRIBE, email to firstname.lastname@example.org
> with a subject of "unsubscribe". Trouble? Contact email@example.com
Daniel A. Freedman
Laboratory for Atomic and Solid State Physics
Department of Physics