Re: Automounting USB drives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2003-11-19 at 23:10, Jason Dixon wrote:
> Hi folks:
> 
> I know there are plenty of folks that use removable USB flash media
> and/or USB external drives, so I'm hoping someone has solved this.  I'm
> attempting to have automount mount a Maxtor external USB drive when it's
> plugged in, and unmounted when it's unplugged.
> 
> With the following entry in /etc/fstab, I have no problem manually
> mounting the drive with "mount /mnt/usb":
> 
> /dev/sda1      /mnt/usb       auto    defaults   0 0
> 
> However, autofs/automount isn't showing anything when attempting to let
> it automount the drive (yes, it's already been umounted).  Here's the
> configuration:
> 
> [/etc/auto.master]
> /mnt/usb /etc/auto.usb  --timeout=10
> 
> [/etc/auto.usb]
> usb     -fstype=auto    :/dev/sda1
> 
your auto.master file is almost right... you are saying to 'watch'
/mnt/usb.  when it sees activity in the usb directory (of /mnt/usb) then
it will make the mount.  In other words, nothing happens until you 'cd
/mnt/usb/usb/'

Probably what you're trying to do is just automount when you 'cd
/mnt/usb'... so change your auto.master to just monitor the /mnt
directory.  Then auto.usb says that when the 'usb' (/mnt/usb) directory
is accessed to make the mount.

Also one important thing to note... /mnt/usb won't show up until it is
actually mounted... so don't just 'cd /mnt' and 'ls' and see that 'usb'
doesn't exist and give up.... still 'cd usb' to make the mount happen.

Good Luck!
Brent




> After doing a "service autofs restart", mount and "service autofs
> status" both show it as being automounted, but an "ls /mnt/usb" reports
> nothing...
> 
> [jason@lappy ~]$ mount | grep usb
> usbdevfs on /proc/bus/usb type usbdevfs (rw)
> automount(pid14078) on /mnt/usb type autofs (rw,fd=5,pgrp=14078,minproto=2,maxproto=3)
> 
> [jason@lappy ~]$ sudo service autofs status | grep -v '^$'
> Configured Mount Points:
> ------------------------
> /usr/sbin/automount --timeout 10 /mnt/usb file /etc/auto.usb
> Active Mount Points:
> --------------------
> /usr/sbin/automount --timeout 10 /mnt/usb file /etc/auto.usb
> 
> [jason@lappy ~]$ ls /mnt/usb/
> [jason@lappy ~]$
> 
> 
> Any ideas or suggestions?  Thanks,
> 
> -- 
> Jason Dixon, RHCE
> DixonGroup Consulting
> http://www.dixongroup.net
-- 
Brent Langston <brentley@xxxxxxxxxxxx>
GPG ID: 1024D/09D551AC  
Fingerprint: A05E 32DF 9EDF 45F3 25AA 3E74 7678 CE7A 09D5 51AC

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux