Remove LUN from RHEL Host
10:05 PM
Removing multipath map from RHEL Host without rebooting
Remove the multipath map (multipath -f 'device' )
Delete the devices (echo 1 > /sys/block/'device'/device/delete)
Discover multipath map with /sbin/multipath -ll and identify the multipath map to be removed. In this example mpath1 is to be removed.
NOTE: You MUST keep track of the disks for the multipath map you wish to remove. (in this example its /dev/sdf, /dev/sdg, and /dev/sdh)
mpath2 (3600601606b922e00f024cb3957ece111) dm-2 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
_ round-robin 0 [prio=2][active]
_ 2:0:1:0 sde 8:64 [active][ready]
_ 1:0:1:0 sdc 8:32 [active][ready]
_ round-robin 0 [prio=0][enabled]
_ 1:0:0:0 sdb 8:16 [active][ready]
_ 2:0:0:0 sdd 8:48 [active][ready]
mpath1 (350002ac000ff0ac1) dm-3 3PARdata,VV
[size=100G][features=1 queue_if_no_path][hwhandler=0][rw]
_ round-robin 0 [prio=3][active]
_ 1:0:2:0 sdf* *8:80 [active][ready]
_ 1:0:3:0 sdg* *8:96 [active][ready]
_ 2:0:2:0 sdh* *8:112 [active][ready]
Flush the multipath map with mulipath -f
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/multipath -f mpath1 (multipath disk mpath1 is now removed)
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/multipath -ll
mpath2 (3600601606b922e00f024cb3957ece111) dm-2 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
_ round-robin 0 [prio=2][active]
_ 2:0:1:0 sde 8:64 [active][ready]
_ 1:0:1:0 sdc 8:32 [active][ready]
_ round-robin 0 [prio=0][enabled]
_ 1:0:0:0 sdb 8:16 [active][ready]
_ 2:0:0:0 sdd 8:48 [active][ready]
Confirm device no longer exists in /dev/mapper
[mioliver@ashstrfshdb02p ~]$ ls -la /dev/mapper/
total 0
drwxr-xr-x 2 root root 140 Nov 5 11:39 .
drwxr-xr-x 13 root root 4060 Nov 5 11:39 ..
crw------- 1 root root 10, 60 Aug 23 10:41 control
brw-rw---- 1 root disk 253, 2 Aug 23 15:03 mpath2
brw-rw---- 1 root disk 253, 5 Aug 23 15:05 mpath2p1
brw-rw---- 1 root disk 253, 1 Aug 23 14:42 vg_root-lv_data
brw-rw---- 1 root disk 253, 0 Aug 23 14:42 vg_root-lv_root
Once the multipath map is removed the disks for mpath1 still remain and must be deleted from the host
Example, /dev/sdf still exists
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdf
Disk /dev/sdf: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 13054 104856223+ 83 Linux
Delete the disk(s) to remove all traces of the multipath map by sending '1' to each block device and confirm it no longer exists
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdf/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdf
[mioliver@ashstrfshdb02p ~]$
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdg/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdg
[mioliver@ashstrfshdb02p ~]$
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdh/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdh
[mioliver@ashstrfshdb02p ~]$
Now storage can remove the old LUN without the host knowing about it or any multuipath checks showing a failed path.
Remove the multipath map (multipath -f 'device' )
Delete the devices (echo 1 > /sys/block/'device'/device/delete)
Discover multipath map with /sbin/multipath -ll and identify the multipath map to be removed. In this example mpath1 is to be removed.
NOTE: You MUST keep track of the disks for the multipath map you wish to remove. (in this example its /dev/sdf, /dev/sdg, and /dev/sdh)
mpath2 (3600601606b922e00f024cb3957ece111) dm-2 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
_ round-robin 0 [prio=2][active]
_ 2:0:1:0 sde 8:64 [active][ready]
_ 1:0:1:0 sdc 8:32 [active][ready]
_ round-robin 0 [prio=0][enabled]
_ 1:0:0:0 sdb 8:16 [active][ready]
_ 2:0:0:0 sdd 8:48 [active][ready]
mpath1 (350002ac000ff0ac1) dm-3 3PARdata,VV
[size=100G][features=1 queue_if_no_path][hwhandler=0][rw]
_ round-robin 0 [prio=3][active]
_ 1:0:2:0 sdf* *8:80 [active][ready]
_ 1:0:3:0 sdg* *8:96 [active][ready]
_ 2:0:2:0 sdh* *8:112 [active][ready]
Flush the multipath map with mulipath -f
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/multipath -f mpath1 (multipath disk mpath1 is now removed)
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/multipath -ll
mpath2 (3600601606b922e00f024cb3957ece111) dm-2 DGC,VRAID
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
_ round-robin 0 [prio=2][active]
_ 2:0:1:0 sde 8:64 [active][ready]
_ 1:0:1:0 sdc 8:32 [active][ready]
_ round-robin 0 [prio=0][enabled]
_ 1:0:0:0 sdb 8:16 [active][ready]
_ 2:0:0:0 sdd 8:48 [active][ready]
Confirm device no longer exists in /dev/mapper
[mioliver@ashstrfshdb02p ~]$ ls -la /dev/mapper/
total 0
drwxr-xr-x 2 root root 140 Nov 5 11:39 .
drwxr-xr-x 13 root root 4060 Nov 5 11:39 ..
crw------- 1 root root 10, 60 Aug 23 10:41 control
brw-rw---- 1 root disk 253, 2 Aug 23 15:03 mpath2
brw-rw---- 1 root disk 253, 5 Aug 23 15:05 mpath2p1
brw-rw---- 1 root disk 253, 1 Aug 23 14:42 vg_root-lv_data
brw-rw---- 1 root disk 253, 0 Aug 23 14:42 vg_root-lv_root
Once the multipath map is removed the disks for mpath1 still remain and must be deleted from the host
Example, /dev/sdf still exists
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdf
Disk /dev/sdf: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 13054 104856223+ 83 Linux
Delete the disk(s) to remove all traces of the multipath map by sending '1' to each block device and confirm it no longer exists
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdf/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdf
[mioliver@ashstrfshdb02p ~]$
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdg/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdg
[mioliver@ashstrfshdb02p ~]$
[mioliver@ashstrfshdb02p ~]$ echo 1 |sudo tee /sys/block/sdh/device/delete
[mioliver@ashstrfshdb02p ~]$ sudo /sbin/fdisk -l /dev/sdh
[mioliver@ashstrfshdb02p ~]$
Now storage can remove the old LUN without the host knowing about it or any multuipath checks showing a failed path.
0 comments