Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.