[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: disaster recovery

On Mar 05, 2003  21:24 -0500, Greg Hennessy wrote:
> In a fit of irony, while preparing to burn a CDROM
> with some software I've been writing for about six months,
> I did a rm *>o instead of rm *.o on an ext3 filesystem.
> And I'm well aware that under normal circumstance you 
> can't undelete, especially a ext3 filesystem. However,
> I need to at least *try* to recover this. I've built
> lde (linux disk editor) and if I can isolate a certain block,
> I can at least get the data off, since I've unmounted the partition.
> All my source files have a certain #include, so does anyone
> have an efficient way to read an unused block from an ext3 
> partition, check if a certain string is present, and if so
> return the block number? I've never deal with filesystem
> code (Just a scientific programmer) so if anyone has
> a skeleton set of code that I could use as a basis I would be
> most happy.

One possibility (probably good for perl programmers):

dumpe2fs <dev> - use the "  Free Blocks" lines
dd bs=<blocksize> if=<dev> skip=<blocknum> | strings | grep "include ..."

Cheers, Andreas
Andreas Dilger

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]