disk-block integrity after system crashes

Jonathan Hahn hahn at AMES-NAS.ARPA
Sat Jul 13 09:53:35 AEST 1985


> 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



More information about the Comp.unix.wizards mailing list