Detect the lun

Hi,

Is there command to detect the newly added LUN is linux box. I tried with below commands, but that doesn't work out.

fdisk -l,
fdisk -l | grep Disk
pvscan

fdisk shows already discovered devices. pvscan only works if the LUN is discovered and is a Physical Volume (made through pvcreate command)

Here's what you need to do:

echo "scsi-qlascan" > /proc/scsi/<driver-name>/<adapter-id>

To find driver_name, try dmesg | tail

Then, try this:

echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi

Now you should be able to see the LUN.

you can either use tools provided by the adapter, or you can find a script online called "rescan-scsi-bus.sh"

It is open source, and free to use. That will do all the magic behind the scenes for you.

Hi,

Thanks admin_xor,

I tried with the below command to identify the lun

echo "- - -" > /sys/class/scsi_host/host5/scan

Here, I have an another issue, how to identify the allocated lun id

Forg eg :

fbvol  462E  lun # 04 (hx)

If you are using EMC storage take output of powermt display dev=all output before scan and after scan find the difference of both output.It will help you to identify newly added luns..

@ Susindram,

Its a IBM SAN storage.