3 MDL DSD Disk Sub-Divider Driver Documentation Revision 7 March 1996 MDL Corporation 14940 NE 95th Street Redmond, WA 98052 Voice (800) 800-3766 (206) 861-6700 FAX (206) 861-6767 www http://www.mdlcorp.com/mdlcorp/welcome.html TECHNICAL SUPPORT: MDL Corporation 14940 NE 95th Street Redmond, WA 98052 Voice (206) 861-6700 (800) 800-3766 FAX (206) 861-6767 E-mail custsvc@mdlcorp.com COPYRIGHT NOTICE Copyright © 1996. This document contains information proprietary to MDL Corporation. This document and the information contained within is copyright by MDL Corporation and may not be duplicated in full or in part by any person without prior approval of MDL Corporation. While every effort has been made to keep the information contained within current and accurate as of the date of publication, no guarantee is given or implied that the document is free of errors or that it is accurate with regard to any specification. MDL Corporation reserves the right to make changes for the purposes of product improvement, at any time. TRADEMARKS DSD is a trademark of MDL Corporation. HP, HP/Apollo, and 9000 Series 700 are trademarks of the Hewlett-Packard Company. All other trademarks are owned by their respective companies. Suggestions for improvement to this document are requested and may be forwarded to MDL Corporation, to the attention of Customer Service at the address above. Table of Contents Table of Contents ii Chapter 1 Introduction 1 1.1 General Description 1 1.2 Features 1 Chapter 2 Installation Under HP-UX 9.X 2 2.1 Installation Checklist 2 2.2 Getting the Authorization 2 2.3 Copying the Software 3 2.4 Installing the Software 3 2.5 Removing the Software 4 2.6 Updating /etc/master and /etc/newconfig/master4 Table 2.6.1 Values for /etc/master 4 2.7 Updating /etc/conf/dfile 4 2.8 Reconfiguring the kernel 4 2.9 Updating /etc/bcheckrc 5 Chapter 3 Installation Under HP-UX 10.X 6 3.1 Installation Checklist 6 3.2 Getting the Authorization 6 3.3 Copying the Software 7 3.4 Installing the Software 7 3.5 Removing the Software 8 3.6 Updating /usr/conf/master.d/core-hpux 8 Table 3.6.1 Values for /usr/conf/master.d/core-hpux8 3.7 Updating /stand/system 8 3.8 Reconfiguring the kernel 8 3.9 Updating /etc/bcheckrc 9 3.10 Making the Device Files 9 Table 3.10.1 SCSI Bus Numbers 10 3.11 Reboot the System 12 Chapter 4 Generating the Partitions 13 Chapter 5 Using DSD 17 5.1 General Description 17 5.2 Examples 17 5.3 Installing HP-UX 9.X File Systems In Partitions (mkfs) 17 Table 5.3.1 mkfs Default Parameters 18 5.4 Installing HP -UX File Systems In Partitions (newfs) 19 5.4.1 Disk Name 19 5.4.2 s0 19 5.4.3 ns and nt 19 5.4.4 nc 20 5.4.5 b0 20 5.4.6 f0 20 5.4.7 rm 20 5.4.8 se 20 5.4.9 Completed Disktab Entry 20 5.4.10 Running /etc/newfs under HP-UX 9.X 20 5.4.11 Running /etc/newfs under HP-UX 10.X 21 5.5 scsi_info 21 5.5.1 scsi_info under HP-UX 9.X 21 5.5.2 scsi_info under HP-UX 10.X 24 5.5 dsd_format 27 5.6 Known Limitations 28 5.8 Changing the Disk Device Size 28 Chapter 6 When All Else Fails 29 Chapter 1 Introduction 1.1 General Description The MDL DSD product consists of a software driver and a partitioning program needed to use the driver on the HP9000 model 700. A couple of other utility programs are included to assist with various system administration functions. 1.2 Features The DSD driver allows one or more SCSI disk drives to be partitioned into as many as 16 segments. Each segment or partition can be defined to be as small as a single disk block, or as large as the entire capacity of that disk drive. Each partition is accessed by its own pair of character and block device files, and may be treated as individual logical disk drives. Standard disk utilities, such as newfs, mkfs, fsck, mount, etc., are used to initialize and administer each segment. A special utility program has been provided to format a drive accessed with the DSD driver. While it is possible to generate partition tables for each disk manually, a partitioning program is provided to simplify this task. This program may also be used to display the current partitioning information for each disk drive. Chapter 2 Installation Under HP-UX 9.X 2.1 Installation Checklist The major steps involved in the installation are: _____ Get the authorization string for the driver. _____ Copy the software from tape to disk. _____ Install the software. _____ Update /etc/master and /etc/newconfig/master to include the dsd driver. _____ Update /etc/conf/dfile to include the dsd driver. _____ Rebuild the kernel. _____ Make the /dev/dsd_info device file. _____ Update the /etc/bcheckrc file. _____ Reboot the system. _____ Generate the partitions. Each of these steps is described at length in the sections below. 2.2 Getting the Authorization The first step in the installation process is to get an authorization code for the software. Collect the following information before calling for the code. On the system that will contain the dsd driver, execute: uname -i Record this number. After you have this information, call MDL Corporation customer service at (800) 800-3766 or (206) 861-6700, or send email to custsvc@mdlcorp.com. After you get the authorization string, you must log in as root to continue with the installation. 2.3 Copying the Software The next step is to copy the software from tape to the disk. The tape is a tar format tape. To copy the software from tape, follow these steps: Create a directory to contain the software being installed. For example, type: mkdir /tmp/dsd Change directory to the directory that you just created. For example, type: cd /tmp/dsd Copy the driver software from the tape. The exact text of the command depends on the SCSI address of the tape drive and upon the model of the tape drive. If using a DAT tape, and the DAT tape drive is at address 1, the command to extract the information from the tape is: tar -xvf /dev/rmt/c201d1l This command will copy the software into the current directory. If you are using the old style of device files, the command will look like: tar -xvf /dev/rmt/1l The device specified by this command is the low density, raw, magnetic tape at address 1. 2.4 Installing the Software After the software is copied to the system, it needs to be installed. To copy the software to the appropriate places on the system, execute: ./install The install script will copy the driver code into the appropriate places. Modify the file called /etc/mdl_dsd_licenses that will contain both the license string and partitioning information. For example, vi /etc/mdl_dsd_licenses :s/LICENSE GOES HERE/AAAAAAAAAAAAAAAAAA/ :wq Please notice that the license string contains 18 characters, and must be the first 18 characters in the file. There must be no other characters on the first line of the file. After this file is edited, continue with the next step of the installation. 2.5 Removing the Software If at some point in the future you wish to remove the software from the system, all you need to do is execute the following. Note that you must be logged on as root and have as your working directory the directory created in section 2.3 : ./uninstall 2.6 Updating /etc/master and /etc/newconfig/master The /etc/master and /etc/newconfig/master files need to be updated to include the information for the MDL dsd driver. The additional information needs to be added to the section for third party drivers. If you have no other third party drivers, add the following line as is: Table 2.6.1 Values for /etc/master name handle type mask block character dsd dsdisk 3 3FB 8 38 If you have other third party drivers, change the number for the block and character so that you are using numbers that are not already in use. Keep track of the numbers that you use in the /etc/master file. You will need to use the same numbers when you create the /dev/dsd_info device file. 2.7 Updating /etc/conf/dfile The dsd driver needs to be included in the kernel. To do this, the dsd driver specification needs to be appended to the dfile. The line that needs to be added is: dsd 2.8 Reconfiguring the kernel After all the above changes are made the kernel needs to be reconfigured. Use the following steps: Make a copy of your current kernel: cp /hp-ux /hp-ux.old Change your directory to /etc/conf: cd /etc/conf Copy the driver code into the library. There are two versions of the driver includes. The version of HP-UX that you are running determines the version of the driver that you need to use. If you are running 9.01 or 9.03, use the dsd.o version of the driver. You would execute the following command: ar -r libusrdrv.a dsd.o Or if you are running HP-UX 9.05, use the dsd_9.05.o version of the driver. You would execute the following command: ar -r libusrdrv.a dsd_9.05.o Run /etc/config with the dfile that was modified above. For example: /etc/config dfile Run make with the make file generated by the preceding call to /etc/config. For example: make -f ./config.mk Assuming the make was successful, replace the current kernel with a copy of the new kernel: cp ./hp-ux /hp-ux 2.9 Updating /etc/bcheckrc Each time the system is booted or the license string has been updated the /etc/mdl_dsdd daemon must be run for the license to take effect. It is recommended that an entry be made in /etc/bcheckrc to execute /etc/mdl_dsdd automatically at boot time. To update the /etc/bcheckrc file, find the section of /etc/bcheckrc that runs /etc/eisa_config. After the final "fi" of the "if" block, add the line: /etc/mdl_dsdd This program loads the license string and partitioning information from the /etc/mdl_dsd_licenses file. Please Note: /etc/mdl_dsdd does not continue to run. It enables the license and terminates. It normally does not appear in the ps -ef. Chapter 3 Installation Under HP-UX 10.X 3.1 Installation Checklist The major steps involved in the installation are: _____ Get the authorization string for the driver. _____ Copy the software from tape to disk. _____ Install the software. _____ Update /usr/conf/master.d/core-hpux to include the dsd driver. _____ Update /stand/system to include the dsd driver. _____ Rebuild the kernel. _____ Make the /dev/dsd_info device file. _____ Update the /etc/bcheckrc file. _____ Reboot the system. _____ Generate the partitions. Each of these steps is described at length in the sections below. 3.2 Getting the Authorization The first step in the installation process is to get an authorization code for the software. Collect the following information before calling for the code. On the system that will contain the dsd driver, execute: uname -i Record this number. After you have this information, call MDL Corporation customer service at (800) 800-3766 or (206) 861-6700, or send email to custsvc@mdlcorp.com. After you get the authorization string, you must log in as root to continue with the installation. 3.3 Copying the Software The next step is to copy the software from tape to the disk. The tape is a tar format tape. To copy the software from tape, follow these steps: Create a directory to contain the software being installed. For example, type: mkdir /tmp/dsd Change directory to the directory that you just created. For example, type: cd /tmp/dsd Copy the driver software from the tape. The exact text of the command depends on how the system identifies the tape drive you are using. If you are using the system’s default tape drive, simply type: tar -xv This command will copy the software into the current directory. If you are using a drive other than the system’s default tape drive, you will have to specify the device filename of the tape drive. For example: tar -xvf /dev/rmt/1m 3.4 Installing the Software After the software is copied to the system, it needs to be installed. To copy the software to the appropriate places on the system, execute: ./install The install script will copy the driver code into the appropriate places. Modify the file called /etc/mdl_dsd_licenses that will contain both the license string and partitioning information. For example, vi /etc/mdl_dsd_licenses :s/LICENSE GOES HERE/AAAAAAAAAAAAAAAAAA/ :wq Please notice that the license string contains 18 characters, and must be the first 18 characters in the file. There must be no other characters on the first line of the file. After this file is edited, continue with the next step of the installation. 3.5 Removing the Software If at some point in the future you wish to remove the software from the system, all you need to do is execute the following. Note that you must be logged on as root and have as your working directory the directory created in section 3.3: ./uninstall 3.6 Updating /usr/conf/master.d/core-hpux The file /usr/conf/master.d/core-hpux needs to be updated to include the information for the MDL dsd driver. The additional information needs to be added to the section for third party drivers. If you have no other third party drivers, add the following line as is: Table 3.6.1 Values for /usr/conf/master.d/core-hpux name handle type mask block character dsd dsdisk 3 3FB 8 38 If you have other third party drivers, change the number for the block and character so that you are using numbers that are not already in use. Keep track of the numbers that you use in the /usr/conf/master.d/core-hpux file. You will need to use the same numbers when you create the /dev/dsd_info device file. 3.7 Updating /stand/system The dsd driver needs to be included in the kernel. To do this, the dsd driver specification needs to be inserted into the /stand/system file. The line that needs to be added (before the section headed “Kernel Device Info”) is: dsdisk 3.8 Reconfiguring the kernel After all the above changes are made the kernel needs to be reconfigured. Use the following steps: Make a copy of your current kernel: cp /stand/vmunix /stand/vmunix.old Rebuild the kernel with the new dsd device driver by executing the command: /usr/sbin/mk_kernel Assuming the make was successful, replace the current kernel with a copy of the new kernel: mv /stand/build/vmunix_test /stand/vmunix 3.9 Updating /etc/bcheckrc Each time the system is booted or the license string has been updated the /etc/mdl_dsdd daemon must be run for the license to take effect. It is recommended that an entry be made in /etc/bcheckrc to execute /etc/mdl_dsdd automatically at boot time. To update the /etc/bcheckrc file, find the section of /etc/bcheckrc that activates the LVM Volume groups, as depicted in the following example: # # Activate LVM volume groups. # Each logical volume will be activated according to its mirror # consistency recovery policy. # if [ -x /sbin/lvmrc ] then echo "Checking for LVM volume groups and Activating (if any exist)" /sbin/lvmrc fi After the "fi" of the "if" block, add the line: /etc/mdl_dsdd This program loads the license string and partitioning information from the /etc/mdl_dsd_licenses file. Please Note: /etc/mdl_dsdd does not continue to run. It enables the license and terminates. It normally does not appear in the ps -ef. 3.10 Making the Device Files The device major numbers are different from those used for the HP supplied SCSI drivers. Use the values for the block and character devices chosen when you updated /usr/conf/master.d/core-hpux. (See section 2.6 for more information.) Assuming that no other 3rd party drivers are installed that conflict, the major numbers for the dsd devices are: Block driver major number 8 Character driver major number 38 The bits of the DSD minor number are interpreted in the same way as the standard HP minor numbers for SCSI disks. For the 10.0 release, the minor numbers have the format: 0xBBTL0P where BB represents the bus interface in particular: Table 3.10.1 SCSI Bus Numbers Number Corresponding Bus Filename 00 Core SCSI c0tTdLpP 01 HP Fast/Wide c1tTdLpP (F/W) SCSI 01 or Slot 1 EISA SCSI cxtTdLpP 02 * ** 02 or Slot 2 EISA SCSI cxtTdLpP 03 03 or Slot 3 EISA SCSI cxtTdLpP 04 04 or Slot 4 EISA SCSI cxtTdLpP 05 01 GSC SCSI cxtTdLpP 02 GSC SCSI cxtTdLpP 03 GSC SCSI cxtTdLpP 04 GSC SCSI cxtTdLpP * Bus number will be 1 if no HP F/W SCSI bus is present, 2 if one is present. ** x is the bus number, without the leading 0 T represents the target id or SCSI bus address. The range of numbers is 0 - 7, but 7 normally is reserved as the address for the card controlling the bus. The wide bus has the additional addresses 8-f (hex) L represents the logical unit, the range of numbers is 0 - 7 with 0 used for normal disk drive access. Some RAID systems make use of logical unit numbers as another means of subdividing storage. P represents the device partition. The range of numbers is 0 - 9, a - f in the hexadecimal numbering scheme. The names for the device files also follow a regular pattern and correspond to the location of the disk. Character special files for disks are located the directory /dev/rdsk. All the block special files are located in the directory /dev/dsk. The names of the device files that correspond to specific buses are listed in the table above. The T and the L in the file name corresponds to the SCSI address and the SCSI logical unit while P corresponds to the disk partition number. Here is an example of the device files that would be created for the third partition on a disk connected to the core SCSI bus with the disk at address 6. The device files would be created with the following commands: mknod /dev/rdsk/c0t6d0p2 c 38 0x006002 mknod /dev/dsk/c0t6d0p2 b 8 0x006002 The number for the partition is a 2. This refers to the third partition because the partition numbering starts at 0. The device files for specific partitions can be created when running the make_part utility. One character device file needs to be created and placed in the /dev directory. The device file is /dev/dsd_info. It corresponds to the address of just one of the disk drives being partitioned and is used by the mdl_dsdd program, scsi_info and the make_part utility. Using the disk from the example above, the device that needs to be created is: mknod /dev/dsd_info c 38 0x006000 The disk in this example is connected to the core SCSI bus and the drive itself is at target address 6, the logical unit is 0. Note that the "0" partition is specified for the /dev/dsd_info device. The exact mknod that you need to execute depends on the exact address of the disk that you are using the DSD driver to partition. For more information, refer to Table 3.10.1. If you are using the DSD driver to partition multiple disks, the dsd_info device needs to point to one (and only one) of these disks. If you change the address of the disk, you will need to remove /dev/dsd_info device file and execute the mknod with the new minor number. If you have previously installed the DSD driver and you are now changing the address of the disk to which dsd_info points, you must either perform the reboot step discussed in the next section or run the mdl_dsdd program. When you run the make_part program to create the partitions, it will ask you if you want to create the device files. If you answer "y", the device files will automatically be created. 3.11 Reboot the System The system must be rebooted before it will run the new kernel. One way to reboot the system is: reboot -q After the system is booted using the new kernel, continue on to the next section. If there is a problem booting the new kernel, boot from of the backup kernel that was saved in /stand/vmunix.old. There is additional information on how to do this in the Installing Peripherals manual. Chapter 4 Generating the Partitions The make_part utility has been provided to simplify the task of defining partitions and device special files. Make_part requires the proper installation of the /etc/mdl_dsd_licenses and /dev/dsd_info files, as well as previously executing the /etc/mdl_dsdd program, for it to work correctly. There are some constraints when creating partitions. The partitions need to be in order on the disk. The "0" partition needs to be located at addresses lower than the "1" partition. The highest numbered partition that is used is always the last partition on the disk. Another constraint is that the partitions are contiguous. The make_part program is used to define the partition table. This program works by defining the start address of each partition. As the address of the next partition is defined, it automatically determines the size of the previous partition. Until a subsequent partition is defined, a partition is assumed to contain the disk blocks from the start block to the end of the disk. If you start partition 0 at block 0 and define partition 1 to start at block 1024, partition 0 automatically contains the disk blocks from 0 to 1023 kbytes, or 1024x1024 bytes. Below is a sample execution of make_part, defining three partitions on a 9GB disk drive. The text in bold is the text that is entered by the user. To execute the partitioning program, type: /etc/make_part The make_part program will then ask you for the minor number of the device to partition. The number you supply is based on the bus to which the disk is attached, the address of the disk and the "0" partition. In this example, the disk is attached to the core SCSI bus and the disk is at SCSI address 6. For example: Enter minor number of device to partition: 201600 (HP-UX 9.X format) or 006000 (HP-UX 10.X format) The program will then respond with the number of the device, disk information, and the current partition table. The first time you run make_part for a particular disk, the output will be similar to the following: Device 201600: (or Device 006000:) Vendor: SEAGATE Product: ST410800N Revision: 0018 Block length: 512 Number of disk blocks: 17755614 Number of 1 KB blocks: 8877807 Partition table for device 201600 (or 006000) not found The next part of the example will clear the current partition table and then print the result. The "17 " clears the partition table and the "16" prints the result. For example: Enter partition # to change (0-15), list (16), clear (17), or done (18): 17 Enter partition # to change (0-15), list (16), clear (17), or done (18): 16 Partition table for device 201600 (006000): Partition Start End Disk Blocks KB KB (hex) 0 0 8877806 17755614 8877807 8776ef 1 0 8877806 17755614 8877807 8776ef 2 0 8877806 17755614 8877807 8776ef 3 0 8877806 17755614 8877807 8776ef 4 0 8877806 17755614 8877807 8776ef 5 0 8877806 17755614 8877807 8776ef 6 0 8877806 17755614 8877807 8776ef 7 0 8877806 17755614 8877807 8776ef 8 0 8877806 17755614 8877807 8776ef 9 0 8877806 17755614 8877807 8776ef 10 0 8877806 17755614 8877807 8776ef 11 0 8877806 17755614 8877807 8776ef 12 0 8877806 17755614 8877807 8776ef 13 0 8877806 17755614 8877807 8776ef 14 0 8877806 17755614 8877807 8776ef 15 0 8877806 17755614 8877807 8776ef By clearing the partition table, partition 0 is now the size of the whole disk. This is because there is no subsequent partition to limit the size of partition 0. The next part of the example will define the starting address for partition 1 which is the second partition. By defining the start of partition 1, the size of partition 0 will be automatically be determined. To enter the address for partition 1, specify that 1 is the partition that you want to change, then specify the number of the block where you want the partition to start. The block size to use for this calculation is 1k or 1024. For example: Enter partition # to change (0-15), list (16), clear (17), or done (18): 1 Enter new starting disk address (in KB blocks) (0-8877806): 4194303 Enter partition # to change (0-15), list (16), clear (17), or done (18): 16 Partition table for device 201600 (or 006000 under HP-UX 10.X): Partition Start End Disk Blocks KB KB (hex) 0 0 4194302 8388606 4194303 3fffff 1 4194303 8877806 9367008 4683504 4776f0 2 0 8877806 17755614 8877807 8776ef 3 0 8877806 17755614 8877807 8776ef 4 0 8877806 17755614 8877807 8776ef 5 0 8877806 17755614 8877807 8776ef 6 0 8877806 17755614 8877807 8776ef 7 0 8877806 17755614 8877807 8776ef 8 0 8877806 17755614 8877807 8776ef 9 0 8877806 17755614 8877807 8776ef 10 0 8877806 17755614 8877807 8776ef 11 0 8877806 17755614 8877807 8776ef 12 0 8877806 17755614 8877807 8776ef 13 0 8877806 17755614 8877807 8776ef 14 0 8877806 17755614 8877807 8776ef 15 0 8877806 17755614 8877807 8776ef If you look at the output from the list command, you will see that partition 0 now has a new ending block and partition 1 has a different starting point. At this point, partition 1 contains the rest of the disk. The next part of the example will create one more partition. The last partition will be created by setting the address for partition 2. For example, Enter partition # to change (0-15), list (16), clear (17), or done (18): 2 Enter new starting disk address (in KB blocks) (0-8877806): 7340032 Enter partition # to change (0-15), list (16), clear (17), or done (18): 16 Partition table for device 201600: Partition Start End Disk Blocks KB KB (hex) 0 0 4194302 8388606 4194303 3fffff 1 4194303 7340031 6291458 3145729 300001 2 7340032 8877806 3075550 1537775 1776ef 3 0 8877806 17755614 8877807 8776ef 4 0 8877806 17755614 8877807 8776ef 5 0 8877806 17755614 8877807 8776ef 6 0 8877806 17755614 8877807 8776ef 7 0 8877806 17755614 8877807 8776ef 8 0 8877806 17755614 8877807 8776ef 9 0 8877806 17755614 8877807 8776ef 10 0 8877806 17755614 8877807 8776ef 11 0 8877806 17755614 8877807 8776ef 12 0 8877806 17755614 8877807 8776ef 13 0 8877806 17755614 8877807 8776ef 14 0 8877806 17755614 8877807 8776ef 15 0 8877806 17755614 8877807 8776ef Now that the last partition is created, the last step is to save the information and create the device files. This is done by specifying "18". For example, Enter partition # to change (0-15), list (16), clear (17), or done (18): 18 Enter 'y' to save this partition table 'n' to discard 'e' to edit: y Loading new partition information into driver /etc/mdl_dsd_licenses updated. Enter 'y' to create device files anything else to exit: y Generating devices using block major number 8 and character major number 38 After creating the device files, you may look at /dev/dsk and /dev/rdsk and see the device files for the disk partition that you just created. In this particular example, the disk is on the Core SCSI bus and is at address 2, logical unit 0 and the partition number changes. The HP-UX 9.X block special files in /dev/dsk are: brw-rw-rw- 1 root sys 8 0x201200 Jul 1 13:21 c201d2l0s0 brw-rw-rw- 1 root sys 8 0x201201 Jul 1 13:21 c201d2l0s1 brw-rw-rw- 1 root sys 8 0x201202 Jul 1 13:21 c201d2l0s2 The HP-UX 9.X character special files in /dev/rdsk are: crw-rw-rw- 1 root sys 38 0x201200 Jul 1 13:21 c201d2l0s0 crw-rw-rw- 1 root sys 38 0x201201 Jul 1 13:21 c201d2l0s1 crw-rw-rw- 1 root sys 38 0x201202 Jul 1 13:21 c201d2l0s2 There are a few differences between the DSD device files and the HP standard device files. The major and minor numbers are different. Secondly, the names for the DSD device files include an "l" (the letter L) specifier for the logical unit. This is to insure that there are no collisions with the HP device files. The HP-UX 10.X block special files are: brw-rw-rw- 1 root sys 8 0x002000 Jul 1 13:21 c0t2d0p0 brw-rw-rw- 1 root sys 8 0x002001 Jul 1 13:21 c0t2d0p1 brw-rw-rw- 1 root sys 8 0x002002 Jul 1 13:21 c0t2d0p2 The HP-UX 10.X character special files in /dev/rdsk are: crw-rw-rw- 1 root sys 38 0x002000 Jul 1 13:21 c0t2d0p0 crw-rw-rw- 1 root sys 38 0x002001 Jul 1 13:21 c0t2d0p1 crw-rw-rw- 1 root sys 38 0x002002 Jul 1 13:21 c0t2d0p2 There are a few differences between the DSD device files and the HP standard device files. This is to ensure that there are no collisions with the HP device files. Chapter 5 Using DSD 5.1 General Description After the driver is installed and the device files are made, you should be able to use the MDL DSD driver the way you would use another disk driver. You can use either character or block special files. Below are some examples of using the MDL DSD driver with a few system commands. 5.2 Examples Suppose you want to copy your root disk to a DSD disk partition. If your root disk is on the core SCSI bus at address 6 and the DSD- partitioned disk is connected to the SCSI bus at address 5 installed in the EISA bus at slot 2, and the target partition is 9, the dd command would look like: dd if=/dev/rdsk/c201d6s0 of=/dev/rdsk/c420d5l0s9 bs=64k (HP-UX 9.X) or dd if=/dev/rdsk/c0d6s0 of=/dev/rdsk/c3t5d0p9 bs=64k (HP-UX 10.X) The first parameter specifies the input file to be the disk on the core SCSI board at address 6. The second parameter specifies the output file to be partition 9 on the disk at address 5 on the SCSI bus interface installed in the second EISA slot. The last parameter, bs=64K, tells the dd command to transfer data in blocks of 64 x 1024 bytes. 5.3 Installing HP-UX 9.X File Systems In Partitions (mkfs) A DSD partition is identical in form and function to a disk drive. This means that the partition may be used “raw”, or it may be used as a mounted file system. As with disk drives, a file system must be created in a DSD partition before that partition can be mounted. One simple way of performing this task is as follows: š Determine the size of the file system. The file system can be no larger than 4GB under HP-UX, and can also be no larger than the actual size of the partition. The partition size can be ascertained by using option 16 of the /etc/make_part utility. (See: Chapter 4 Generating Partitions.) š Make a file system in that partition. For example, type: mkfs /dev/rdsk/c201d3l0s4 1000000 (under HP-UX 9.X) This creates a filesystem that is 1000000 blocks in size. All the default values are used for the other mkfs parameters. This is the simplest way of calling mkfs. Frequently for large disks, you want to change the default parameters. For example, having the min free parameter set to 10 reserves 10% of the disk space. That means that when there is less than 10% of the disk free, you will get filesystem full messages. For a 4GB filesystem, this reserves 400MB of space. See Table 5.3.1 for the other mkfs parameters and their default values and the meaning of the parameters. Table 5.3.1 mkfs Default Parameters Paramet Value Meaning er nsect 32 Sectors per track. ntrack 16 Tracks per cylinder blksize 8192 Blocksize for the disk. fragsiz 1024 Fragment e size. ncpg 16 Number of cylinders per group minfree 10 Minimum required free space on the disk. rps 60 Revolutions per second. nbpi 2048 Data bytes per inode. If you wanted specify the mkfs for the same disk partition as above, but specify the minfree value to be 5% rather than 10% and specify rps as 90 rather than 60, all the mkfs parameters must be specified. The mkfs command would look like: mkfs /dev/rdsk/c201d3l0s4 1000000 32 16 8192 1024 16 5 90 2048 For more information on the mkfs command, see the mkfs(1m) man page. š Turn off the rotational delay for the filesystem you created. To do this execute the tunefs command with the -d option. For example, tunefs -d 0 /dev/rdsk/c201d3l0s4 This tunefs command applies to the filesystem that was created in the mkfs example above. š Make a directory onto which to mount the disk partition. For example, type: mkdir /mnt_part_4 Mount the disk partition onto the directory. Note that the block special device is used instead of the character special device. For example, type: mount /dev/dsk/c201d3l0s4 /mnt_part_4 5.4 Installing HP -UX File Systems In Partitions (newfs) To use newfs to create a filesytem under HP-UX 9.X, you must first create an entry in /etc/disktab. The /etc/disktab file is optional under HP-UX 10.X and is provided for backward compatibility purposes only, however you can use it to create your file system. You must have an entry in /etc/disktab for each size of partition that you have created. You must have values for the following parameters: disk name, s0, ns, nt, nc, b0, f0, rm, se. Each of these parameters is described below. 5.4.1 Disk Name The disk name is used to refer to the entry when you use newfs. Typically, there is more than one entry specifying different amounts of swap space. A typical name is SEAGATE_410800N_noswap. 5.4.2 s0 The s0 parameter specifies the size of the filesystem that you are creating. The partition size can be ascertained by using option 16 of the /etc/make_part utility. (See Chapter 4 Generating Partitions.) The number that you use for s0 is the size in the number of Kbytes. In this case, the value for s0 is 1000000. 5.4.3 ns and nt The number that you pick for ns and nt are arbitrary to a large extent. Ns used to refer to the number of sectors per track. Nt used to refer to the number of tracks per cylinder. With SCSI disks, this is no longer the case. There are several ways of choosing values for these parameters. The under lying relationship between s0, ns, nt and nc is that s0 = ns * nt * nc In other words, the size of the filesystem is calculated by multiplying ns by nt by nc. One way of picking values for ns and nt is to factor s0 and use two of the factors for ns and nt. Another alternative is to use the defaults that are used by mkfs. Mkfs uses 32 for ns and 16 for nt. 5.4.4 nc Nc represents the number of cylinders. To calculate the value for nc, use the following formula: nc = int ( s0 / ( ns * nt ) ) For the example so far, using the defaults for ns and nt, the calculation is nc = int ( 1000000 / ( 32 * 16 ) ) nc = 1953 5.4.5 b0 B0 represents the block size. In most cases, the value for b0 is 8K or 8192. 5.4.6 f0 F0 represents the fragment size. In most cases the value for f0 is 1K or 1024. 5.4.7 rm Rm is the revolutions per minute. This is specific to the disk. Many 5 1/4 inch disks are 5400 revolutions per minute. 5.4.8 se Se is the sector size on the disk. This number is the "bytes per sector" from the /etc/diskinfo command. For this example it is 512 bytes. 5.4.9 Completed Disktab Entry The completed disktab entry looks like: SEAGATE_ST410800N_noswap|SEAGATE_ST410800N_noreserve:\ :No swap or boot:ns#32:nt#16:nc#1953:\ :s0#1000000:b0#8192:f0#1024:\ :se#512:rm#5400: After the disktab entry has been completed, save the changes and exit the editor. 5.4.10 Running /etc/newfs under HP-UX 9.X Initialize the filesystem on the disk drive using newfs as follows: /etc/newfs -v DEVICE_FILE DISK_NAME_IN_DISKTAB_FILE For this example, the newfs command would look like: /etc/newfs -v /dev/rdsk/c201d3l0s4 SEAGATE_ST410800N_noswap The performance of the disk can be increased by setting the rotational delay of the disk to 0. This is done with the following command: /etc/tunefs -d 0 /dev/rdsk/c201d3l0s4 assuming that the disk drive is to SCSI ID 3 and partition 4. Once initialized by the above steps the disk may be mounted and files may be written to it. 5.4.11 Running /etc/newfs under HP-UX 10.X The example below depicts one of the ways an hfs type filesystem can be initialized on the disk drive using newfs. HP-UX 10.X does not require that you use a /etc/disktab file. Check the man pages for newfs command line options which enable initialization of a filesystem without the use of an /etc/disktab file. /usr/sbin/newfs -F hfs -O DISK_NAME_IN_DISKTAB_FILE -v DEVICE_FILE For this example, the newfs command could look like: /usr/sbin/newfs -F hfs -O SEAGATE_ST410800N_noswap -v /dev/rdsk/c0t3d0p4 The performance of the disk can be increased by setting the rotational delay of the disk to 0. This is done with the following command: /etc/tunefs -d 0 /dev/rdsk/c0t3d0p4 assuming that the disk drive is to SCSI ID 3 and partition 4. Once initialized by the above steps the disk may be mounted and files may be written to it. 5.5 scsi_info 5.5.1 scsi_info under HP-UX 9.X The scsi_info program has been provided to dynamically query every possible SCSI bus address on the system and to display information relating to each device present. This utility is designed to perform this query without adversely affecting any of the devices it finds. The information displayed is far more comprehensive than that provided by ioscan and, unlike the diskinfo program, will work with any SCSI device. To run scsi_info, use the following command: /etc/scsi_info This results in output similar to the following: SCSI Bus 0x201: ID 0, LUN 0: ID 1, LUN 0: Vendor: TOSHIBA Product: CD-ROM XM-3401TA Revision: 1094 Vendor specific: 04/19/94 Device type: CD-ROM ANSI level 2 ISO level 0 SCSI-2 Response Supports relative addressing, synchronous I/O, linked commands, Block length: 2048 Number of blocks: 276992 Capacity: 553984 KB ID 2, LUN 0: ID 3, LUN 0: ID 4, LUN 0: ID 5, LUN 0: ID 6, LUN 0: Vendor: QUANTUM Product: LPS525S Revision: 3100 Vendor specific: 12/03/92446227910126 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, command queuing, Block length: 512 Caches: read enabled, write enabled Number of blocks: 1023484 Capacity: 511742 KB SCSI Bus 0x410: ID 0, LUN 0: ID 1, LUN 0: ID 2, LUN 0: Vendor: SEAGATE Product: ST410800N Revision: 0018 Vendor specific: 00454973 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, linked commands, command queuing, Block length: 512 Caches: read enabled, write disabled Number of blocks: 17755614 Capacity: 8877807 KB ID 3, LUN 0: ID 4, LUN 0: Vendor: CONNER Product: CFP4207W 4.28GB Revision: 2B4B Vendor specific: Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports 16-bit wide transfers, synchronous I/O, command queuing, Block length: 512 Caches: read enabled, write disabled Number of blocks: 8388607 Capacity: 4194303 KB ID 5, LUN 0: ID 6, LUN 0: The scsi_info command can print out data about a single interface by specifying number of the bus that you want to interrogate. For example: /etc/scsi_info 410 prints the results for the EISA card in the first slot. The would look like: SCSI Bus 0x410: ID 0, LUN 0: ID 1, LUN 0: ID 2, LUN 0: Vendor: SEAGATE Product: ST410800N Revision: 0018 Vendor specific: 00454973 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, linked commands, command queuing, Block length: 512 Caches: read enabled, write disabled Number of blocks: 17755614 Capacity: 8877807 KB ID 3, LUN 0: ID 4, LUN 0: Vendor: CONNER Product: CFP4207W 4.28GB Revision: 2B4B Vendor specific: Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports 16-bit wide transfers, synchronous I/O, command queuing, Block length: 512 Caches: read enabled, write disabled Number of blocks: 8388607 Capacity: 4194303 KB ID 5, LUN 0: ID 6, LUN 0: If you wanted to see the information for a single drive-, you would specifiy the bus number and scsi-id, the drive in the scsi_info command. For example, if you wanted to find out what disk was on the CORE SCSI bus at address 6, you would type: /etc/scsi_info 201600 The output would be similar to: SCSI Bus 0x201: ID 6, LUN 0: Vendor: QUANTUM Product: LPS525S Revision: 3100 Vendor specific: 12/03/92446227910126 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, command queuing, Block length: 512 Caches: read enabled, write enabled Number of blocks: 1023484 Capacity: 511742 KB In the same manner, you could direct scsi_info to give you information about a specific lun (in this example, lun 1) by typing: /etc/scsi_info 201610 5.5.2 scsi_info under HP-UX 10.X The scsi_info program has been provided to dynamically query every possible SCSI bus address on the system and to display information relating to each device present. This utility is designed to perform this query without adversely affecting any of the devices it finds. The information displayed is far more comprehensive than that provided by ioscan and, unlike the diskinfo program, will work with any SCSI device. To run scsi_info, use the following command: /etc/scsi_info [BB] or [BBT] (see minor number explanation in section 3.10) Depending on the options used, this results in output similar to the following: SCSI Bus 0x00: ID 0, LUN 0: Vendor: DEC Product: DSP3210S Revision: 441C Vendor specific: 000041778399! Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, command queuing, Block length: 512 Number of blocks: 4197520 Capacity: 2098760 KB ID 1, LUN 0: Vendor: SEAGATE Product: ST12400N Revision: 8650 Vendor specific: 00218348 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, command queuing, Block length: 512 Caches: read enabled, write enabled Number of blocks: 4194685 Capacity: 2097342 KB ID 2, LUN 0: Vendor: SEAGATE Product: ST410800N Revision: 0025 Vendor specific: 00243162 Device type: disk ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, linked commands, command queuing, Block length: 512 Partition 0: Number of blocks: 8000000 Capacity: 4000000 KB Partition 1: Number of blocks: 7000000 Capacity: 3500000 KB Partition 2: Number of blocks: 2755613 Capacity: 1377806 KB Partition 3: Number of blocks: 17755613 Capacity: 8877806 KB Partition 4: Number of blocks: 17755613 Capacity: 8877806 KB Partition 5: Number of blocks: 17755613 Capacity: 8877806 KB Partition 6: Number of blocks: 17755613 Capacity: 8877806 KB Partition 7: Number of blocks: 17755613 Capacity: 8877806 KB Partition 8: Number of blocks: 17755613 Capacity: 8877806 KB Partition 9: Number of blocks: 17755613 Capacity: 8877806 KB Partition 10: Number of blocks: 17755613 Capacity: 8877806 KB Partition 11: Number of blocks: 17755613 Capacity: 8877806 KB Partition 12: Number of blocks: 17755613 Capacity: 8877806 KB Partition 13: Number of blocks: 17755613 Capacity: 8877806 KB Partition 14: Number of blocks: 17755613 Capacity: 8877806 KB Partition 15: Number of blocks: 17755613 Capacity: 8877806 KB ID 3, LUN 0: ID 4, LUN 0: Vendor: TOSHIBA Product: CD-ROM XM-3401TA Revision: 2873 Vendor specific: 10/14/93 Device type: CD-ROM ANSI level 2 ISO level 0 SCSI-2 Response Supports relative addressing, synchronous I/O, linked commands, Block length: 2048 Number of blocks: 104152 Capacity: 208304 KB ID 5, LUN 0: Vendor: HP Product: C1533A Revision: 9406 Vendor specific: 9 Device type: tape ANSI level 2 ISO level 0 SCSI-2 Response Supports synchronous I/O, linked commands, Block length: 1024 Number of blocks: 0 Capacity: 0 KB ID 6, LUN 0: 5.5 dsd_format There is a command called dsd_format included with your driver. You may use this program to do a low level format on large disks like the Seagate ST410800N. Mediainit will not work a disk this large because mediainit will timeout before the disk has completed formatting. To run dsd_format, you only need to supply one parameter. This parameter is a device file using the major number for the raw or character device for the DSD driver. In most cases, this is major number 38. When specifying the partition, use the 0 partition. For example, if the disk is on the CORE SCSI bus at address 2, mknod for the device would look like: /etc/mknod /dev/rdsk/c201d2l0s0 c 38 0x201200 (Under 9.X) or /etc/mknod /dev/rdsk/c0t2d0p0 c 38 0x002000 (Under 10.X) To use dsd_format for this disk, type: /etc/dsd_format /dev/rdsk/c201d2l0s0 (Under 9.X) or /etc/dsd_format /dev/rdsk/c0t2d0p0 (Under 10.X) 5.6 Known Limitations The ioscan and SAM utility programs are known to not display DSD partitions. The diskinfo utility does not display information about disk drives mounted via the DSD driver under HP-UX 10.X. 5.8 Changing the Disk Device Size If changing the size of the disk device, especially if you are shrinking it, then edit the file /etc/mdl_dsd_licenses and remove the partition info for that device. Exit the editor and run /etc/mdl_dsdd to reset the driver, then run make_part to repartition the drive. Chapter 6 When All Else Fails If for any reason you require product technical support, please contact the OEM or Distributor where you purchased your equipment. If they cannot help you or at their direction, MDL Corporation Technical Support can be reached at: MDL Corporation 14940 NE 95th Street Redmond, WA 98052 Voice (206) 861-6700 (800) 800-3766 FAX (206) 861-6767 E-mail custsvc@mdlcorp.com