[mdlug] Recovering damaged EXT2

David McMillan skyefire at skyefire.org
Wed Sep 16 19:45:02 EDT 2009


Jay Nugent wrote:
> Greetings,
>
> On Tue, 15 Sep 2009, David McMillan wrote:
>
>   
>> 	So, one of the two big USB drives I've been using as a poor man's 
>> RAID-1 (using periodic rsync) died, and I bought a replacement and 
>> immediately began a fresh rsync to copy the remaining drive to the new 
>> one.  No big deal... except that, thanks to a dangling cord and careless 
>> footwork (my own), the remaining drive of the original pair fell off the 
>> table and hit the floor.  It *seems* okay -- no weird noises, parted 
>> recognizes its filesystem (ext2) and size, but....
>> 	Now, when I try to mount it, I get a "bad superblock" error.  If I try 
>> to run fsck or e2fsck, I get "the superblock is corrupt" and a 
>> suggestion to run e2fsck with the "e2fsck -b 8192 <device".  But if I 
>> try that, I get a "device busy" error message, even though the partition 
>> is not mounted and no other process is accessing that drive.
>>
>> 	So... am I screwed?  Or are there tools that might allow me to recover 
>> what was on this drive?
>>     
>
>    Just in case the platter is still readable (or partially readable), you 
> *CAN* have the filesystem use one of the backup Superblocks since the 
> master Superblock indicates that it is corrupted.  So try this...
>
>    As root...
>       mke2fs -n /dev/hda1   <---- or whatever you device is
>
>    The -n flag causes mke2fs to NOT actually create a filesystem, but
> display what it would do if it were to create a filesystem.
>
>   
    Well, this part worked...
>    This will tell you what number to plug into the 'e2fsck -b <8192> 
> device' command you mentioned above.  You will now have a list of the 
> locations of ALL the copies of the Superblock that should reside on that 
> partition.   Once you plug one of those into the e2fsck command it will 
> 'correct' the corrpted Superblock (if it indeed can still write to the 
> platter).
>   
    But this just produced more "device busy" errors.  I worked my way 
through every superblock that mke2fs reported, but no dice.  Looks like 
I'm SOL.

    Thanks for the help, though.



More information about the mdlug mailing list