2

My drive got corrupt after a thunderstorm. It used to be 1 partition of 2.5tb but now it shows 2 partitions. It's weird because 300gig free space is about how much it had before corrupting, but it was part of the first partition.

partition

I tried

$ sudo resize2fs -f /dev/sdb1

Resizing the filesystem on /dev/sdb1 to 536870911 (4k) blocks.
resize2fs: Can't read an block bitmap while trying to resize /dev/sdb1
Please run 'e2fsck -fy /dev/sdb1' to fix the filesystem
after the aborted resize operation.

sudo e2fsck -f /dev/sdb1

e2fsck 1.42 (29-Nov-2011)
The filesystem size (according to the superblock) is 610471680 blocks
The physical size of the device is 536870911 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? n

....

Error reading block 537395215 (Invalid argument) while reading inode and block bitmaps. Ignore error<y>? yes

Force rewrite<y>? yes

Error writing block 537395215 (Invalid argument) while reading inode and block bitmaps.  Ignore error<y>? yes

... A lot of these.

I can't use e2fsck -y because the first question aborts if I say "y". If I put a weight on the 'y' key it fails because none of the errors were really fixed.

I asked this question before and tried using gparted but gparted fails because the first thing it does is:

e2fsck -f -y -v /dev/sdb1

giving the same error. The disk status says healthy. There are no bad blocks. This is very frustrating because I can see the data in testdisk and it looks like it's all there. I already bought another 2.5tb drive and made a clone using dd. The next step if I can't fix this is to wipe that drive and just move the data with testdisk, but it seems certain folders will copy infinitely until the drive is full because of symlinks or errors so it's also a difficult option.

sudo fdisk -l

Disk /dev/sdb: 2500.5 GB, 2500495958016 bytes
255 heads, 63 sectors/track, 304001 cylinders, total 4883781168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0005da5e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048  4294969342  2147483647+  83  Linux

sudo badblocks -b 4096 -n -o badfile /dev/sdb 610471680 536870911

badfile is empty

I also tried changing the superblock with "fsck -b" but all of them are the same.

1 Answer 1

2

It looks like your partition table got screwed up. Since you have a disk larger than 2TB, you need to use GPT, but fdisk thinks the disk is using a dos partition table. You will need to create a new gpt disk label and recreate the partition using the full space, and finally fsck it.

1
  • 1
    "create a new gpt disk label and recreate the partition using the full space" how would I do this? Jun 25, 2012 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .