March 28, 2024, 02:15:48 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: how to check its local or SAN disk in linux  (Read 65610 times)

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
how to check its local or SAN disk in linux
« on: May 07, 2008, 08:59:19 AM »
Hi All,
Sorry loggin'g after a long long time but was very busy in other stuff.

Could anyone please tel how to differnciate between local and SAN disk in linux/solaris?
I checked google and found that /proc/scsi/scsi can tel about this but after checking this also I am not sure how to judge that..........like STK is clear that its a SAN disk
 Really its not so clear how to judge

could anyone please help?

Thanks
Gaurav

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: how to check its local or SAN disk in linux
« Reply #1 on: May 07, 2008, 08:04:39 PM »
You are always welcome.. but unfortunately I have no idea how to distinguish SAN disc but general idea can be the size of disk, you can get an idea if by seeing size and if its equal to SAN disk then it is the one you looking for.

Btw, what output you get from fdisk -l , what does your /proc/sys/scsi contains while you have SAN and when you do not have one!

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: how to check its local or SAN disk in linux
« Reply #2 on: May 08, 2008, 10:56:15 AM »
I have little idea for SAN disk
If you see the /proc/scsi/scsi file it wi give you information like below

Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: HP 36.4G Model: MAN3367MC        Rev: HP05
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003
  Type:   Unknown                          ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 02
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 03
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 01 Lun: 00
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003
  Type:   Unknown                          ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 01 Lun: 02
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 01 Lun: 03
  Vendor: COMPAQ   Model: HSV110 (C)COMPAQ Rev: 2003

Above indicates that HSV110 is a storage disk  and it also give the LUN numbers with scsi information

Like here it shows scsi2 is a san disk

if you wana know abt the SAN partition  do this

 dmesg | grep -i "attached "
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 2
Attached scsi disk sdc at scsi2, channel 0, id 0, lun 3
Attached scsi disk sdd at scsi2, channel 0, id 1, lun 2

It gives the required partitions on LUN with scsi information, compare it with o/p of /proc/scsi/scsi LUN's , you wil get to know that sdb,sdc and sdd are SAN disks.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Re: how to check its local or SAN disk in linux
« Reply #3 on: June 13, 2008, 08:37:18 AM »
Hi, gaurav. We can't differentiate SAN disk using /dev/sdX device names as when the LUNs are provisioned. We will still see it as a /dev/sdX. Of course this is excluding the I-SCSI based storage luns. Which is obviously very straightforward to detect.

If you are using SAN storage. You will need to refer to your vendor documentation as it is very vendor specific. Some are even using their own device filenames. For example, an EMC san storage uses:

/dev/emcpowerX as their device file

However these device are accessible via their multipaths which can be /dev/sdX

Hope above explains if I answer u what u r looking for.

Also, if you dont have a vendor based software to detect your SAN disk (LUNs), or instead uses "multipath" tools which is open source utility. Then, u can see the device names via running:

# multipath -l

Alternatively, u can see these LUNs are detect and mapped using device mapper. (/dev/mapper/.... or /dev/disk/by-uuid or /dev/disk/by-name)

As for /proc/scsi/{your hba card type}, this is usable via kernel 2.4 (i.e RHEL3), but for kernel 2.6 (i.e SLES10) it will be in /sys/class/fc_host/{hba cards info here}