Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!tgr!hahn@AMES-NAS.ARPA From: hahn@AMES-NAS.ARPA (Jonathan Hahn) Newsgroups: net.unix-wizards Subject: Re: disk-block integrity after system crashes Message-ID: <11543@brl-tgr.ARPA> Date: Fri, 12-Jul-85 19:53:35 EDT Article-I.D.: brl-tgr.11543 Posted: Fri Jul 12 19:53:35 1985 Date-Received: Sat, 13-Jul-85 15:23:10 EDT Sender: news@brl-tgr.ARPA Lines: 39 > Suppose a write operation is initiated (i.e., the controller > begins processing the write request) and a system crash > occurs. > > 1) Will the write finish? It seems that it shouldn't, since > RAM will probably get flakey as power drops, and then > a block of garbage will get written to disk. There is a significant difference between a "system crash" (i.e. software crash) and an unexpected power failure (or other hardware catastrophe)... > 2) If the write doesn't finish, will the block be detectably > bad? For example, would the block's CRC be wrong, causing > the controller to return an error on subsequent reads. In the event of a software crash, the disk sector(s) should be written properly (i.e. data and ecc written out in proper format). Of course, there's no telling how corrupted the data may have gotten as a result of the crash. The best protection against this is one or more internal consistency checks of some sort. In the event of a hardware failure such as a power failure during a write, I think it's pretty much undefined and depends a lot on the hardware in question and timing particulars of the incident. A formatted sector is made up of read-only, writable, and gap regions. If the power went out while the disk head was over the read-only or gap regions, the write would probably terminate successfully. If the power went out during the writable region, you would probably end up with a bad sector that returned hard ECC errors when read. I believe that most controllers are wired such that if they loose power, all disk operations are immediately disabled since the disks may still be powered. You should check the technical manuals for your controller and disk drive. -jonathan hahn