Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ubuntu 12.04.1 LTS

I'm about to set up udev rules to automatically mount/umount an external USB drive when plugged or unplugged.

I'm concerned that by using udev to automatically unmount the filesystem, it could cause the file system to be corrupted if there is an outstanding IO.

Surely it is too late to umount the file system after it has already been unplugged?

Should I manually umount the file system? Will it cause an error if I umount the file system, and the udev rules also try to umount it when it is unplugged?

Thanks for any help!

share|improve this question

Seeing as no-one has said I don't need to manually unmount the USB external drive before unplugging it, I'm going to assume I should.

I've got the udev rules working now so it automatically mounts & unmounts the file system when plugged or unplugged. There are no error msgs given or shown anywhere in /var/log that I can find, when I manually unmount the file system and the udev rules also try to unmount it when it is unplugged.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.