Scanning for new luns
This is a short article on how to rescan newly added luns in Solaris, Linux, AIX and HP-UX operating systems.
Solaris
- Determine the FC channels
cfgadm -al
- Force rescan
cfgadm -o force_update -c configure -c#
where # is the FC channel number - Force rescan at HBA port level
luxadm -e forcelip /dev/fc/fp#
- Force rescan on all FC devices
cfgadm -al -o show_FCP_dev
- Install device files
devfsadm
- Display QLogic HBA ports
luxadm -e port
- Disaply HBA port information
luxadm -v disable WWPN luxadm -e dump_map
Linux
A Linux system can recognize newly attached LUNs without unloading the FC HBA driver. The procedure slightly differs depending on the installed FC HBAs.
- In the case of QLogic HBAs, issue the command
echo “scsi-qlascan > /proc/scsi/qla2300/<adapter-instance>
- With Emulex HBAs, issue the command
sh force_lpfc_scan.sh “lpfc<adapter-instance>”
This script is not part of the regular device driver package, and you must download it separately from the Emulex website. It requires you to install the tooldfc
under/usr/sbin/lpfc
. - In both cases, you must issue the command for each installed HBA with the <adapter-instance> for the SCSI instance number of the HBA.
- After the FC HBAs rescan the fabric, you can make the new devices available to the system by running the command
echo “scsi add-single-device s c t l” > /proc/scsi/scsi
The quadruples c t l
is the physical address of the device:- s is the SCSI instance of the FC HBA.
- c is the channel (in our case, always 0).
- t is the target address (usually 0, except if a volume is seen by a HBA more than once).
- l is the LUN
AIX
- Rescan the devices
cfgmgr -vi fcs#
where # is the FC adapter number - Verify the new devices
lsdev -Cc <disk|tape>
HP-UX
- Rescan devices
ioscan -fnC <disk|take>
- Generate device files
infs -e
- Verify the new devices
ioscan -funC <disk|tape>