How to safely remove a SAN LUN from a Linux host

7:59 PM

When SAN storage volume needs to be removed from a host running 'multipath' MPIO drivers the LUN needs to be removed in a specific order 
to ensure no errors are generated in /var/log/messages for a LUN that is no longer attached to a host. 
NOTE:   If the storage team removes the LUN BEFORE it is removed from the host there will be a large amount of error messages in /var/log/messages until
the multipath device and all the block devices are removed. 

LUN EXAMPLE (RHEL 6 host).  RHEL 5 hosts devices will be listed as mpath'numeric'  (mpath0, mpath1)

mpathe (36006016044802d00444b3531a8b7e411) dm-5 DGC,VRAID
size=80G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='round-robin 0' prio=130 status=active
| |- 3:0:1:4  sdx  65:112  active ready running
| |- 4:0:1:4  sdcr 69:240  active ready running
| `- 4:0:3:4  sdeb 128:48  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 3:0:0:4  sdf  8:80    active ready running
  `- 4:0:2:4  sddj 71:16   active ready running

The mpath and all block devices will need to be removed BEFORE opening a ticket with the storage team to remove the LUN.
The directory mount point and any Logical Volume Mapping of the mpath device must be removed
  1. Remove the directory mount from /etc/fstab
  2. umount the directory 
  3. Display multpath mpath device,. note all block devices for future removal

          multipath -ll 
          3:0:1:4  sdx  65:112  active ready running      device sdx is the block device

  4. Remove any LVM associateions with the LUN if any exist

    lvremove /dev/'volume group'/'logical volume'
    vgremove (if logical volume is the only LV in the volume group)
    pvremove /dev/mapper/mpath'device'
       
  5. Remove the mpath device from multipath

    multipath -F 'mpath device '   example:  mpathe
  6. Remove all the block devices associated with mpath device  (example: mpathe)

              echo 1 > /sys/block/sdx/device/delete
              echo 1 > /sys/block/sdcr/device/delete
              echo 1 > /sys/block/sdeb/device/delete
              echo 1 > /sys/block/sdf/device/delete
              echo 1 > /sys/block/sddj/device/delete
              after each block device is removed and entry is generated in /var/log/messages for each block device
  7. Confirm no error messages are being generated in /var/log/messages. Look for messages similar to this

             Apr 22 11:55:10 iadxtlydwdb03p kernel: Sense Key : Illegal Request [current] 
             Apr 22 11:55:10 iadxtlydwdb03p kernel: sd 4:0:0:10: [sdhh]  
             Apr 22 11:55:10 iadxtlydwdb03p kernel: Add. Sense: Logical unit not supported
             Apr 22 11:55:10 iadxtlydwdb03p kernel: sd 4:0:0:10: [sdhh] CDB: 
             Apr 22 11:55:10 iadxtlydwdb03p kernel: Read(10): 28 00 02 7f ff f8 00 00 08 00

You Might Also Like

0 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results