Updated: 28 September 2026 · Applies to: AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13 (SAN storage over Fibre Channel or iSCSI, with or without multipath)

Before a storage administrator unmaps a LUN from a server, Linux must stop using it and forget it. If the LUN disappears while the server still has it open, processes can hang and the kernel logs I/O errors. Work through the steps in order; the storage side is last.

Steps

  1. Identify the device and all its paths. With multipath, one mpath device has several sdX paths:
    multipath -ll
    lsblk
    Write down the multipath name (for example mpathb) and its path devices (for example sdc and sdd).
  2. Stop using it:
    • Unmount its file systems and remove them from /etc/fstab.
    • If it is an LVM physical volume, move the data away and remove it from the volume group: pvmove /dev/mapper/mpathb (if needed), then vgreduce vgname /dev/mapper/mpathb and pvremove /dev/mapper/mpathb.
    • Stop any database or application that uses it as a raw device.
  3. Flush and remove the multipath device:
    multipath -f mpathb
    Without multipath, flush the single disk instead: blockdev --flushbufs /dev/sdc.
  4. Remove each path device from the kernel:
    echo 1 > /sys/block/sdc/device/delete
    echo 1 > /sys/block/sdd/device/delete
  5. For iSCSI, also log out of the target and delete its record (see how to delete an iSCSI target on the initiator).
  6. Check that the devices are gone: lsblk and multipath -ll.
  7. Now ask the storage administrator to unmap the LUN from this server.

Common problems

  • "map in use" from multipath -f: something still has the device open. Check findmnt, pvs, lsof /dev/mapper/mpathb and dmsetup ls --tree for layers such as LVM volumes on top.
  • The paths come back: the LUN is still mapped on the storage side and a rescan found it. Remove it again after it has been unmapped.
  • I/O errors after the LUN was removed too early: remove the stale paths as in step 4 and check that no file system is still mounted from it.

To add a new LUN, see how to scan for new LUNs with multipath.

Official documentation: Removing a storage device (Red Hat).

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)