Compaq Tru64 UNIX: Preparing Hard Disks and partitioning

disklabel Command

The command disklabel displays the start/stop cylinder, the size of the partition, the label
and the disk type of a disk device.
As user root, enter the command:
disklabel -r /dev/<rawdisk device>
disklabel -r /dev/rrz3c

Compaq Tru64 UNIX does not allow block 0 to block 15 on the disk to be part of the raw device used by the database system. When the machine is rebooted, the operating system writes a label here. Consequently, data from the database is overwritten and a restore of the database becomes necessary. If you use a RAID System or Advanced File System (advfs) then the device driver will take care of this restriction. Otherwise, when you initially setup a raw device, the standard ‘c’ partition (/dev/rrz?c) may not be used since it normally includes track zero on the disk. A disk that is intended for use as a raw device, must be reformatted appropriately to ensure that the raw device begins at track two. Check your disk configuration as soon as possible to make sure that your raw devices meet the above requirements. To do this:
a. Log on as user root and change to the directory
/<db-system>/<SAPSID>/sapdata
b. List the links to the raw devices with the command:
ls -lR
c. Display all partitions on the disks with the command:
disklabel -r /dev/<raw_device>


lR produces the output
lrwxrwxrwx 1 root 18 Nov 29 data3 -> /dev/rrz3h
then the partition h of this disk is used as a raw device.
Always use partition c of the raw device in the disklabel command to
display the content of the entire disk.
The output of disklabel -r /dev/rrz3c looks similar to:
# /dev/rrz3c:
type: SCSI
disk: rz26
label:
flags:
bytes/sector: 512
sectors/track: 57
tracks/cylinder: 14
sectors/cylinder: 798
cylinders: 2570
sectors/unit: 2050860
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0

8 partitions:
# size offset fstype [fsize bsize cpg]
a: 131072 0 unused 1024 8192 # (Cyl. 0 – 164*)
b: 262144 131072 unused 1024 8192 # (Cyl. 164*- 492*)
c: 2050860 0 unused 1024 8192 # (Cyl. 0 – 2569)
d: 552548 393216 unused 1024 8192 # (Cyl. 492*-1185*)
e: 552548 945764 unused 1024 8192 # (Cyl. 1185*-1877*)
f: 552548 1498312 unused 1024 8192 # (Cyl. 1877*-2569*)
g: 1657644 393216 4.2BSD 1024 8192 16 # (Cyl. 492*-2569*)
h: 838444 1212416 unused 1024 8192 # (Cyl. 1519*-2569*)

Since partition a contains track zero, it is necessary to choose an other partition as raw device. To edit and change this output for (re-)partitioning the disk, it should be directed in a file using the command:
disklabel -r /dev/rrz3c > <tmp_file>


Partitioning Disks

1. Edit the output file <tmp_file> you generated in the previous step and change the
boldface lines accordingly:
# /dev/rrz3c:
type: SCSI
disk: rz26
label:
flags:
bytes/sector: 512
sectors/track: 57
tracks/cylinder: 14
sectors/cylinder: 798
cylinders: 2570
sectors/unit: 2050860
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg]
a: ….16 0 unused 1024 8192 16 # (Cyl. 0 – 164*)
b: 262144 131072 unused 1024 8192 # (Cyl. 164*- 492*)
c: 2050860 0 unused 1024 8192 # (Cyl. 0 – 2569)
d: 552548 393216 unused 1024 8192 # (Cyl. 492*- 1185*)
e: 552548 945764 unused 1024 8192 # (Cyl. 1185*- 1877*)
f: 552548 1498312 unused 1024 8192 # (Cyl. 1877*- 2569*)
g: 1657644 393216 4.2BSD 1024 8192 16 # (Cyl. 492*- 2569*)
h: 131056 16 unused 1024 8192 16 # (Cyl. 1519*- 2569*)

• Only partitions a and h were modified !
• Never change partition c because it always represents the entire disk.
• Partition a should always span block 0 and block 1.
• Partitions a and c are the only ones containing track zero.
• After activating this partition all partitions but a and c can be used as rawdevices.


2. Activate the disk using the command:
disklabel -R -r <raw_device> <tmp_file> <disktype>
where <disktype> is the value of disk: in the above <tmp_file>.
disklabel -R -r /dev/rrz3c <tmp_file> rz26
Always use partition c of the raw device in the above command.

Leave a Comment

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top