Stale devices shown on the device tree
During the indexing or restore process, sometimes the stale devices that are present in the volume are not cleaned up and are displayed in the device tree.
Workaround:
Unmount any file systems that mounted the device. (If required use force unmount)
If any of the partitions belongs to LVM, then remove the volume group from disk using the vgreduce command and then the pvremove command.
Execute the blockdev -flushbufs command to remove any outstanding reference to that device.
Remove the device references from the device tree. For example, whole/partition disks /dev/xvdf, /dev/disk/by-path, by-id, by-label, by-partuuid and by-uuid
Use the following command to remove the device from sysfs:
echo 1 > /sys/block/device-name/device/delete
Where device-name might be xvdf.
Reboot the host to resolve this issue.