Pages

How to Remove a LUN online


To remove a LUN on-line follow the below steps 

Identify the LUN that need to be removed

# lsscsi -g
[3:0:0:0]    storage HP       HSV300           1000  -         /dev/sg0
[3:0:0:1]    disk    HP       HSV300           1000  /dev/sda  /dev/sg1
[4:0:0:0]    disk    HP       HSV300           1000  /dev/sdb  /dev/sg2

Or use the Command sg_map ( sg_map is part of optional package sg3utils )

# sg_map -x
/dev/sg0  3 0 0 0  5  /dev/scd0
/dev/sg1  3 0 1 0  0  /dev/sda
/dev/sg2  4 0 0 0  0  /dev/sdb

To Remove the Disk /dev/sdb Use any of the below commands

echo "scsi remove-single-device 4 0 0 0" > /proc/scsi/scsi

or

echo 1 > /sys/block/sdb/device/delete

or

echo 1 >/sys/class/scsi_device/4:0:0:0/device/delete

or


echo 1 > /sys/class/scsi-generic/sg2/device/delete


No comments:

Post a Comment