HP 3PAR RedHat and Oracle Linux Implementation Guide

Method 1 - sysfs Scan
After exporting VLUNs to the host using the createvlun command in “Exporting LUNs to the
Host (page 104), use the echo statement on the sysfs file system to scan for devices. Use the
cat/proc/scsi/scsi command, or other useful commands such as lsscsi -g or sginfo
-l option, to get a list of device path information:
# echo - <target number> <lun number> > <device scan path>
Example:
The device path is /sys/class/scsi_host/host2 and the target is 0 (target2:0:0) and
the exported device is LUN 1. The following is the echo command to be used.
# echo "- 0 1" > /sys/class/scsi_host/host2/scan
The following message log provides and example of the resulting output:
kernel: Vendor: 3PARdata Model: VV Rev: 0000
kernel: Type: Direct-Access ANSI SCSI revision: 03
kernel: SCSI device sdv: 524288 512-byte hdwr sectors (268 MB)
kernel: SCSI device sdv: drive cache: write back
kernel: sdv: unknown partition table
kernel: Attached scsi disk sdv at scsi2, channel 0, id 0, lun 1
kernel: Attached scsi generic sg22 at scsi2, channel 0, id 0, lun 1, type 0
scsi.agent[12915]: disk at /devices/pci0000:00/0000:00:02.0/0000:01:00.2/
0000:03:0b.0/0000:04:04.0/host2/target2:0:0/2:0:0:1
Alternatively, you can scan for all LUNs and targets for a given lpfc instance using the following
command:
# echo "- - -" > /sys/class/scsi_host/host2/scan
OR use the following script to scan for all LUNs for all the lpfc instances:
# /usr/bin/rescan-scsi-bus.sh -r --nooptscan
If the device has changed its size, then issue the following command to obtain the new disk size:
# echo 1 > /sys/class/scsi_device/2:0:0:1/device/rescan
The rescan must be performed on all device paths to the host. To see the change in size, issue the
following command for Device-mapper multipath:
# multipathd -k
multipathd> resize map 350002ac000350102
ok
multipathd> exit
Method 2 - Adding Single Devices
To add LUNs by using the echo scsi add statement, run the following commands:
# echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
106 Allocating Storage for Access by the RHEL Host