Заметки

Archives for: March 2006, 06

Looking for problematic ("almost bad") sectors on a hard drive

Had to determine area of hard drive occupied by unstable sectors. The sectors are not getting remapped nor reported as bad by badblocks, but cause machine to lock for a fraction of second while being written or read.
I didn't want to reboot to use any MS-DOS based tool and I couldn't find anything appropriate for Linux, so I spent few minutes to write this little PHP script:

slowsector.zip

The scripts scans given block device and reports blocks which take too long to read. It doesn't take into account that the delay can be caused by load from other applications, but still you can understand which zones are really bad and map them out by repartitioning or adding them to bad block inode (fsck.ext3 -L remapsectors.txt -v -v -v -k -C 0 -y...). Instructions how to use the script are inside it.

Archives

                                                                                                                                                                                                                                                                   


© Sergey A. Galin, 1998-2021 sageshome.net/blog/