Overwriting ext2 Partition with ext3

Matt Stegman matts at ksu.edu
Wed Jul 7 19:29:51 UTC 2004


On Wed, 7 Jul 2004, evilninja wrote:
> Niki Hammler schrieb:
> > mke2fs -j /device
> >
> > Important is the "-j" switch.
> >
> > What happens without the "-j" switch? All superblocks and inodes
> > are overwritten. Is this true??
>
> i don't think, that all inodes are overwritten. mkfs.?fs is pretty fast,
> so it's creating the superblock and the journal (-j) only.

It looks to me like the manpage says default options will overwrite
superblocks, group descriptors, block & inode bitmaps, and inode table.

If it didn't overwrite inodes, an fsck run immediately after mkfs would
find old inode data.  Maybe disconnected inodes if you had a filesystem on
the device previously, maybe random data.

There is a -S switch for mke2fs.  It tells it not to overwrite the bitmaps
and inode table.

Data blocks should have been left alone, assuming you haven't written
anything new to the filesystem (except wherever the journal is written; I
believe it's a regular file, and debugfs should be able provide you with a
block map).  So pretty much I think the only way you'll be able to recover
your data is grepping through the block device.

--
Matt Stegman





More information about the Ext3-users mailing list