Accidentally issued "mkswap" on ext3 fs -- recovery possible?

Andreas Dilger adilger at clusterfs.com
Fri Jul 8 16:51:37 UTC 2005


On Jul 08, 2005  18:03 +0200, Wolfram Schlich 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<--

Try starting with a test file which is not all zero (e.g. copy from
/dev/urandom) and see how much is changed.

> Any suggestions? It's hard to believe that those few changed bytes
> should make the whole fs unrecoverable, isn't it?

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.




More information about the Ext3-users mailing list