Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdahl!ems!quest!zeno!gene From: gene@zeno.MN.ORG (Gene H. Olson) Newsgroups: comp.sys.att Subject: Re: hard disk problems Message-ID: <19@zeno.MN.ORG> Date: 11 Aug 88 15:25:20 GMT References: <15324@apple.Apple.COM> Reply-To: gene@zeno.UUCP (Gene H. Olson) Organization: Smartware Consulting, Minneapolis, MN Lines: 72 In article <15324@apple.Apple.COM> comdesign!ivucsb!todd@pyramid.com writes: >Recently, I've been getting the following in my /usr/adm/unix.log: > >HDERR ST:51 EF:10 CL:FF80 CH:FF01 SN:FF00 SC:FF02 SDH:FF25 DMACNT:FFFF DCRREG:95 MCRREG:9100 Tue Aug 2 02:00:38 1988 > >drv:0 part:2 blk:19552 rpts:1 Tue Aug 2 02:00:39 1988 > >HDERR ST:51 EF:10 CL:FF80 CH:FF01 SN:FF00 SC:FF02 SDH:FF25 DMACNT:FFFF DCRREG:95 MCRREG:9B00 Tue Aug 9 02:01:22 1988 > >drv:0 part:2 blk:19552 rpts:1 Tue Aug 9 02:01:22 1988 You have `bad block' there. For some reason the diagnostics do not find all of them. On my system I had two of them that I had to fix using the technique below: 1) Shut down your system. (init s) and boot up the diagnostic. 2) When the diagnostic menu comes up, type `s4test'. The system will respond `expert>'. Then type `6,12'. The system will respond giving you the sizes of partitions 0, 1, 2. On my system (multiuser option) these sizes are 64, 5000, rest-of-disk. Also note the number of heads on your disk; mine has 8. Now type `U' to return to the regular menu. 3) Computation time. The messages in unix.log reference the same block, and if you are smart, you will check it both ways to make sure you have selected the right block before attempting to spare it. First look at the Hex messages above: CL: FF80 CH: FF01 SN: FF00 SDH: FF25 In all these numbers, only the lower byte is significant. CL is cyclinder low (80 hex = 128 decimal) and CH is cylinder high (01 hex = 1 decimal). That makes the cyclinder number 256*1 + 128 = 384. SDH gives the head (only lower nibble = 5 decimal). The sector number (SN = 0). I find it works best to spare blocks using the partition 0 block offset. On standard ST506 drives (UNIX-PC) there are 17 sectors per block. Each sector is 512 bytes. 16 Sectors are used to be 8 1K blocks in the filesystem. The 17th block is reserved to spare out bad blocks. (A nice arrangement since it usually avoids a seek when accessing bad blocks). So there are 8 blocks per track (this is a magic clue!). Now we can figure out the partition 0 block number as follows: CH * 256 * (# heads = 8) * (# blocks/track = 8) = 16384 CL * 1 * (# heads = 8) * (# blocks/track = 8) = 8192 SDH * (# blocks/track = 8) = 40 SN / (# sectors/block = 2) = 0 ---------------------------------------------------------- Partition 0 block number = 24616 This is the block you want to spare out. You should get the same answer using: Size of partition 0 (first cylinder) = 64 Size of partition 1 (swap area) = 5000 Reported (partition #2) block number = 19552 ----------------------------------------------- Partition 0 block number = 24616 4) Select the menu item that spares bad blocks. You will be allowed spare out blocks 3 ways, by sector, by bit on track, and by block. Select the `block' option. Spare block #24616. You can spare just the first, or both the first and second sectors in that block. You might as well spare both of them. Gene H. Olson amdahl!bungia!gene