"Linux Gazette...making Linux just a little more fun!"

The Answer Guy

By James T. Dennis, tag@lists.linuxgazette.net
Starshine Technical Services, http://www.starshine.org/

(?)Bad Cluster

From Ron Bautista on 13 Jul 1998 in the comp.unix.questions newsgroup


I have a toshiba laptop...1.2gig. has like 10 bad cluster. Do I have to say goodbye to this one, and buy a new one If not--- what software or downloadable app can I get to get it fix.... I would very much appreciate your help.

Thank you, Ron Bautista

(!)I thought I answered this awhile ago. But I don't find it in my archives and I do find it in my inbox. So,
You usually can't "fix" bad clusters --- though you can instruct your OS to "map them out" (refuse to use them). There used to be a software package for MS-DOS called Spinrite (Gibson Software?) which would do surface analysis of many types of drives and might be able to restore bad clusters to use (although it was never recommended).
There used to also be procedures for many ST-506 (MFM and RLL) hard drives and some SCSI drives which would allow the user to do a "low level format" of the drive. However with modern IDE and SCSI drives this option is generally unavailable --- some drives will let you sent the low-level format command to them, and their electronics will blithely ignore your command and send a "success" signal back (I've even heard that some will use a suitable delay factor).
The point is that modern drives are much more sophisticated than the old ST-506 drives. Their electronics usually already manage a number of extra blocks per track (cylinder) and automatically map the extra blocks into use. Thus you usually don't see any bad blocks on a modern drive until you have enough errors on some of the tracks that the are no extras for them.
Thus, when you see "10" back blocks on a drive, it might be that there are many more that have been automatically mapped out by the drives electronics (and are thus not visible to the OS, even at the device driver layer).
For using such a drive with Linux you simply use the -c option to 'mke2fs' when you make (format) new filesystems. This will call the 'badblocks' program and make the appropriate adjustments to the filesystems tables. I think these adjustments amount to permanently marking those blocks as unavailable by adding them to a special 'inode' that's maintained by the fs --- they'll never appear in the free list.
To add more/new bad blocks you can use the -c option to e2fsck. You can also run 'badblocks' by hand, save it's output/report to a file, and use that as input to e2fsk's -l switch.
That's about all there is to say about bad blocks under Linux.
Obviously you want to maintain good backup procedures --- and knowing that you have bad blocks on this drive may encourage you to be extra careful about your data on that system.

Copyright © 1998, James T. Dennis
Published in Linux Gazette Issue 31 August 1998

[ Answer Guy Index ] backup uidgid connect 95slow badblock trident sound
kernel solprint idescsi distrib modem NDS rpm
guy maildns memleak multihead cdr

[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]