LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-23-2005, 07:31 AM   #1
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Question A stupid rm -rf no more /boot,/bin,/etc what would you do?


Hi

Yesterday I was creating a script and just to try something I did
rm -rf /mnt/hda*

I realized to late /mnt/hda3 was uncorrectly mounted to my little debian


It never happened to me in 10 years, there had to be a first time.

So basically , I did a ctrl c 2 seconds after seeing it was abnormally long.
The speed of linux/fs combined with our damned alphabet made that I lost
/boot
/bin
/etc

Nothing really important was lost but I had done tweaking for 1 year.

How would you recover from this stupid error?

I'm thinking of booting with an etch livecd I have, coppying back /etc maybe /bin to at least recover apt-get , then gcc, then recompile a fresh kernel.

Maybe you have other ideas? Is there a rescue mode that could help?
I'm waiting for your comments, I will rebuild my machine in a few days.
I'm a bit concerned about /etc. I'm also thinking of reinstalling from scratch.. sniff


Thanks

Last edited by nx5000; 12-23-2005 at 07:42 AM.
 
Old 12-23-2005, 08:15 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Take a look at ddrescue. I don't know if it can help, but you might be able to find something still on the hd. I seem to remember that it could attempt to rebuild file link chains, but it has been a while since I had any reason to use it.

Of course, if you write and new files to the hd, all hope is lost, since the "free" space will probably be overwritten.

Good luck. (And, in the future, consider frequent backups. HDs sometimes fail without our help, too.)
 
Old 12-23-2005, 08:34 AM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I hate to say it but this is one of the few situations where a reinstall might be the easiest way. Trouble is /etc and /bin are going to contain files from numerous different packages, so your going to have to restore the basic /etc stuff and all the packages that had files in there.
 
Old 12-23-2005, 10:10 AM   #4
powadha
Member
 
Registered: Nov 2003
Location: Zwolle
Distribution: Arch
Posts: 651

Rep: Reputation: 31
Happend to me once in a bit of a different way but can (like jtshaw said) ensure you that a reinstall is the fastest way to get back up to speed. rm -rf is unforgiving.
 
Old 12-24-2005, 06:19 PM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 57
Thank you for advices from each of you

I'll have a try on ddrescue. if it can recover even 1 file I'll be happy to look at my old conf. I have kept my complex /etc/fstab because I had done a cat on it just before... lucky me
As I said, fortunatly /home (work data) , /var (which gives me the last packages I installed) where kept.
I fail to boot again kernel compiled on mandriva with gcc from an other partition, merge /bin from an livecd etch. After the boot start, there is a lockup.. /bin should be ok but /etc I have is from that LIVECD, which is very different from a sarge/testing/unstable.

I have a cd of sarge with netinst. I will have to install it on an other partition an use /bin and /etc from this one. Too bad I don't have a simple /etc from the cd.. ?
Then if doesn't work, I surrender I will have tried simple things. No time for longer hacking.. The partition will be transparently erased and re-netinstalled Better for sure.

And yes, I'll have to do at least one backup to recover from big stupidity of user (me in that case hehe) automatically reinstall software by inspecting the logs of apt... 5mn of a perl script
I will improve my install : /boot read only , /etc on an external partition, last kernel,...

Last edited by nx5000; 12-24-2005 at 07:20 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkisofs: Error - boot image './isolinux/isolinux.bin' has not an allowable size. ogross74 Red Hat 3 05-05-2016 02:22 AM
oh uh,i can't find the boot image 'isolinux.bin' shams Linux - Software 7 07-17-2007 02:34 PM
SUSE Boot CD stupid situation Sagittarius20 Linux - Newbie 8 09-19-2005 01:59 AM
Multiple 'mozilla-bin' in process list.. Why? orgee Linux - Software 2 09-29-2004 07:38 PM
stupid question, boot.log bit7 Linux - Software 1 03-13-2003 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration