HPUX 11.31永久设备文件名相关命令及用法
HPUX 11.31永久设备文件名相关命令及用法
最经在网上看到有人对HPUX 11.31永久设备文件名的相关命令及用法进行介绍,觉得总结得不错并且精简适用,摘抄下来供兄弟们参考:
V3版本的一个最大的变化就是磁盘设备名(device special file-DSF) 的变化,采用简洁的称为永久设备名(Persistent device special files),即类似于Tru64及AIX的diskn的名称方式,尽管为了兼容性,还保留了传统的硬件路径式的命名方式(即cXtYdZ)。下面介绍针对永久设备名的出现几个命令的使用。
一、ioscan的用法
# ioscan -N
–fknCdisk 显示永久设备名
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
disk 2 64000/0xfa00/0x0 esdisk CLAIMED DEVICE TEAC DV-28E-
C
/dev/disk/disk2 /dev/rdisk/disk2
disk 3 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP 36.4GST33675
3LC
/dev/disk/disk3 /dev/rdisk/disk3
/dev/disk/disk3_p1 /dev/rdisk/disk3_p1
/dev/disk/disk3_p2 /dev/rdisk/disk3_p2
/dev/disk/disk3_p3 /dev/rdisk/disk3_p3
disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST33675
3LC
/dev/disk/disk5 /dev/rdisk/disk5
# ioscan -m lun 显示永久设备名
Class I Lun H/W Path Driver S/W State H/W Type Health Description
======================================================================
disk 2 64000/0xfa00/0x0 esdisk CLAIMED DEVICE online TEAC
DV-28E-C
0/0/2/0.0.0x0.0x0
/dev/disk/disk2 /dev/rdisk/disk2
disk 3 64000/0xfa00/0x1 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/0.0x1.0x0
/dev/disk/disk3 /dev/rdisk/disk3
/dev/disk/disk3_p1 /dev/rdisk/disk3_p1
/dev/disk/disk3_p2 /dev/rdisk/disk3_p2
/dev/disk/disk3_p3 /dev/rdisk/disk3_p3
disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/1.0x2.0x0
/dev/disk/disk5 /dev/rdisk/disk5
/dev/disk/disk5_p1 /dev/rdisk/disk5_p1
/dev/disk/disk5_p2 /dev/rdisk/disk5_p2
/dev/disk/disk5_p3 /dev/rdisk/disk5_p3
# ioscan -m dsf 查看永久设备名和旧设备名之间的对应关系
Persistent DSF Legacy DSF(s)
========================================
/dev/rdisk/disk2 /dev/rdsk/c0t0d0
/dev/rdisk/disk3 /dev/rdsk/c2t1d0
/dev/rdisk/disk3_p1 /dev/rdsk/c2t1d0s1
/dev/rdisk/disk3_p2 /dev/rdsk/c2t1d0s2
/dev/rdisk/disk3_p3 /dev/rdsk/c2t1d0s3
/dev/rdisk/disk5 /dev/rdsk/c3t2d0
# ioscan -P health -C disk 检查磁盘online状态
Class I H/W Path health
===============================
disk 2 64000/0xfa00/0x0 online
disk 3 64000/0xfa00/0x1 online
disk 5 64000/0xfa00/0x5 online
二、取消或恢复旧设备命
# rmsf –L
取消旧设备命
WARNING: This command may be disruptive to the system.
Before running this command, make sure you have first run
iofind(1M) and migrated all applications using legacy device
special files. Please refer to the man page of rmsf(1M) to
verify the possible side effects of the option '-L'.
Do you want to continue ?
(You must respond with 'y' or 'n'.): y
rmsf: Legacy mode has been successfully disabled
# ioscan -funCdisk
# insf –L 恢复旧设备名
This command will re-install all legacy I/O nodes and legacy DSFs.
Do you want to continue ?
(You must respond with 'y' or 'n'.): y
insf: Legacy mode has been successfully enabled
# ioscan -funCdisk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 1 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-C
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 0 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0
/dev/dsk/c2t1d0s1 /dev/rdsk/c2t1d0s1
/dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s3
disk 4 0/1/1/1.2.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
三、如果采用永久设备名,在做vgimport时,需要使用新参数N,否则将使用旧设备文件名。
# vgimport -s -m /tmp/vgdata.map -N vgdata
vgimport: Volume group "/dev/vgdata" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating
the volume group.
# strings /etc/lvmtab
/dev/vg00
/dev/disk/disk3_p2
/dev/vgdata
/dev/disk/disk5
# vgimport -s -m /tmp/vgdata.map vgdata
vgimport: Volume group "/dev/vgdata" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating
the volume group.
# strings /etc/lvmtab
/dev/vg00
/dev/disk/disk3_p2
/dev/vgdata
/dev/dsk/c3t2d0
四、如何改变设备名,如将disk5――>disk4,先删除原来的设备名,再生成新的设备名。
# rmsf /dev/disk/disk5 /dev/rdisk/disk5
# ioscan -m lun
Class I Lun H/W Path Driver S/W State H/W Type Health Description
======================================================================
disk 2 64000/0xfa00/0x0 esdisk CLAIMED DEVICE online TEAC
DV-28E-C
0/0/2/0.0.0x0.0x0
/dev/disk/disk2 /dev/rdisk/disk2
disk 3 64000/0xfa00/0x1 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/0.0x1.0x0
/dev/disk/disk3 /dev/rdisk/disk3
/dev/disk/disk3_p1 /dev/rdisk/disk3_p1
/dev/disk/disk3_p2 /dev/rdisk/disk3_p2
/dev/disk/disk3_p3 /dev/rdisk/disk3_p3
disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/1.0x2.0x0
# mksf -C disk -I 5 /dev/disk/disk4
# mksf -C disk -I 5 -r /dev/rdisk/disk4
# ioscan -m lun
Class I Lun H/W Path Driver S/W State H/W Type Health Description
======================================================================
disk 2 64000/0xfa00/0x0 esdisk CLAIMED DEVICE online TEAC
DV-28E-C
0/0/2/0.0.0x0.0x0
/dev/disk/disk2 /dev/rdisk/disk2
disk 3 64000/0xfa00/0x1 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/0.0x1.0x0
/dev/disk/disk3 /dev/rdisk/disk3
/dev/disk/disk3_p1 /dev/rdisk/disk3_p1
/dev/disk/disk3_p2 /dev/rdisk/disk3_p2
/dev/disk/disk3_p3 /dev/rdisk/disk3_p3
disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE online HP 36.4
GST336753LC
0/1/1/1.0x2.0x0
/dev/disk/disk4 /dev/rdisk/disk4
五、如果更换硬盘,还想使用原来的设备名,可以使用io_redirect_dsf命令。因为换上的新硬盘,系统会分配一个新的设备名。
# io_redirect_dsf
–d /dev/disk/disk3 –n /dev/disk/disk1