LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-17-2006, 07:51 PM   #1
fobster
LQ Newbie
 
Registered: Jan 2006
Location: ca, usa
Distribution: rh9
Posts: 12

Rep: Reputation: 0
Unhappy 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
 
Old 08-17-2006, 08:26 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

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

Be careful as root.
 
Old 08-17-2006, 08:32 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
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.
 
Old 08-18-2006, 12:44 AM   #4
fobster
LQ Newbie
 
Registered: Jan 2006
Location: ca, usa
Distribution: rh9
Posts: 12

Original Poster
Rep: Reputation: 0
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

Last edited by fobster; 08-18-2006 at 12:59 AM.
 
Old 08-18-2006, 01:31 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 08-18-2006, 08:03 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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/
 
Old 08-18-2006, 08:12 AM   #7
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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.
 
Old 08-18-2006, 08:28 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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 ...
 
Old 08-18-2006, 08:35 AM   #9
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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
 
Old 08-18-2006, 08:38 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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 ...
 
Old 08-18-2006, 09:22 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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!!!
 
  


Reply

Tags
delete, recover, rm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MBR deleted now what? greythorne Suse/Novell 2 05-11-2005 08:48 AM
Kmail crashes when deleted mail is deleted dufferin Slackware 0 03-21-2005 03:23 PM
deleted linux partition adn the boot loader was deleted also,now i have only gnu grub boris199 Linux - Laptop and Netbook 2 01-29-2005 04:53 PM
deleted bootloader billman424 Linux - General 5 04-21-2004 12:48 AM
pretend this is deleted. amphibious Linux - Newbie 2 12-02-2003 05:46 PM


All times are GMT -5. The time now is 01:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration