Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I am using udev rules for creating a directory as mount point when a usb stick connected and remove this directory when disconnected. What I am not sure how ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2012
    Posts
    2

    udev - Remove mount directory after boot.


    Hello,

    I am using udev rules for creating a directory as mount point when a usb stick connected and remove this directory when disconnected. What I am not sure how to do is if the computer is turned off / hard power down and usb stick is removed, the directory which was created for usb's mount point remains there on the boot.

    Is there a clean way doing this with udev rules or do I have to write a service script which would control if the usb stick is connected or not and remove the directory accordingly on the start up?

    Thanks,

  2. #2
    Just Joined!
    Join Date
    May 2012
    Posts
    2
    what I found so far is removing the directory in boot.local if nothing is mounted on that directory.

  3. #3
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    214
    Moi nwps,

    Usually, the udev rule handles all this and you should see a directory created that has a name equal to, or similar to, the label on the stick.

    Set up your SuSE desktop to automount the removables.

    You will see that when the stick is inserted, you will get a notification and a choice of what to do next. Choose as appropriate and the*stick will be mounted for you. This is usually at /media/STICKNAME.

    Remove the stick and the directory will disappear also.

    Cheers - VP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •