AIX HITACHI dlnkmgr how to
id : 0d0u84g5py
category : computer
blog : unix
created : 01/19/11 - 12:09:42
  • List path :
# dlnkmgr view -path

  • Enable a path :
# dlnkmgr online -pathid <path_id>

  • Disable a path :
# dlnkmgr offline -pathid <path_id>

  • Pathid is give with dlnkmgr view -path command.
  • Lisr drv :
# dlnkmgr view -drv

  • List paths for a specific device :
# dlnkmgr view -path -hdev <device>
# dlnkmgr view -path -hdev hdisk66

  • List only lun number for a specific path :
# dlnkmgr view -item LU -path -hdev <device>
# dlnkmgr view -item -path -hdev hdisk66

  • Item parameter can be "[pn] [dn] [lu] [cp] [type] [ic] [ie] [dnu] [hd]":
    • LU : lun number.
    • CP : ChaPort.
    • TYPE : Type.
    • ...
  • Here is a script to get lun number for a specified list of hdisk :
.01#!/usr/bin/ksh
.02#######################################################
.03# Param : File with hidsk List                        #
.04# Result : get lun number for each disk               #
.05#######################################################
.06
.07# DLNKMGR
.08DLNKMGR_BINARY=/usr/DynamicLinkManager/bin/dlnkmgr
.09
.10# Cmmds
.11CAT_BIN=/usr/bin/cat
.12ECHO_BIN=/usr/bin/echo
.13TAIL_BIN=/usr/bin/tail
.14HEAD_BIN=/usr/bin/head
.15CUT_BIN=/usr/bin/cut
.16# Args
.17MY_FILE_ARG=$1
.18
.19cat ${MY_FILE_ARG} | while read a_disk ; do
.20  LUN_NUMBER=`${DLNKMGR_BINARY} view -item LU -path -hdev ${a_disk} | tail -2 | head -1 | cut -d ' ' -f 2`
.21  echo "${a_disk} --> ${LUN_NUMBER}"
.22done

  • Unlock a locked disk with dlmpr :
    • View if disk is locked :
# *******@root /usr/DynamicLinkManager/bin#> ./dlmpr -k hdisk15
self Reservation Key : [0x000000030d3981d9]
hdisk15    Reservation Key : [0x000000020d3981d9]*
                Regist Key : [0x000000020d3981d9] , Key Count : 2
KAPL10665-I The dlmpr utility completed.

    • Unlock disk :
# ******@root /usr/DynamicLinkManager/bin#> ./dlmpr -c hdisk15
self Reservation Key : [0x000000030d3981d9]
hdisk15    Reservation Key : [0x000000020d3981d9]*
                Regist Key : [0x000000020d3981d9] , Key Count : 2
KAPL10665-I The dlmpr utility completed.

    • Check if disk was unlocked :
******@root /usr/DynamicLinkManager/bin#> ./dlmpr -k hdisk15
self Reservation Key : [0x000000030d3981d9]
hdisk15    Reservation Key : [0x0000000000000000]
KAPL10665-I The dlmpr utility completed.

    • Use dd to look if disk is lock or unlocked :
# dd if=/dev/hdisk1 of=/dev/null bs=1024 count=10
Device is busy.

    • After unlocking :
# dd if=/dev/hdisk15 of=/dev/null bs=1024 count=10
10+0 records in
10+0 records out

  • Before updating or installing new version of hldm follow these steps :
# dlmpr -k
# dlmpr -c
# dlmrmdev -a
# dlmpreuninst