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.

I used to work for a long time with ubuntu 10.10 and I changed to a recent machine so I had to move to Ubuntu 13.04. One feature I'm now missing is the auto umount of usb drives. I've not been able to find easy info on internet.

share|improve this question
1  
Welcome to Ask Ubuntu pubpub! It's great that you are posting this, although you put in the question/answer form. So you should edit your post to only make it a "question", and then answer your own question =). –  Alaa Aug 10 '13 at 17:59
    
Since there is no question, shouldn't this be on a personal blog? –  mikewhatever Aug 10 '13 at 17:59
    
Thanks for your help. I have no blog and I found askubuntu so usefull when you have a question that I prefered to post data on it ;) –  pubpub Aug 13 '13 at 10:20
add comment

1 Answer

pubpub solution (after I edited his question):

Creating /etc/udev/rules.d/80-usb-autounmount.rules:

# Auto-unmount USB storage (on remove):
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd??", RUN+="/usr/bin/logger  auto umounting  %k"
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd??", RUN+="/bin/umount /dev/%k"
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd??", RUN+="/bin/umount -lf /dev/%k"
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd???", RUN+="/usr/bin/logger  auto umounting  %k"
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd???", RUN+="/bin/umount /dev/%k"
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sd???", RUN+="/bin/umount -lf /dev/%k"*

Of course you still have to be carefull about opened files mainly in writing.

Hope it will help others.

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.