Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Thursday May 13, 2004
02:09 AM

Worst case has happened

[ #18730 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • That happened to me ONCE (a long time ago). Have you considered buying an external USB hard drive? Those things are lovely, and great at providing a sentiment of security.
    • 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 p
      • 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...
  • Why not just restore from your backups?
    • 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?
  • See also Restoring deleted files under Linux [] and some of the suggestions in the follow-ups.


    • 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 a strstr 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