Accidentally issued "mkswap" on ext3 fs -- recovery possible?
Andreas Dilger
adilger at clusterfs.com
Fri Jul 8 18:20:25 UTC 2005
On Jul 08, 2005 10:33 -0700, ha haha wrote:
> > I accidentally issued "mkswap" on a used ext3 fs
> > partition (~30G) :-/
> >
> > I have analyzed the behaviour of mkswap using two
> > test files and it
> > appears to only change "some" bytes:
> > --8<--
> > --- swap2.xxd 2005-07-04 21:00:10.157261360 +0200
> > +++ swap1.xxd 2005-07-04 21:00:01.894517488 +0200
> > @@ -62,7 +62,7 @@
> > 00003d0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 00003e0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 00003f0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > -0000400: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > +0000400: 0100 0000 ff09 0000 0000 0000 0000 0000
> > ................
> > 0000410: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0000420: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0000430: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > @@ -253,7 +253,7 @@
> > 0000fc0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0000fd0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0000fe0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > -0000ff0: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > +0000ff0: 0000 0000 0000 5357 4150 5350 4143 4532
> > ......SWAPSPACE2
> > 0001000: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0001010: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > 0001020: 0000 0000 0000 0000 0000 0000 0000 0000
> > ................
> > --8<--
> >
> > Here is the output of 'fsck.ext3 -n -v hdb1.img':
> > --8<--
> > e2fsck 1.35 (28-Feb-2004)
> > Couldn't find ext2 superblock, trying backup
> > blocks...
> > hdb1.img was not cleanly unmounted, check forced.
> > Pass 1: Checking inodes, blocks, and sizes
> > Pass 2: Checking directory structure
> > Pass 3: Checking directory connectivity
> > Pass 4: Checking reference counts
> > Pass 5: Checking group summary information
> > Free blocks count wrong for group #0 (24043,
> > counted=0).
> > Fix? no
> >
> > Free blocks count wrong for group #1 (32250,
> > counted=0).
> > Fix? no
Should have read original email better. This is only be blocks count summary,
which is never up-to-date on a backup superblock+group descriptor. The
checking shows everything is OK.
A good time to make a backup!
Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.
More information about the Ext3-users
mailing list