Yup, I made it! I managed to destroy my partition where I keep all the code I have written within the past two years plus my mails.
This morning when booting, Linux complained that it was unable to read from /dev/hdb2
. Slight panic creeped up in me and so I booted with my recovery disk and did a fsck. Lots of errors, but none that weren't recoverable as it seemed.
My recovery disk doesn't yet know about ext3, so it turned my ext3 partition into ext2 which wouldn't be a problem.
After finally booting successfully, it wasn't able to mount this partition so I wanted to add the ext3 journal to it again. Now, what I should have written was tune2fs -j /dev/hdb2
. What I had written was make2fs -j /dev/hdb2
. :-(
So now I am feeverishly trying to recover some data with the help of a disk editor. So far I was able to recover one XS file that I was working on the past two days and so I have put the upcoming File-Locate-0.60 in its original state.
The disk editor, btw, is not much of a help. So I've written a small C program which reads from /dev/hdb2
blocks of 4096 bytes and scans those blocks for patterns that I supply. If it finds one, it dumps the block number. Together with the disk editor, I can then dump those blocks (and adjoining ones that belong to the same file) to disk. It's tedious and slow, but it works.
Re:USB
ethan on 2004-05-13T09:14:11
No, I haven't yet. But this incident made me aware that not having backups (and at the same time keeping the important stuff an a rather old harddisk), is a damn silly thing to do so I really can't blame anyone but myself.
Maybe I will use a CD-RW to backup my data periodically.
As for now, I was at least able to recover another piece of code whose loss would have put me into a deep depression.
I will now see whether I'll be able to get at a few of my mailboxes. Shouldn't be too hard. The rest (corpses of projects I started but lost interest in plus a complete Debian installation) I will declare lost forever.
After that I will consider a backup strategy. Maybe I use the now empty partition for backups (maybe rsyncing it or so) and non-essential data.Re:USB
rafael on 2004-05-13T09:23:42
Don't backup on another partition, unless it's on another independent hard drive. And the hard drive is better placed at another physical location. Imagine what could happen with hot teapots or other dangerous devices...
Re:Backups
jdavidboyd on 2004-05-13T17:53:36
That's what I was going to say, but it is obvious from the understated tone of panic that no backups have ever been made!
Not a good way to work the farm, eh?
John.
--
Re: Worst case has happened
ethan on 2004-05-13T20:07:51
I was doing roughly the same thing. Looking at the raw blocks was the only thing left as creating a new file system destroys all the meta information but leaves the data intact.
For that I wrote a very small C program that reads 4k chunks and does astrstr
against strings that I am looking for.
There's one odd thing though. There are quite a few blocks that are non-readable (read returns-EIO
on them). The bad thing about that is that the program (and the whole system in fact) almost freezes. I need to send SIGKILLs for almost a minute until the program is finally dead.
I'd really like to know why this happens. If it didn't happen a recovery tool would actually be quite easy to write.