Re: where would i configure an external HD to be automounted?
On Thu, 24 Sep 2009, Robert P. J. Day wrote:
> On Thu, 24 Sep 2009, Vinicius Massuchetto wrote:
>
> > I would check with "mount" how the filesystem was mounted, then
> > add it to /etc/fstab. Is that the case?
>
> nope, found it: an entry in /etc/auto.usb. i *figured* it was an
> automount/autofs issue of some kind.
hmmmmmm ... that didn't solve it and, in the process of debugging, i
ran across something *very* unfamiliar but apparently easily fixable.
to get the maxtor USB HD to automount when plugged in, i copied over
the old autofs-related config files so that the system now has:
/etc/auto.master:
/var/autofs/misc /etc/auto.misc --timeout=5
/var/autofs/net /etc/auto.net
/mnt /etc/auto.usb --timeout=2
/etc/auto.usb:
usbdrive -fstype=ext3,rw,sync :/dev/sdb1
usbdrive2 -fstype=ext3,rw,sync :/dev/sdc1
looks good so far? and i can verify with "fdisk" that the drive
appears as /dev/sdc, with a single linux partition of /dev/sdc1. i
verified that i can manually mount that partition at an arbitrary
directory i created under /tmp. and after i restarted autofs, i get:
=====
# /etc/init.d/autofs status
Configured Mount Points:
------------------------
/usr/sbin/automount --timeout=5 /var/autofs/misc file /etc/auto.misc
/usr/sbin/automount --timeout=300 /var/autofs/net program
/etc/auto.net
/usr/sbin/automount --timeout=2 /mnt file /etc/auto.usb
Active Mount Points:
--------------------
/usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_misc.pid
--timeout=5 /var/autofs/misc file /etc/auto.misc
/usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_net.pid
--timeout=300 /var/autofs/net program /etc/auto.net
/usr/sbin/automount --pid-file=/var/run/autofs/_mnt.pid --timeout=2
/mnt file /etc/auto.usb
=====
would that normally be sufficient? have i forgotten anything?
because i had someone unplug the drive, then plug it back in again and
... nothing. so i tried to *manually* mount the drive under /mnt, but
i was unable to manually create a directory mount point under /mnt.
# mkdir /mnt/rday
mkdir: cannot create directory `/mnt/rday': No such file or directory
#
huh? then i looked more closely:
# ls -ld /mnt
drwxr-xr-x 2 root root 0 2009-09-24 09:04 /mnt
#
a directory size of zero? does that mean that there is no "real"
/mnt directory (similar to /proc and /sys)? i'm confused since i'm
used to /mnt being a real but empty directory. and i'm confused as to
why the drive isn't being mounted at plug-in time.
have i missed something? all of the above looks reasonable. to
what log file would autofs diagnostics go? i can't find any error
msgs.
this looked so straightforward.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
Reply to: