Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have udev rules that creates a directory for each usb-media that is plugged into my debian to automount usb-media. This directory where mount-points (the mount-directories) are created is passed through a rdp-connection with rdesktop. On our terminalserver there's a drive Z that shows all mount-points with content of usb-media.

When users remove usb-media, udev unmounts usb-media and tries to delete the directory that was used to mount usb-media. If the users hasn't closed explorer showing any subfolder of usb-media, the unmount-command succeeds but the rmdir-command fails because the ressource is "busy or used".

My question: how can I force to delete this mountpoint? (rmdir doesn't have force and rm -rf doesn't work)

Edit: I should add, that I can't use third-party software or additional packages because the linux-machine is a thin-client with very low disk-space.

share|improve this question
    
This is not normally a problem. I'd look to Samba for the issue. –  Ignacio Vazquez-Abrams May 13 '11 at 11:39
    
what should I exactly look at? I'm not a linux-professional, I just have a few basic skills... –  wullxz May 13 '11 at 11:51
add comment

1 Answer 1

up vote 1 down vote accepted

The folder that I wasn't able to delete was a mount-point. It wasn't unmounted as I pulled the usb-stick off of the thin-client because the server had the content of that stick shown in explorer. Using the -l switch for umount in the udev-rule helped to force umount when the stick was removed anyway. Deletion of that mount-point wasn't a problem anymore after unmounting the stick.

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.