Subject: disklabel -rw doesn't generate the SGI VH label
To: None <port-sgimips@netbsd.org>
From: sgimips NetBSD list <sgimips@mrynet.com>
List: port-sgimips
Date: 11/12/2001 08:47:39
Hi,
I've been noticing that "disklabel -rw" does not create the
SGI VH label, whereas "disklabel -w" does.  

Is this an error or a feature?

For my work on the sysinst, ramdisk, miniroot, bootable CD, etc,
for the sgimips platform, I've been relying on disklabel's
apparent functionality of generating the SGI vh label record,
however when the "-r" flag is utilised, it is apparently not
generating it.  This seems inconsistant with the "-r" intent.

The example below is operating upon a vnd device, but the results
are the same for real disk devices. 

NetBSD sources were cvs'd and built on 2001/11/11.

Example: (Note: This is a modified sgivol program I've modified
          quite a bit.  The distributed sgivol program results
          are the same.)

mod80# disklabel -rw -f /usr/src/distrib/sgimips/ramdisk/disktab.ramdisk vnd0 install-ramdisk
mod80# /usr/mdec/sgivol -wf boot /usr/mdec/boot vnd0
No SGI volume header found, magic=0.
mod80#  disklabel vnd0
# /dev/rvnd0c:
type: unknown
disk: install-ramdisk
label: 
flags:
bytes/sector: 512
sectors/track: 16
tracks/cylinder: 3
sectors/cylinder: 48
cylinders: 128
total sectors: 6144
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

3 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:      6144         0     4.2BSD                      # (Cyl.    0 - 127)
 c:      6144         0     unused      0     0         # (Cyl.    0 - 127)
mod80#  disklabel -r vnd0
# /dev/rvnd0c:
type: unknown
disk: install-ramdisk
label: 
flags:
bytes/sector: 512
sectors/track: 16
tracks/cylinder: 3
sectors/cylinder: 48
cylinders: 128
total sectors: 6144
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

3 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:      6144         0     4.2BSD                      # (Cyl.    0 - 127)
 c:      6144         0     unused      0     0         # (Cyl.    0 - 127)
mod80# disklabel -w -f /usr/src/distrib/sgimips/ramdisk/disktab.ramdisk vnd0 install-ramdisk
mod80# /usr/mdec/sgivol -wf boot /usr/mdec/boot vnd0
Writing file /usr/mdec/boot
File /usr/mdec/boot has 268126 bytes
disklabel shows 6144 sectors
checksum: 00000000
root part: 0
swap part: 1
bootfile: 

Volume header files:
boot     offset    2 blocks, length   268126 bytes (524 blocks)

SGI partitions:
 0:a blocks     6144 first        0 type  4 (BSD4.2)
 8:i blocks       16 first        0 type  0 (Volume Header)
10:k blocks     6144 first        0 type  6 (Volume)
mod80#