RHEL: Remove existing SAN LUNs

RHEL: Remove existing SAN LUNs

# Tested on RHEL 5 & 6

# Given following LUN, for instance:

multipath -ll
[...]
   3600508b4000971cd0001000022fa0000 dm-0 HP,HSV210
   [size=2.0G][features=0][hwhandler=0][rw]
   \_ round-robin 0 [prio=0][active]
    \_ 1:0:0:3 sdc        8:32   [active][undef]
    \_ 1:0:2:3 sdk        8:160  [active][undef]
    \_ 2:0:0:3 sds        65:32  [active][undef]
    \_ 2:0:1:3 sdw        65:96  [active][undef]
   \_ round-robin 0 [prio=0][enabled]
    \_ 2:0:2:3 sdaa       65:160 [active][undef]
    \_ 2:0:3:3 sdae       65:224 [active][undef]
    \_ 1:0:1:3 sdg        8:96   [active][undef]
    \_ 1:0:3:3 sdo        8:224  [active][undef]



# Run following commands to remove it from the system:

multipath -f 3600508b4000971cd0001000022fa0000
echo 1>/sys/block/sdc/device/delete
echo 1>/sys/block/sdk/device/delete
echo 1>/sys/block/sds/device/delete
echo 1>/sys/block/sdw/device/delete
echo 1>/sys/block/sdaa/device/delete
echo 1>/sys/block/sdae/device/delete
echo 1>/sys/block/sdg/device/delete
echo 1>/sys/block/sdo/device/delete




# Take care of not running any HBA rescan before definitively detaching LUNs from server.
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Epoch & Unix Timestamp Conversion Tools
Viewed 61498 times since Fri, Jun 22, 2018
Configuring VLAN interfaces in Linux
Viewed 5340 times since Mon, May 21, 2018
ZFS: Snapshots and clones on zfs filesystems
Viewed 3003 times since Sun, Jun 3, 2018
How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 3149 times since Fri, Sep 28, 2018
Telnet – Send GET/HEAD HTTP Request
Viewed 3165 times since Mon, Feb 18, 2019
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 5034 times since Fri, Nov 30, 2018
RHEL7: Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot.
Viewed 11838 times since Mon, Aug 6, 2018
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 2394 times since Wed, Oct 17, 2018
HowTo: Create CSR using OpenSSL Without Prompt (Non-Interactive)
Viewed 13913 times since Mon, Feb 18, 2019
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 2613 times since Thu, May 24, 2018