Remove a disk from your OS view

Ref: https://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co


Eject equivalent:

sudo bash -c 'echo 1 > /sys/block/sdX/device/delete'

For NVME drive

sudo bash -c 'echo 1 /sys/block/nvmeX/device/device/remove'


E.g. disable NVME drives

sudo rmmod nvme


Add to blacklist

sudo nano /etc/modprobe.d/blacklist.conf

blacklist nvme

# Apply blacklist
sudo update-initramfs -u