How to Create a Disktab Entry
We will demonstrate on the IBM IDE hard drive IBM-DTLA-305020 how to construct a disktab entry.
Our goal: create one NeXTSTEP partition with 8GB at the beginning of the drive.
We connect the disk, enter the BIOS and run auto detect. We select LBA mode (important!).
We connect the disk as slave and boot from the master into OpenStep.
We use fdisk to create a partition on the disk:
fdisk /dev/rhd1h -useAllSectors
create a partition of size 8055 and type NeXT
disk -q -s /dev/rhd1a
to dump the current disk parameters.
pet:8# disk -q -s /dev/rhd1h
NEXTSTEP partition base = 63 NEXTSTEP partition size = 16498692
IBM-DTLA-305020
Dies liefert den Namen für den disktab entry: IBM-DTLA-305020
Aus /etc/disktab:
# Disk geometry and partition layout tables.
# Key:
# | ty | type of disk |
# | ns | #sectors/track -- DEV_BSIZE sectors |
# | nt | #tracks/cylinder |
# | nc | #cylinders/disk |
# | rm | rpm, 3600 default |
# | ss | sector size -- MUST ALWAYS BE DEV_BSIZE (1024) FOR NOW |
# | fp | # DEV_BSIZE blocks in front porch |
# | bp | # DEV_BSIZE blocks in back porch |
# | ng | #alternate groups |
# | gs | #sectors per alt group |
# | ga | #alt sectors per group |
# | ao | sector offset to alternates in group |
# | os | name of boot file |
# | z[0-1] | location of "block 0" boot code in DEV_BSIZE blocks |
# | hn | hostname |
# | ro | read only root partition (e.g. 'a') |
# | rw | read/write partition (e.g. 'b') |
# | p[a-h] | partition base in DEV_BSIZE blocks |
# | s[a-h] | partition sizes in DEV_BSIZE blocks |
# | b[a-h] | partition block sizes in bytes |
# | f[a-h] | partition fragment sizes in bytes |
# | c[a-h] | partition cylinders-per-group |
# | d[a-h] | partition density (bytes-per-inode) |
# | r[a-h] | partition minfree |
# | o[a-h] | partition optimization ("space" or "time") |
# | i[a-h] | partition newfs during init |
# | m[a-h] | partition mount point name |
# | a[a-h] | partition auto-mount on insert |
# | t[a-h] | partition file system type ("4.3BSD", "sound" etc.) |
# |
# Entries may also be used for other compatible drives
# with the same geometry.
#
# [Note that sum of partition sizes plus the SCSI front porch must
# be <= total usable sectors; e.g., (2*4194304)+78271+320=8467199]
Wie geht das nun:
den Namen habe ich ja schon mit dem disk-Kommando bestimmt
ty=fixed_rw_ide: | keine andere Wahl |
ns#63: | Zahl der Sektoren. Das steht im BIOS. |
nt#16: | Das ist eigentlich die Zahl der Köpfe und sollte 255 sein, aber im Endeffekt ist nur ausschlaggebend, was in der Zeile device: 8064 Megabytes, 16514064 sectors an Sektoren steht. |
nc#16383: | Zahl der Zylinder. nc*ns*nt=Zahl der Sektoren. |
rm#5400: | Rotationsgeschwindigkeit. Egal. |
ss#512: | Muß wohl auf 512 stehen (für IDE). |
fp#320: | front_porch, soll 320 sein |
bp#0: | |
ng#0: | |
gs#0: | |
ga#0: | |
ao#0: | |
os=mach_kernel: | sdmach für SCSI disks, mach_kernel für IDE disks |
z0#127: | auf welchen Sektor der boot block #0 kommt aus dem disk Kommando folgt: NEXTSTEP partition base = 63, also hier 63+64=127 |
z1#255: | 128 mehr als z0 |
hn=pet: | hostname |
ro=a: | root partition |
rw=b: | read/write partition |
pa#63: | Beginn der ersten Partition = NEXTSTEP partition base = 63 |
sa#8249186: | Länge, hier genau die Hälfte der fdisk-Partition, minus die front porch von 320 16498372/2 = 8249186 |
ba#8192: | |
fa#1024: | |
ca#16: | |
da#4096: | |
ra#2: | |
oa=time: | Zeitoptimierung, da wir genug Platz haben |
ia: | |
ma=ibm1: | Mount-Name, falls nicht überschrieben in /etc/fstab |
ta=4.3BSD: | |
pb#8249249: | Beginn der 2. Partition (wie Ende der 1. Part.): 8249186+63 = 8249249 |
sb#8248866: | Länge, hier der Rest der Platte: 16498372-8249186-320 = 8248866 |
bb#8192: | |
fb#1024: | |
cb#16: | |
db#4096: | |
rb#2: | |
ob=time: | |
ib: | |
mb=ibm2: | |
tb=4.3BSD: |
# the next is the 20.4GB IBM drive:
IBM-DTLA-305020|ibm:\
:ty=fixed_rw_ide:ns#63:nt#16:nc#16383:rm#5400:ss#512:\
:fp#320:bp#0:ng#0:gs#0:ga#0:ao#0:\
:os=mach_kernel:z0#64:z1#192:hn=pet:ro=a:\
:pa#0:sa#8257032:ba#8192:fa#1024:ca#16:da#4096:ra#2:oa=time:ia:ma=ibm1:ta=4.3BSD:\
:pb#8257032:sb#8257032:bb#8192:fb#1024:cb#16:db#4096:rb#2:ob=time:ib:mb=ibm2:tb=4.3BSD: