I have an external disk connected via USB that was accidentally disconnected uncleanly. Now ls
ing the directory in which it was mounted gives Input/output error
. umount
ing the directory simply hangs. dmesg just contains:
[3360010.363235] usb 2-1.1: USB disconnect, device number 3
How do I resolve this (short of rebooting), i.e. how do I clean up kernel state upon unclean disconnect of an external storage device?
Lazy unmount usually does the trick.
For more info try
man umount
.You should also be able to do
From
man umount
:Just posting this here in hopes that it might help someone reading this in the future. I had a share mapped to
/tmp/delete-me
and anytime I'd type out the share path,/tmp/delete-m_
it would stop before I could complete typing the full name. This is why the suggestions on force unmounting won't work.My workaround was to first set a variable using the
read
built-in command, and then unmount using the variable name.