[mdlug] Recovering damaged EXT2

Jay Nugent jjn at nuge.com
Tue Sep 15 23:22:56 EDT 2009


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.

   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).

   Good luck!!!

      --- Jay Nugent

Train how you will Operate, and you will Operate how you were Trained.
+------------------------------------------------------------------------+
| Jay Nugent   jjn at nuge.com    (734)484-5105    (734)649-0850/Cell       |
|   Nugent Telecommunications  [www.nuge.com]                            |
|   Internet Consulting/Linux SysAdmin/Engineering & Design/ISP Reseller |
| ISP Monitoring [www.ispmonitor.org] ISP & Modem Performance Monitoring |
| Web-Pegasus    [www.webpegasus.com] Web Hosting/DNS Hosting/Shell Accts|
+------------------------------------------------------------------------+
 11:01pm  up 13:21,  3 users,  load average: 0.14, 0.23, 0.17




More information about the mdlug mailing list