LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   I deleted / HELP!!!! (http://www.linuxquestions.org/questions/linux-general-1/i-deleted-help-474945/)

fobster 08-17-2006 07:51 PM

I deleted / HELP!!!!
 
OMG i feel like an idiot, I ran rm / when was trying to delete content from another directory. I noticed what i was doing and Ctrl-C after a few secs. This is on FC5, will the recovery disk fix my problem. So far, all i notice gone is the /bin/ directory. Are there logs for files and directories deleted?? any ideas??

Thx

Matir 08-17-2006 08:26 PM

The FC5 recovery disk might work. Alternatively, you may just want to reinstall depending on how much you blew away.

Be careful as root. :)

Tinkster 08-17-2006 08:32 PM

Quote:

I ran rm / when was trying to delete content from another directory. I noticed what i was doing and Ctrl-C after a few secs. This is on FC5, will the recovery disk fix my problem. So far, all i notice gone is the /bin/ directory.
Is your rm aliased to rm -rf ?

Otherwise you shouldn't have deleted any of the directories
under root, you should just have gotten errors telling you that
those are directories.

fobster 08-18-2006 12:44 AM

no, i actually did a sudo rm -rf / :(. The file system is ext3 so i dont think there is anyway to recover it. Is there a log that tells what has been deleted?? And if i do reinstall, how do i make sure it overwrites the current copy?

Thx

jlliagre 08-18-2006 01:31 AM

Too bad you weren't using Solaris, which prevents such a mistake:
http://blogs.sun.com/roller/page/jbeck/20041001

As POSIX agreed on the feature, let's hope Gnu rm will follow one day.

pixellany 08-18-2006 08:03 AM

Quote:

Originally Posted by fobster
no, i actually did a sudo rm -rf / :(. The file system is ext3 so i dont think there is anyway to recover it. Is there a log that tells what has been deleted?? And if i do reinstall, how do i make sure it overwrites the current copy?

Thx

When you re-install, just delete the partition and make a new one. If you want to be sure all the old is gone, then you can "wipe" the disk with something like DBAN
http://dban.sourceforge.net/

ethics 08-18-2006 08:12 AM

Quote:

Originally Posted by fobster
no, i actually did a sudo rm -rf / :(.

Probably not what you want to hear, but this is the sort of thing that root and sudo safeguards are there to prevent.

As mentioned above aliasing rm is a great way. I alias all my cp/mv/rm commands to give verbose interactive output (i'm a bit of a cluts :)).

i would personally just reinstall if the whole bin directory is gone, and you may find out a bit later on something else was hosed, may as well do it now and get it over with.

jlliagre 08-18-2006 08:28 AM

Quote:

Originally Posted by ethics
As mentioned above aliasing rm is a great way.

Sorry to disagree, but aliasing rm is one of the worst things one can ever do, and unfortunately many often do it, including distributions.

If you want a safe rm for you or your users, then create a new command/function/alias, say "rmi" or something like that, and stick to it.

Changing the rm semantics will just make you used to the interactive prompt, and feeling rm default behaviour is to prompt you.

After a while you'll do "rm *" to clean some files on a directory, and interactively select the one you want.

One day, you'll run that "rm *" command on a regular Unix system, and bingo !

If you want a metaphor, it's just like having fun playing russian roulette with unloaded guns, one day or another, you'll use someone else's gun ...

ethics 08-18-2006 08:35 AM

Quote:

Originally Posted by jlliagre
Sorry to disagree, but aliasing rm is one of the worst things one can ever do, and unfortunately many often do it, including distributions.

If you want a safe rm for you or your users, then create a new command/function/alias, say "rmi" or something like that, and stick to it.

Changing the rm semantics will just make you used to the interactive prompt, and feeling rm default behaviour is to prompt you.

After a while you'll do "rm *" to clean some files on a directory, and interactively select the one you want.

One day, you'll run that "rm *" command on a regular Unix system, and bingo !

If you want a metaphor, it's just like having fun playing russian roulette with unloaded guns, one day or another, you'll use someone else's gun ...

Yeah i concede, what you say does make a lot of sense, and i agree.

I'm getting lazy in my old age, and i use exactly the same .bash* files, but one day i might not.. :S

jlliagre 08-18-2006 08:38 AM

Quote:

Originally Posted by ethics
I'm getting lazy in my old age

And you are 22 ! :)

22 years ago, I was writing my first helloworld C program on a Unix version 7 machine ...

pixellany 08-18-2006 09:22 AM

Quote:

Originally Posted by jlliagre
And you are 22 ! :)

22 years ago, I was writing my first helloworld C program on a Unix version 7 machine ...

FORTY years ago, I was writing Fortran programs on an IBM 36 key punch.

So there!!!


All times are GMT -5. The time now is 11:38 AM.