Tag Archives: persistent to legacy dsf mapping in hpux

HPUX: Add persistent device names in VG

Know command to add persistent device names in the existing volume group in HPUX. Also, learn how to match legacy devices with persistent device names.

Newer HPUX like v3 introduced persistent device names (DSF disk special files). These are more convenient and user-friendly names than ctd format (Controller, target, device) names. CTD format are called legacy DSF and newer are persistent.

Persistent DSF takes care of native multipathing. In the case of multipathing, for the same disk, there are different ctd exists and hence different legacy names. But, there will be only one persistent device name per disk no matter how many ctd paths exist for that same disk. You can see this in the device file names mapping below.

For example, the legacy disk file name is /dev/dsk/c0t1d0 whereas persistent disk file name will be /dev/disk/disk1. A system with persistent device names does have legacy names in kernel too. Persistent to legacy names can be mapped using ioscan command like below :

# ioscan -m dsf
Persistent DSF             Legacy DSF(s) 
======================================== 
/dev/rdisk/disk1           /dev/rdsk/c1t0d0 
/dev/rdisk/disk2           /dev/rdsk/c4t0d0 
/dev/rdisk/disk3           /dev/rdsk/c2t0d1 
                           /dev/rdsk/c2t0d2 
/dev/rdisk/disk4           /dev/rdsk/c3t0d1 
                           /dev/rdsk/c3t0d2

In the above output, you can see the persistent device name on left and its related legacy name is on right. You can see multipathing is being taken care of by persistent device files. Since there is only one persistent name but many legacy device names for the same disk.

Adding persistent devices in VG :

For example, if you have created a volume group on a system with legacy device files. Now, you want to add persistent device files to VG. Then you can do it by using vgextend command with all persistent disk paths. But this method will be hectic since you need to search persistent names for all existing legacy devices in VG and accordingly add them in VG.

HPUX v3 has a special command vgdsf which will do this task for you. You just need to provide VG name and this command will add all persistent devices in VG and removes legacy devices out.

# vgdsf -c /dev/vg01

Converting legacy DSFs to persistent DSFs in VG /dev/vg01
Persistent DSF /dev/disk/disk3 added to VG /dev/vg01
Persistent DSF /dev/disk/disk4 added to VG /dev/vg01
Legacy DSF /dev/dsk/c2t0d1 removed from VG /dev/vg01
Legacy DSF /dev/dsk/c2t0d2 removed from VG /dev/vg01
Legacy DSF /dev/dsk/c3t0d1 removed from VG /dev/vg01
Legacy DSF /dev/dsk/c3t0d2 removed from VG /dev/vg01

In the above output you can see first it adds persistent dsf to VG and then removes legacy dsf from VG. You can verify if VG contains only persistent devices using vgdisplay command or examining /etc/lvmtab file.