I have a server with several disks and partitions. For an specific disk I want to know if it is local or in the SAN.
I ran some commands:
[root@server]# ls -l /sys/block/*/device
lrwxrwxrwx 1 root root 0 Jul 22 12:15 /sys/block/hda/device -> ../../devices/pci0000:00/0000:00:1f.1/ide0/0.0
lrwxrwxrwx 1 root root 0 Jul 22 12:15 /sys/block/sda/device -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:0e.0/host0/target0:2:0/0:2:0:0
lrwxrwxrwx 1 root root 0 Jul 22 12:15 /sys/block/sdb/device -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:0e.0/host0/target0:2:1/0:2:1:0
lrwxrwxrwx 1 root root 0 Jul 22 12:15 /sys/block/sdc/device -> ../../devices/platform/host3/target3:0:0/3:0:0:0
How can I certainly know which device is local and which is connected to the SAN?
There's a couple different approaches you can take. Some may be better or worse for your particular setup. Remember, strictly speaking a Fibre Channel drives does not necessarily mean "SAN" or "Storage Array". It may just be an actual FC-attached drive.
You can check to see which SCSI host the drive is on and filter that way if you know, for example, that all your servers have (i.e) QLogic cards:
Check the
di
VPD page for the device in question to see what protocol it's using.Check using the path management tools for your particular storage array to see if the device is on that array. For example:
versus:
SAN LUNs don't present themselves as IDE drives.