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
- Identify the device and all its paths. With multipath, one
mpathdevice has severalsdXpaths:multipath -ll lsblk
Write down the multipath name (for examplempathb) and its path devices (for examplesdcandsdd). - 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), thenvgreduce vgname /dev/mapper/mpathbandpvremove /dev/mapper/mpathb. - Stop any database or application that uses it as a raw device.
- Unmount its file systems and remove them from
- Flush and remove the multipath device:
multipath -f mpathb
Without multipath, flush the single disk instead:blockdev --flushbufs /dev/sdc. - Remove each path device from the kernel:
echo 1 > /sys/block/sdc/device/delete echo 1 > /sys/block/sdd/device/delete
- For iSCSI, also log out of the target and delete its record (see how to delete an iSCSI target on the initiator).
- Check that the devices are gone:
lsblkandmultipath -ll. - 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/mpathbanddmsetup ls --treefor 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
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
