Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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:

# lsscsi -H; lsscsi -g
[0]    qla2xxx       
[1]    qla2xxx       
[2]    mptsas        
[3]    ata_piix      
[4]    ata_piix      
[0:0:0:0]    disk    IBM      1814      FAStT  0916  /dev/sda  /dev/sg0
[0:0:0:1]    disk    IBM      1814      FAStT  0916  /dev/sdb  /dev/sg1
[0:0:0:2]    disk    IBM      1814      FAStT  0916  /dev/sdd  /dev/sg3
[0:0:0:31]   disk    IBM      Universal Xport  0916  -         /dev/sg4
[1:0:0:0]    disk    IBM      1814      FAStT  0916  /dev/sdc  /dev/sg2
[1:0:0:1]    disk    IBM      1814      FAStT  0916  /dev/sde  /dev/sg5
[1:0:0:2]    disk    IBM      1814      FAStT  0916  /dev/sdf  /dev/sg6
[1:0:0:31]   disk    IBM      Universal Xport  0916  -         /dev/sg7

Check the di VPD page for the device in question to see what protocol it's using.

# sg_vpd -p di /dev/sda
Device Identification VPD page:
  Addressed logical unit:
    designator type: NAA,  code_set: Binary
      0x600a0b80002664e2000026c349dda1ee
  Target port:
    designator type: NAA,  code_set: Binary
     transport: Fibre Channel (FCP-2)
      0x200600a0b8266f7f
    designator type: Relative target port,  code_set: Binary
     transport: Fibre Channel (FCP-2)
      Relative target port: 0x1
  Target device that contains addressed lu:
    designator type: NAA,  code_set: Binary
     transport: Fibre Channel (FCP-2)
      0x200600a0b8266f7e

Check using the path management tools for your particular storage array to see if the device is on that array. For example:

# sg_rdac /dev/sda
RDAC Legacy page
  Controller serial: 1T63717016
  Alternate controller serial: 1T64109650
  RDAC mode (redundant processor): alternate controller present; Dual active mode
  RDAC mode (alternate processor): alternate controller present; Dual active mode
  Quiescence timeout: 75
  RDAC option 0x6
  LUN Table:
    0: a a x x x x x x
    1: x x x x x x x x
    2: x x x x x x x x
    3: x x x x x x x x

versus:

# sg_rdac /dev/sda
invalid field in cdb (perhaps subpages or page control (PC) not supported)
share|improve this answer

SAN LUNs don't present themselves as IDE drives.

share|improve this answer
    
So those are or are not LUNs? –  ghm1014 Jul 22 '11 at 17:49
    
That's actually an invalid question - LUNs are the logical unit number of a SCSI device. A single target can have more than one LUN (such as a tape drive/controller or storage array). What you should be asking is "is that a FC-connected disk on the SAN?" –  MikeyB Jul 22 '11 at 20:39
    
... but Chopper3 is correct. One indicator is that FC disks don't present as IDE. –  MikeyB Jul 22 '11 at 20:39
    
@MikeyB No problem I'll change my question. Then another question would be how do I list storage devices that are not present as IDE? –  ghm1014 Jul 22 '11 at 22:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.