How to remove ghost LUN in Solaris

sometimes we have leftover phantom or ghost luns:

Removing a ghost LUN in Solaris – First make sure it’s not in use

First thing I do is make sure that the disk isn’t under control of STMS or Veritas. The two most likely disk management packages. 

# stmsboot -L 

or

# vxdisk list  whatever_disk

If the disks are under control of STMS, then you have to remove it from it’s control:

# stmsboot -d

which disabled STMSBOOT from all devices. If you want to be specific, as in disable for one controller:

# stmsboot -d controller whatever

If you are under the control of veritas, do something like:

 # vxdisk rm whatever_disk_path

Removing a ghost LUN in Solaris – Make sure kernel has let go

Try to confirm that the device isn’t stuck in the kernel. So quick and dirty, identify the WWN of the LUN in question.

# ls -l /dev/rdsk/c1t5006016246EA0EFd3s0 lrwxrwxrwx   1 root     root          76 Jan 26 09:45 /dev/rdsk/c1t5006016246EA0EFd3s0 -> ../../devices/pci@1,700000/SUNW,qlc@0/fp@0,0/ssd@w5006016246eA0EF,1:c,raw

So it looks like the disk WWN I’m looking for is 5006016246ea0ef.  I will now use cfgadm to show the FCP devices

# cfgadm -al -o show_FCP_dev | egrep 5006016246ea0ef c1::5006016246ea0ef,0         disk         connected    configured   unknown c1::5006016246ea0ef,1         disk         connected    configured   failing c3::5006016246ea0ef,0         disk         connected    configured   unknown c3::5006016246ea0ef,1         disk         connected    configured   failing 

That’s a lot of output, but it showw me that there is an unknown disk unknown c1::5006016246ea0ef,1 that is failing. Among other things. You can try and hit the device up with cfgadm and mark the devices as unusable and  unconfigure them. So lets try to remove these devices with cfgadm unconfigure, using the controller:wwwn syntax:

# cfgadm -o unusable_FCP_dev -c unconfigure c1::5006016246ea0ef

# cfgadm -c unconfigure c1::5006016246ea0ef
cfgadm: Library error: failed to offline: /devices/pci@1,700000/SUNW,qlc@0/fp@0,0/ssd@w5006016246ea0ef,1

 print its vtoc:

# prtvtoc /dev/rdsk/c1t5006016246EA0EFd3s0
Unable to read Disk geometry errno = 0x5

Tryingg to format or access the disk fails as well

Removing a ghost LUN in Solaris – once and for all

Lets hit the disk with luxadm, try to offline the disk and then unconfigure the controller:disk combination.

# luxadm -e offline /dev/rdsk/c1t5006016246EA0EFd3s0
# cfgadm -c unconfigure c1::5006016246eA0EF

lf you several  LUN’s that are ghosted on your system, repeat the above steps for each LUN. Then run the devfsadm -Cv

# devfsadm -Cv

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Best Buy Co, Inc.
Best Buy Co, Inc.
Best Buy Co, Inc.