Saturday, January 19, 2008

HowTo: Check and Mark Bad Block Of Hard Disk

I just plugged my old harddrive into my existing linux box and it has been long time since I last used this spare harddisk of mine. I just felt the need to check for an old rpm spec file this hardddrive.

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.

Happy weekend and enjoy.

Your comments are always welcome here.
Related Readings:
Hard disk Monitoring using SmartCtl

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy