Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Ext4 partition is not working

Jul 23, 2012 4:58AM PDT

Basically a few days ago I was setting up a seperate partition for my brother to use, to download ubuntu 12.04 on using a Fedora 16 livecd of mine.

I free'd about 103GB of space off of my ext4 partition (sdb5)
which (should) have another 60GB of free space left in it. sdb5 is also the partition that holds my normal OS (ubuntu 11.10) that I login to every day, and most of my important files.

When I tried rebooting into ubuntu (have not installed the new OS) it booted into the initramfs prompt. This striked me as odd, and after a little while I found out that the filesystem size was larger than the device size.

some information:
# e2fsck -yv /dev/sdb5
e2fsck 1.41.14 (22-Dec-2010)
The filesystem size (according to the superblock) is 64000000 blocks
The physical size of the device is 63999809 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? yes

# mke2fs -n /dev/sdb5
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
16007168 inodes, 63999809 blocks
3199990 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1954 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

# e2fsck -f -b 32768 /dev/sdb5
The filesystem size (according to the superblock) is 64000000 blocks
The physical size of the device is 63999809 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? no

One or more block group descriptor checksums are invalid. Fix<y>? yes

Group descriptor 34 checksum is invalid. IGNORED.
.... (for each descriptor in between) ...
Group descriptor 1953 checksum is invalid. IGNORED.
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/sdb5: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb5: 874780/16007168 files (0.3% non-contiguous), 35209844/64000000 blocks
Error writing block 1 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 2 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 3 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 4 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 5 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 6 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 7 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 8 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 9 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 10 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 11 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 12 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 13 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 14 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 15 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 16 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 9 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 10 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 11 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 12 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 13 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 14 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 15 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 16 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 9 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 10 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 11 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 12 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 13 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 14 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 15 (Attempt to write block from filesystem resulted in short write). Ignore error? no

Error writing block 16 (Attempt to write block from filesystem resulted in short write). Ignore error? no


# resize2fs /dev/sdb5 63999809
resize2fs 1.41.14 (22-Dec-2010)
Resizing the filesystem on /dev/sdb5 to 63999809 (4k) blocks.
resize2fs: Attempt to read block from filesystem resulted in short read while trying to resize /dev/sdb5
Please run 'e2fsck -fy /dev/sdb5' to fix the filesystem
after the aborted resize operation.

# mkdir /test
# mount -t ext4 /dev/sdb5 /test
mount: wrong fs type, bad option, bad superblock on /dev/sdb5,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

# dmesg|tail
[ 4601.392839] wlan0: RX AssocResp from ******** (capab=0x401 status=0 aid=5)
[ 4601.392847] wlan0: associated
[ 4601.398842] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 4612.466145] wlan0: no IPv6 routers present
[ 5508.123326] sd 6ShockedShockedShocked: [sdb] Sense Key : Recovered Error [current] [descriptor]
[ 5508.123342] Descriptor sense data with sense descriptors (in hex):
[ 5508.123349] 72 01 04 1d 00 00 00 0e 09 0c 00 00 00 00 00 00
[ 5508.123375] 00 00 00 00 40 50
[ 5508.123390] sd 6ShockedShockedShocked: [sdb] ASC=0x4 ASCQ=0x1d
[ 6567.008722] EXT4-fs (sdb5): bad geometry: block count 64000000 exceeds size of device (63999809 blocks)

I have no idea what to do now, and I'm honestly about to trash the partition all together; I was just hoping to save a few of my files from it but it doesn't look like I'll be able to. Any suggestions would be greatly appreciated.

Discussion is locked

- Collapse -
Answer
edit
Jul 23, 2012 5:03AM PDT

Just a quick edit, for the e2fsck command, I was using `e2fsck -f -b 32768 /dev/sdb5 >e2log.log`, and did not choose yes to fix the descriptors (I've already tried yes before, and it 'appeared' to have fixed them, but the same descriptors were still wrong)

- Collapse -
Answer
Ouch. No backup?
Jul 23, 2012 5:25AM PDT

Double ouch. While I'd boot another LiveCD to see if I could find my files and start over, there are some open discussions about data recovery and more so I'll keep away from prior discussions for now. That is, why duplicate those here?

OK, try looking around with any of those Linux based Rescue LiveCDs.
Bob