Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!botter!star!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Re: bad blocks on hard disk Message-ID: <489@ast.cs.vu.nl> Date: Thu, 3-Sep-87 05:07:02 EDT Article-I.D.: ast.489 Posted: Thu Sep 3 05:07:02 1987 Date-Received: Sat, 5-Sep-87 10:19:54 EDT References: <196@turbo.RAY.COM> Reply-To: ast@cs.vu.nl () Organization: VU Informatica, Amsterdam Lines: 31 In article <196@turbo.RAY.COM> jim@turbo.RAY.COM (Jim Shaw x8232) writes: >... I have a couple of known bad tracks ... 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. I haven't done anything in this area, but I agree it is important. If someone who knows how DOS does it could modify the 1.2 xt_wini.c and 1.2 at_wini.c to handle bad tracks the DOS way (for compatibility) that would no doubt be useful to many people. Probably what you have to do is read in the bad track table at the same time the partition table is read in, and make a mapping between "virtual" tracks and "real tracks". If DOS does it by sector rather than track, it becomes more complicated, because keeping a map of 20,000 of more sectors is expensive. Even a bit map would be expensive. What might be reasonable is to keep a bit map per track, with the bit 0 if the cylinder is perfect, and 1 if there are 1 or more bad sectors. Whenever a disk access happens, the driver could check the map, and if the cylinder was perfect, just go ahead. If it was bad, it would have to search an explicit list of bad sectors. This would only require about 300 bytes for the map for a 20 MB drive, and would not require much look up time in 99% of the cases (assuming 99% of the tracks were ok). Volunteers with rotten disks and knowledge of how DOS works are definitely welcome here. Andy Tanenbaum (ast@cs.vu.nl)