This is an old revision of the document!
Iscsi
General Information
iSCSI operations on Linux.
Checklist
- Enterprise Linux 6
Clean Device Removal
Red Hat's recommended procedure for removing storage devices.
- Ensure all files open on the device are closed
lsof | grep <devname>
- Backup/move data as needed
- Remove device from any software RAID or LVM volume
- Remove device from multipath
- Flush outstanding I/O (important for raw devices)
blockdev --flushbufs <device>
- Remove references to the device from applications, scripts, etc.
- Remove each path to the device from the SCSI subsystem
echo 1 > /sys/block/<device-name>/device/delete
- Where <device-name> can be something like 'sde'
iSCSI Admin
Example iscsiadm commands.
View iscsi target node IP addresses and target names
iscsiadm --mode node
Enable iscsi target: Login to iscsi target
iscsiadm --mode node --targetname <iscsi-target-name> --portal 192.168.1.100:3260 --login
Disable iscsi target: Logout from iscsi target
iscsiadm --mode node --targetname <iscsi-target-name> --portal 192.168.1.100:3260 --logout
Delete iscsi target
iscsiadm --mode node -o delete --targetname <iscsi-target-name> --portal 192.168.1.100:3260
Related Multipath Commands
If the iSCSI device that is removed is also multipath'd, remove it from multipath configuration also.
View multipath devices
multipath -ll
Remove (flush) an unused multipath device
multipath -F
After, restart multipathd to ensure it doesn't come back
service multipathd restart