For testing purpose I need to simulate a crash of the disk (by detaching it) while other processes are using it.
I tried:
umount -f /srv/node/d1/
It doesn't want to unmount it. It shows me the next message:
umount: /srv/node/d1: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
There several processes which I don't want to stop manually because it will not be a crash. Does somebody know how to just detach a disk in linux? It would be more easy to detach it physically but I am using a virtual machine with virtual disks.
echo "1" >/sys/dev/block/<id>/device/delete
, where<id>
is the id of a block device? – Serge Oct 07 '16 at 14:04scsi_debug
kernel module. Or do you need to test one of your existing real devices? – rudimeier Oct 07 '16 at 14:10umount -l
will leave it mounted for processes that already have it open, but unmount it for all others. – Ole Tange Oct 14 '16 at 10:52