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?
Best Answer
First you can test your hard drive via the package smartmontools
Activate "smart" in your drive :
Start a long test ( you can try in first "short" test ) :
Wait end of test and get result :
If your hard drive is ok, you can try command bellow to check filesystem :
If it doesn't work, testdisk is the solution.