[GLLUG] Ext2 recovery

Matt Graham danceswithcrows@usa.net
Mon, 9 Sep 2002 09:41:28 -0400


On Sunday 08 September 2002 23:09, after a long battle with technology, 
Brad Fears wrote:
> I somehow managed to corrupt my ext2-formatted zip disk while trying
> to access it in OS X.  The machine claimed it contained no data,
> which was when I realized it was formatted ext2.
>
> Then I try to mount it back on my linux machine, and it suddenly
> thinks the partition is vfat.  Thanks, OS X.
>
> I tried running 'e2fsck -b 8193 /dev/hdb', but it complains " Attempt
> to read block from filesystem resulted in short read while trying to
> open /dev/hdb.  Could this be a zero-length partition?"  I also tried
> the same command with other superblock backups (24577, 40961, 57345,
> 73729), but none worked.

First, ZIP disks are always partitioned, so /dev/hdX is not right.  You 
want to e2fsck /dev/hdX4, most likely.  Second, ext2 filesystems made 
using versions of mke2fs since about 2000 have always been made with 
the "sparse superblock" feature turned on.  That means the backup 
superblocks are arranged differently and there are fewer of them.  The 
e2fsck maintainers never bothered to switch the "try -b 8193" message 
to what's currently correct, "try -b 32768".

Having ext2 filesystems on removable media is not a good idea except in 
special circumstances.  UIDs, GIDs, and file permissions that are 
correct on one machine will not be correct on another machine.  ext2 
has more overhead than FAT16, not good for limited-space things like 
ZIP disks.  Only Linux can handle ext2 filesystems natively, making 
ext2 removable media less useful for data exchange.  And as you found 
out, some OSes will attempt to "fix" removable media that don't conform 
to the de facto standards....

-- 
   Engineer: "Pigs can fly, if you feed them enough beans."
   Management: "Great, we can sell that.  We won't mention the problem 
   of pig byproducts falling from the sky, and fix it in an upgrade."
There is no Darkness in Eternity/But only Light too dim for us to see