2

I have debian system that auto mounts an entry in my fstab file when a usb drive is connected.

  • This is done so as a read only device
  • The device is mounted to /media/usb1

If i'm in the console and I cd /media/usb1 then unplug the device the contents of the directory are still listed, I'm assuming the umount command (or somethigng similar) fails. This does not happen if i'm not in that directory while pulling out the usb drive.

I do understand that you should umount the drive before removing it, however this is going to run headless and that won't be an option (think automated picture screen). Is there a way to force the drive to unmount in a situation like this?

I believe the OS is using udev & udisks to auto mount/unmount.

1 Answer 1

1

The -f parameter for umount will always attempt to force an unmount.

(however this will most likely have very unintended side-effects.)

I would not recommend using this method and I would also recommend that you run sync before running umount -f if you are happy to play rough.

The directory listing behaviour you are describing is most likely a side-effect of some caching behaviour in your shell program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .