[BLFS Trac] #3023: Add new udev rule for automount of USB devices

BLFS Trac trac at linuxfromscratch.org
Sun Jan 31 19:26:16 PST 2010

#3023: Add new udev rule for automount of USB devices
 Reporter:  ringlis      |       Owner:  blfs-book@…                   
     Type:  enhancement  |      Status:  new                           
 Priority:  normal       |   Milestone:  future                        
Component:  BOOK         |     Version:  SVN                           
 Severity:  normal       |    Keywords:                                

Comment(by ringlis):

 After a bit more work a better udev rule.

 I noticed some issues with original.

 Depending on what type of HDDs you use you could end up mounting them
 under /media as well as their normal mount point. You needed to exclude
 their device letter from the rule.  Not exactly my intention.

 Also pumount sometimes would leave the device mounted if you
 inserted/removed the same device several times. You ended up with several
 /dev/sd%1 mounted on the same mount point but with different /dev/sd%1
 assignment.  By changing the pumount argument from /dev/sd%1 to
 /media/usb%n it seems to have resolve this issue.

 So far this new rule mounts/umounts without an issue.  It also removes the
 /media/usb%n directory when you remove the device.

 Using mount to mount the devices you need to have a /etc/fstab entry with
 correct write permissions.  I wanted dynamically mounted usbdrives, mount
 so far will not accomplish this objective.  Now to get the desktop to
 notify me when a drive is inserted.....

Ticket URL: <http://wiki.linuxfromscratch.org/blfs/ticket/3023#comment:1>
BLFS Trac <http://wiki.linuxfromscratch.org/blfs>
Beyond Linux From Scratch

More information about the blfs-book mailing list