How to get `lsblk` to recognise that a disk was taken off the system?

0

I have a CentOS 7 server with hot-swap disks.
However, if I take out a disk (which is not mounted, and not part of an md RAID, or an LVM) off the server - lsblk still shows it.

What actions (short of a reboot) can I perform so that lsblk will not show this phantom disk?

boardrider

Posted 2019-10-18T17:27:28.793

Reputation: 615

Is it still plugged in? If so, that's what it's supposed to do. lsblk lists all available block devices, not just those currently in use. Or do you mean you physically unplug the disk and it's still visible with lsblk? – Kefka – 2019-10-18T17:32:42.007

Yes, @Kefka, I physically unplug the disk, and lsblk still lists it. lsblk | wc -l gives the same results with the disk in or out of the machine. – boardrider – 2019-10-18T17:36:38.210

Is this disk connected via IDE, SATA, SCSI, SAS, NVMe, USB? Does dmesg report any new lines at all when you disconnect the disk, or when you connect it again? – user1686 – 2019-10-18T18:07:22.887

No answers