2

I have a HDD device named /dev/sdc1 which hosts a filesystem other than my root. I boot after a power outage, and I cannot mount it. I wonder if it is possible for the filesystem to be corrupted beyond repair. I don't think it was even used at the moment of the failure. What can I try to make it mount again?

user@pc ~ $ sudo fdisk -l /dev/sdc 
... 
Device     Start        End    Sectors  Size Type 
/dev/sdc1   2048 5860532223 5860530176  2.7T Linux filesystem

/etc/fstab: 
/dev/sdc1   /mnt/data_c ext4    defaults    0 0 

user@pc ~ $ sudo mount /dev/sdc1 
mount: wrong fs type, bad option, bad superblock on /dev/sdc1, 
   missing codepage or helper program, or other error 

   In some cases useful info is found in syslog - try 
   dmesg | tail or so.

user@pc ~ $ dmesg|tail
...
[154150.717274]  sdc: sdc1 
[154564.927084] EXT4-fs (sdc1): VFS: Can't find ext4 filesystem

Then I tried mount with alternate superblock locations.

mount -t ext4 -o sb=131072,ro /dev/sdc1 /mnt/data_c

I did the above, with the sb option equal to multiples of 4 of all the following numbers: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 (because someone told me that superblock backups are stored on these blocks and that they have to be multiplied by 4 because mount wants its sb= in terms of 1k blocks). I always got the same error (wrong fs type, bad option, bad superblock ... and VFS: Can't find ext4 filesystem).

Then I used testdisk, which can find the partition, and it can list the files (I think all the files) in it. It can also copy some files one by one, but the problem is I need about 200-300 files and this is time consuming so I would like to explore another possibility of perhaps repairing the filesystem.

Disk /dev/sdc - 3000 GB / 2794 GiB - CHS 364801 255 63 

     Partition                  Start        End    Size in sectors 

  MS Data                     2048 5860532223 5860530176 [data3] 
superblock 0, blocksize=4096 [data3] 
superblock 32768, blocksize=4096 [data3] 
superblock 98304, blocksize=4096 [data3] 
superblock 163840, blocksize=4096 [data3] 
superblock 229376, blocksize=4096 [data3] 
superblock 294912, blocksize=4096 [data3] 
superblock 819200, blocksize=4096 [data3] 
superblock 884736, blocksize=4096 [data3] 
superblock 1605632, blocksize=4096 [data3] 
superblock 2654208, blocksize=4096 [data3] 

To repair the filesystem using alternate superblock, run 
fsck.ext4 -p -b superblock -B blocksize device

I am very curious, the hard disk is less than a year old, I am fairly sure nothing was being written to it at the time of outage (it might have been reading though). Is it possible that all the superblocks have become invalid? Maybe they are somewhere else?

1 Answer 1

1

First you can test your hard drive via the package smartmontools

Activate "smart" in your drive :

 smartctl -s on /dev/sdc

Start a long test ( you can try in first "short" test ) :

 smartctl -t long /dev/sdc

Wait end of test and get result :

 smartctl -l selftest /dev/sdc

If your hard drive is ok, you can try command bellow to check filesystem :

 e2fsck -n /dev/sdc1

If it doesn't work, testdisk is the solution.

You must log in to answer this question.

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