Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!ncar!ico!ism780c!darryl From: darryl@ism780c.isc.com (Darryl Richman) Newsgroups: comp.unix.i386 Subject: Re: adding bad blocks using 386/ix Message-ID: <39560@ism780c.isc.com> Date: 5 Mar 90 22:03:20 GMT References: <511211@nstar.UUCP> Reply-To: darryl@ism780c.UUCP (Darryl Richman) Organization: Interactive Systems Corp., Santa Monica CA Lines: 44 There seems to be much confusion as to how mkpart, /etc/partitions, and bad block handling occur on 386/ix. There is nothing magical about it and the whole system is rather manual in nature, so that nothing really happens unless the user drives it. When the disk driver first opens a disk, it reads in the pdinfo, vtoc, and if indicated by the alts_ptr field, an alternates table. The alternates indicated are then maintained in an incore table by the driver, until either a last close occurs or a V_REMOUNT ioctl is successful. (V_REMOUNT can only be successful if no other partitions on the disk are open.) So in general, remaps do not occur right away, but rather after the next reboot. The contents of /etc/partitions are never used except by mkpart. Mkpart strictly manipulates the on-disk structures such as the pdinfo, vtoc, and alternates. It does attempt to perform a V_REMOUNT afterwards, but this will fail on a normally running system. (If this were not prevented, imagine what would happen to anything using the disk if things like the vtoc were to change at a random point: partitions might change size or location, or even disappear.) By running mkpart -A, you update the on-disk structure. When you next perform a first open (e.g., reboot), these bad sectors are then remapped. This is a better approach than automatically remapping because that prevents the user from attempting to reread the bad sector and possibly retrieving the data. AT&T had originally expected to use the V_ADDBAD ioctl to update the driver's list of bad blocks in memory, but the V.3.2.0 version, on which 386/ix 2.0.2 is based, did not include this functionality. (I believe that they have added it in a later release.) The upcoming 2.2 release of 386/ix will have the V_ADDBAD capability as well as a new alternate sectoring scheme that does not rely on fixed table sizes (that have proven to be too small). --Darryl Richman -- Copyright (c) 1990 Darryl Richman The views expressed are the author's alone darryl@ism780c.isc.com INTERACTIVE Systems Corp.-A Kodak Company "For every problem, there is a solution that is simple, elegant, and wrong." -- H. L. Mencken