Wednesday, May 02, 2012

Physical disk locations

zpool(1M) has a very handy option to display physical disk locations on some hardware.
cwafseng3 $ zpool status -l cwafseng3-0
  pool: cwafseng3-0
 state: ONLINE
  scan: scrub canceled on Thu Apr 12 13:52:13 2012
config:
 
        NAME                                       STATE     READ WRITE CKSUM
        cwafseng3-0                                ONLINE       0     0     0
          raidz1-0                                 ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD02/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD23/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD22/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD21/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD20/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD19/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD17/disk  ONLINE       0     0     0
            /dev/chassis/i86pc.unknown/HDD15/disk  ONLINE       0     0     0
 
errors: No known data errors
cwafseng3 $
The HDDXX entries directly correspond to the physical slots, in this case in Sun x4270M2 server. Compare it to the standard output:
cwafseng3 $ zpool status cwafseng3-0
  pool: cwafseng3-0
 state: ONLINE
  scan: scrub canceled on Thu Apr 12 13:52:13 2012
config:

        NAME                       STATE     READ WRITE CKSUM
        cwafseng3-0                ONLINE       0     0     0
          raidz1-0                 ONLINE       0     0     0
            c3t5000CCA00AC87F55d0  ONLINE       0     0     0
            c3t5000CCA00AAA0D1Dd0  ONLINE       0     0     0
            c3t5000CCA00AA95559d0  ONLINE       0     0     0
            c3t5000CCA00AAAD155d0  ONLINE       0     0     0
            c3t5000CCA015214845d0  ONLINE       0     0     0
            c3t5000CCA015214F85d0  ONLINE       0     0     0
            c3t5000CCA01521070Dd0  ONLINE       0     0     0
            c3t5000CCA0151A287Dd0  ONLINE       0     0     0

errors: No known data errors
cwafseng3 $ 
See also croinfo(1M) for how to get this information (and more) for all disk drives regardless if they are part of zpool or not.