Subject: Re: IDE Support & How to find the base address ?
To: Frederick Bruckman <fredb@fb.sa.enteract.com>
From: Dave Huang <khym@bga.com>
List: port-mac68k
Date: 04/09/1998 13:40:59
On Thu, 9 Apr 1998, Frederick Bruckman wrote:
> Viewing the mode pages with FWB's SCSI config, it looked like this drive
> is moderately unusual in that it had reserved one bad block per CYLINDER,
> vs. the more conventional one or two per SECTOR. Mkfs doesn't permit this
> option, but newfs does (-x1). It works. I've been running from this drive
> for about a week now.  newfs complains, however: 

One or two bad blocks reserved per SECTOR?? Wouldn't that be reserving
1/2 or 2/3rds of the drive for bad blocks? The drives I've seen reserve
one or two sectors per cylinder for spares, and maybe have a couple of
spare tracks. newfs' -x option tells it to spare that many sectors per
cylinder, not per sector... so -x1 spares one sector/cyl, not one
sector/sector. So what happened when you didn't use -x1? I'm sure -x1
works fine, but you're losing a bit of disk space... (probably only a
few hundred K, so it's no big deal)

> newfs: Warning: calculated sectors per cylinder (555) disagrees with disk
> label (556)
> 
> Warning: 365 sector(s) in last cylinder unallocated
> /dev/rsd0a:     1957120 sectors in 3527 cylinders of 4 tracks, 139 sectors
>         955.6MB in 221 cyl groups (16 c/g, 4.34MB/g, 1088 i/g)
> [etc.]

I'm not sure if I've seen that first message before, but the second one
(365 sectors ...) seems very common. I don't know that anything can be
done about it. I think it's just that ffs was designed back when drives
had a fixed numbers of sectors/track, so the total disk capacity was
(# of sectors/track) * (# of tracks/cylinder) * (# of cylinders).
Nowadays, drives have more sectors on the outer tracks than on the inner
tracks, so the number of sectors/track reported is just sortof an
average so that (# of sectors) * (# of tracks) * (# of cylinders) is
close to the size of the disk, but not exactly the same. BTW, if you
really really want to know, you can get the actual number of
sectors/track by looking at mode page 12, the notch page. It'll tell you
that the drive has n0 sectors from cylinder s0 to e0, n1 sectors from
cylinder s1 to e1, etc...

> What I don't understand, is how newfs can correctly skip over the bad
> blocks without knowing where the cylinders end. Here's part of the
> disklabel from the same drive: 

Just let the drive handle the bad block remapping, instead of newfs... 
again, you're seeing old historical stuff, from when disk drives didn't
automatically handle bad blocks :) SCSI drives keep an internal table
of bad blocks (there's the P-list, the primary defect list, and the
G-list, the grown defect list).

Anyways, I always do a plain "newfs /dev/whatever", and it's been
working fine for me. Did it just yesterday, 'cuz I got a replacement
for my NetBSD drive that died. Restored the system from tape and it's
happy again :)
-- 
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG