X-Debbugs-Cc: ty...@mit.edu
Package: e2fsprogs
Version: 1.42.8-1
File: /sbin/e2fsck

Sometimes fsck can get the word SWAPSPACE2 out of the superblock:

$ dd if=/dev/zero of=/tmp/eee count=99999
99999+0 records in
99999+0 records out
51199488 bytes (51 MB) copied, 0.272312 s, 188 MB/s
$ /sbin/mke2fs  /tmp/eee
mke2fs 1.42.8 (20-Jun-2013)
/tmp/eee is not a block special device.
Proceed anyway? (y,n) y
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
12544 inodes, 49996 blocks
2499 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=51380224
7 block groups
8192 blocks per group, 8192 fragments per group
1792 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

$ /sbin/mkswap /tmp/eee #OOPS!
Setting up swapspace version 1, size = 49992 KiB
no label, UUID=907f56f2-3099-4bf8-a06d-d9878e5b891a
$ strings -t x /tmp/eee
    ff6 SWAPSPACE2
  6a020 lost+found
$ /sbin/fsck.ext2 /tmp/eee
e2fsck 1.42.8 (20-Jun-2013)
ext2fs_open2: Bad magic number in super-block
/sbin/fsck.ext2: Superblock invalid, trying backup blocks...
/tmp/eee was not cleanly unmounted, check forced.
Resize inode not valid.  Recreate<y>? yes
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 (7754, counted=7755).
Fix<y>? yes
Free blocks count wrong (47610, counted=47611).
Fix<y>? yes

/tmp/eee: ***** FILE SYSTEM WAS MODIFIED *****
/tmp/eee: 11/12544 files (0.0% non-contiguous), 2385/49996 blocks
$ strings -t x /tmp/eee
  6a020 lost+found


But sometimes it can't:

# fsck.ext3 -f /dev/sda10
e2fsck 1.42.8 (20-Jun-2013)
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
/dev/sda10: 2232/490560 files (53.1% non-contiguous), 1834365/1959922 blocks
# strings -t x /dev/sda10|head
    ff6 SWAPSPACE2
 3e1020 lost+found

So we might think debugfs(8) might be useful in this case to 'clear it'.
But alas, it is not.

Nor can dumpe2fs detect it.

Only strings(1) can.

And gparted, which coughs on it
https://bugzilla.gnome.org/show_bug.cgi?id=705597
and that's why I think it is the job of
fsck to get it out in all cases, not just some.

Is the only cure to
mkswap x #oops
fsck x
open heart surgery with dd(1)?
Well not really open heart, as it is unmounted.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to