fsck.ext4 and badblocks
Posted: Sat May 17, 2014 2:12 am
[PROBLEM]
A friend of mine had problems with her GNU/Linux system, and it turned out that the harddisk was suffering from I/O errors
[SOLUTION]
First of all: A harddisk that has bad blocks, should usually not be trusted anymore - and replaced as soon as possible.
In order to avoid further data damage, one can do a filesystem check (fsck) - scan for badblocks and mark them as not-to-be-used:
I ran a simple:
The first "-c" checks for bad blocks, and adding it twice, tell fsck to mark them accordingly.
I've also found a nice quick example on "commandlinefu.com" on one can also try:
Commandline arguments used:
NOTE: Never run fsck on a mounted partition!
Good luck!
A friend of mine had problems with her GNU/Linux system, and it turned out that the harddisk was suffering from I/O errors
[SOLUTION]
First of all: A harddisk that has bad blocks, should usually not be trusted anymore - and replaced as soon as possible.
In order to avoid further data damage, one can do a filesystem check (fsck) - scan for badblocks and mark them as not-to-be-used:
I ran a simple:
Code: Select all
$ fsck.ext4 -c -c /dev/sdx
I've also found a nice quick example on "commandlinefu.com" on one can also try:
Code: Select all
$ fsck.ext4 -cDfty -C 0 /dev/sdx
I shall also quote user "mtron"'s notice on that page:-c ? check for bad sectors with badblocks program
-D ? optimize directories if possible
-f ? force check, even if filesystem seems clean
-t ? print timing stats (use -tt for more)
-y ? assume answer ?yes? to all questions
-C 0 ? print progress info to stdout
NOTE: Never run fsck on a mounted partition!
Good luck!