Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Step
Command
1Change to the directory where you store your virtual disks.

Example:

# cd /data/Stromasy/HP-host1/Data/LDEVS/

2Create an empty disk container. Note that the actual size of the disk will depend on the requirements of your emulated system. 

Example virtual disk creation (size 20GB):

# dd if=/dev/zero of=mydiskname.dsk bs=1G count=20

Adding a Virtual Disk to the Configuration File

The new virtual disk must be added to the configuration file of the Charon-HPA instance. This requires two commands:


StepConfiguration file entry
1Load the SCSI device.load device
2Link device with disk container file.device.image="/path/to/disk-container-file"

The parameter device encodes the device type and the device path of the emulated SCSI device presented to the guest operating system:

When loading a SCSI disk, the parameter device has the format DDXnnn. 

A disk device name has the following components:

  • DD: value DK; specifies that device type is disk.
  • X: value consists of an uppercase letter encoding the device path. Please refer to Emulated Model Hardware Configuration Details for system specific device path information.
    Example (rp4000):
    A = device path 0/0/1/0
    B = device path 0/0/1/1
    C = device path 0/0/2/0
    D = device path 0/0/2/1
  • nnn: value encodes the SCSI device connected to the SCSI controller.
    Formula: (SCSI target ID*100)+LUN

The following example adds a SCSI disk with device path 0/0/1/0.0.0 to the configuration:


Div

load DKA0

DKA0.image="ldev1.dsk"



Start Using the Disk in the Guest OS

...

After booting the emulated system with the new disk added to the configuration file, check if HP-UX did recognize it:

CommandExample

To list all known disks on the system, enter the following command:

# ioscan -C disk

The disk with device path 0/0/1/0.2.0 (DKA200) is the new disk:

Image Modified

HP-UX Device Nodes

During HP-UX boot-up, /sbin/insf is executed to create the character and block device special /dev files that allow communication with the disk. HP-UX uses the following device file naming system. For each disk device, the following special files are created:

  • Block device file:
    /dev/dsk/c<number of card>t<SCSI target ID>d<device-LUN>
  • Charater device file:
    /dev/rdsk/c<number of card>t<SCSI target ID>d<device-LUN>

Where card is the (SCSI) controller number, target is the SCSI ID number, and device is the logical unit number, or lun. The lun is 0 for the majority of devices. An example for a disk at controller 0, target 2, lun 0, is /dev/dsk/c0t2d0.

A disk is usually divided into file systems, areas that can hold files, or raw data areas such as swap. File systems are created in disk partitions or logical volumes. To view the size of the drive to be configured use the command, diskinfo.

Example:


Div
classcommandline

# diskinfo /dev/rdsk/c0t2d0

SCSI describe of /dev/rdsk/c0t2d0:

vendor: EMULATOR

product id: HD-IMAGE

type: direct access

size: 2097152 Kbytes

bytes per sector: 512


Creating and Mounting a Filesystem on the new Disk

On HP-UX you can create a logical volume filesystem on the disk using the logical volume manager (LVM). Alternatively, you can create a traditional filesystem. The latter will be used in the following example which shows how to create a filesystem and mount the disk:


StepCommand
1Create a filesystem on the new disk. 
Please note: LVM is now the preferred method to use disks on HP-UX. This example uses a traditional filesystem for simplicity.

Example to create a hfs filesystem on DKA200:

# newfs -F hfs /dev/rdsk/c0t2d0

2Mount the disk to a mount point (create mount point first if it does not exist yet).


Example to mount DKA200 on /mnt:

# mount /dev/dsk/c0t2d0 /mnt

Enable a Disk for Use by MPE/iX

...

This example shows one way to add LDEV 2:


StepCommands
1Log in to Manager.sys.:HELLO MANAGER.SYS
2Start sysgen.:SYSGEN
3Enter the following commands.sysgen> io
io> adev 2 id=ST19171N path=0/0/1/0.1.0
io> hold
io> exit
sysgen> keep
keeping to group CONFIG.SYS
Purge old configuration (yes/no)? yes
sysgen> exit
:DOIONOW
4Exit sysgen.sysgen> exit
5Activate the configuration.:DOIONOW


When using the SYSGEN adev command, depending on the path chosen and your current configuration, you may first need to create parent controller entries using the SYSGEN apath
command. Each disk device is created beneath PCI_DEVICE , A5150A , and PSEUDO path entries as shown in the following example:


Div
classcommandline

apath id=PCI_DEVICE path=0/0/<device>

apath id=A5150A path=0/0/<device>/<function>

apath id=PSEUDO path=0/0/<device>/<function>.<target>

adev <ldev number> id=ST19171N path=0/0/<device>/<function>.<target>.<lun>


You don't need to indicate to SYSGEN how large a disk is. Use the ST19171N device ID whatever size your disk image is; MPE will automatically detect (and use) the size of the physical disk image file.

...

The following exmple shows how to add a new LDev 2 named MEMBER2 to the System Volume Set:


StepCommand
1Start volutil.:VOLUTIL
2At the voltutil prompt add the new disk as a volume to the system volume set.volutil: newvol MPEXL_SYSTEM_VOLUME_SET:MEMBER2 2 100 100
3Exit volutil.volutil: exit

The following example shows how to create a new volume set with LDev 2 as the master:


StepCommand
1Start volutil.:VOLUTIL
2At the voltutil prompt create a new volume set with the new disk as the master volume.volutil: newset USERSET MASTER 2 100 100
3Exit volutil.volutil: exit

To display the status of the volumes, us the dstat command as shown below:

...