Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!poisson.usc.edu!mlinar From: mlinar@poisson.usc.edu (Mitch Mlinar) Newsgroups: comp.os.minix Subject: Re: bad blocks on hard disk Message-ID: <4337@oberon.USC.EDU> Date: Sat, 5-Sep-87 17:43:22 EDT Article-I.D.: oberon.4337 Posted: Sat Sep 5 17:43:22 1987 Date-Received: Sun, 6-Sep-87 08:00:45 EDT References: <196@turbo.RAY.COM> <489@ast.cs.vu.nl> <297@mks.UUCP> Sender: nobody@oberon.USC.EDU Reply-To: mlinar@poisson.usc.edu (Mitch Mlinar) Organization: University of Southern California, Los Angeles, CA Lines: 45 In article <297@mks.UUCP> wheels@mks.UUCP (Gerry Wheeler) writes: >In article <489@ast.cs.vu.nl>, ast@cs.vu.nl (Andy Tanenbaum) writes: >> I believe that the DOS approach to bad tracks is to keep the last couple >> of tracks in reserve, and to have a map that tells which of the regular >> tracks are bad. It then subsitutes the reserve tracks (or maybe just >> sectors, I am not sure) for the bad ones. >> >> Andy Tanenbaum (ast@cs.vu.nl) > >I am NOT a DOS expert, but I do seem to recall reading this somewhere. >I think DOS simply writes a magic number in the FAT entry corresponding >to the bad sector so it will never be used. I don't think any replacement >sectors are allocated anywhere. This would explain how chkdsk can report >the number of bad sectors. > As a matter of fact, the FAT table is the only way that DOS knows about bad sectors. A normal FAT entry can be 000 (12-bit number, 3-digit hex number) for an unallocated block, 002 to FEF for normal blocks (000 and 001 are reserved for the FAT and some directory tables). FAT entries between FF0 and FF7 are reserved and FF8 through FFF indicate that this is the last block of the file. IBM designated the reserved FAT entry FF7 to signify a bad block. Of course, the hard disk controller can do its own "remapping", but this is only efficient for VERY fast hard drives as there is additional seek time as well as loss of some of the hard drive space. (Typically, only 1 or 2 sectors are bad on a 17 512-byte sector track. Why give up all the remaining usable space while having tracks in "reserve" that could ALSO be used to hold data. The only rebuttal to this argument is if the bad sector occurs BEFORE block # 2 (boot tracks, directory, FAT tables). Then, having a remap to a higher track may be useful. However, if the hard drive is "virgin" and has bad data in this area, you should return it. Otherwise, SOME systems allow one to change the track offset to "bypass" the offending track - by offsetting the entire system - which is better than losing a whole hard drive, but worse than a bad block map). As a last note, the current trend for controllers is to write the disk information onto cyl 0, head 0, sector 0 (or 1) of the hard drive (reserved for the controller itself). If this track cannot be formatted, get a new hard drive as there is no "remapping" that is done and the controller cannot save any information. -Mitch