From: tih@barsoom.nhh.no (Tom Ivar Helbekkmo)
Newsgroups: comp.unix.bsd
Subject: Re: disktab
Date: 8 Apr 92 07:11:05 GMT
Article-I.D.: barsoom.tih.702717065
Organization: Norwegian School of Economics

I'm following up on this here instead of replying directly, since
this is a problem lots of people seem to need help with.

Paul Richards writes:

>Does anyone have a disktab entry for a Seagate ST-1144A?

There could be several.  :-) The disk uses "zone bit recording", which
can be a pain.  This means it does not actually have a fixed geometry,
but has more sectors per track on the outer tracks, and lies to the
controller about what it actually has.

As an aside, it does, according to Seagate, have 14336 17-sector
tracks, logically organized as 1001 cylinders of 15 heads.  These
specs don't match, and don't add up to their specified 130.7 Mb
formatted capacity, either.  ZBR is fun!

Anyway, you say that your machine claims there are 1021 cylinders, 7
heads and 35 sectors per track.  If so, use that.  (Especially if you
can verify that the drive works for DOS.)

>I've played around with a few entries but I keep getting errors. The most
>common is bad format in bad144 file or something like that. I also had
>some warnings when I used newfs about unallocated sectors so I think my
>disktab isn't quite right.

OK, you've got two problems.  The first is simply that you haven't set
up your bad sector area correctly, and the second that you don't have
your partition boundaries and cylinder boundaries aligned.

The basic allocation unit to use when partitioning the disk is the
cylinder.  With your logical geometry, the cylinder holds 7*35=245
sectors.  Thus, you'll want to make every partition be a multiple of
245 sectors.  The 'c' partition has to be the whole disk, or
7*35*1021=250145 sectors.

Then, you have to allocate your partitions so that at least one track
plus 126 sectors at the end of the 'c' partition are not used by any
other partition.  This space is for the bad144 bad sector table.  In
your case, 1 cylinder will be enough for this.  Say that you want to
have a 6Mb root, a 32Mb swap, and the rest (approx 84Mb) for the usr
partition.  We then get:

Partition a:   6Mb / 122.5 Kb per cylinder =     50 cylinders
Partition b:  32Mb / 122.5 Kb per cylinder =    267 cylinders
Partition h:  1021 - 1 - 50 - 267 =             703 cylinders

However, even though cylinder boundaries are fine for the file system,
multiples of 16 cylinders is what it loves the best.  So, if I can,
I like to let it have that in the partitions that I want to make
file systems on.  This translates into:

Partition a:    48 cylinders * 245 sectors =  11760 sectors
Partition b:   268 cylinders * 245 sectors =  65560 sectors
Partition c:  1021 cylinders * 245 sectors = 250145 sectors
Partition h:   704 cylinders * 245 sectors = 172480 sectors

Note that I use the 'h' partition for /usr.  There is a bug in the
disklabel program that makes it write an incomplete partition table if
you don't define 'h'.  I would use the following for a disktab:

st1144a|Seagate 122Mb IDE:\
        :dt=ST506:ty=winchester:se#512:nt#7:ns#35:nc#1021:sf:\
        :pa#11760:oa#0:ta=4.2BSD:ba#4096:fa#512:\
        :pb#65560:ob#11760tb=swap:\
        :pc#250145:oc#0:\
        :ph#172480:oh#77320:th=4.2BSD:bh#4096:fh#512:

Now, with the partition table set up correctly, you use disklabel to
set the stuff up on the disk, and then *immediately* use bad144 to
initialize the bad sector table to "no bad sectors present":

# disklabel -r -w wd0 st1144a jolix
# bad144 wd0 -f

Note that the '-f' goes behind the disk name, not in front of it.  The
documentation (or the program) is wrong here.  Oh, and the "jolix"
parameter is just the label (or name) you want to give to this
particular disk...  :-)

Then reboot, and proceed to newfs your wd0a and wd0h partitions.  You
should see none of the error messages you mention.  Before using newfs,
you might want to check the partition table and bad144 table, though:

# disklabel -r wd0
# bad144 wd0

Output should look reasonable, with no error messages.  Ignore any
"wd0: extra interrupt" messages, as they just seem to happen a bit
during this phase...  :-)

Good luck!  Write if I can be of more help!

-tih
--
Tom Ivar Helbekkmo, NHH, Bergen, Norway.  Telephone: +47-5-959205
Postmaster for domain nhh.no.   Internet mail: tih@barsoom.nhh.no