6. Removing Devices

6. Removing Devices

If remove a device on a target, the driver will normally not remove it automatically. To properly remove a device, perform the following steps:

Procedure 1. Ensuring a Clean Device Removal
  1. Close all users of the device.

  2. Unmount any file systems that mounted the device.

  3. File systems that mounted the device should be unmounted using umount. In addition, you should also remove the device from any dm, md, LVM, multipath or RAID devices using it.

  4. Remove the device from the SCSI layer using:

    echo 1 > /sys/block/<device name>/device/delete

As stated in the previous subsection, the proc interface is deprecated; as such, do not use it.