Now, here’s a quick blog entry on how to check your harddisk for possible bad blocks and mark them those badblocks along the way.
What is e2fsck?
e2fsck is used to check a Linux second extended file system (ext2fs). E2fsck also supports ext2 filesystems containing a journal, which are also sometimes known as ext3 filesystems, by first applying the journal to the filesystem before continuing with normal e2fsck processing. After the journal has been applied, a filesystem will normally be marked as clean. Hence, for ext3 filesystems, e2fsck will normally run the journal and exit, unless its superblock indicates that further checking is required.
Steps To Check Your Hard Disk For Bad Blocks
1. Unmount the hard drive that needs to be checked. Assuming the mounted secondary hard drive is /dev/sda1
# umount /dev/sda1
2. Proceed to check for possible harddisk bad blocks using e2fsck
# e2fsck -c /dev/sda1
Time for coffee break. This might take a while depending on your hard drive capacity.