[kwlug-disc] does autofs need /mnt to exist first?

Robert P. J. Day rpjday at crashcourse.ca
Thu Sep 24 12:09:42 EDT 2009

  trying to make a long story as short as possible -- autofs,
attempting to automount an external USB hard drive the instant it's
plugged in.


/var/autofs/misc	/etc/auto.misc			--timeout=5
/var/autofs/net		/etc/auto.net
/mnt			/etc/auto.usb   		--timeout=2


usbdrive        -fstype=ext3,rw,sync                 :/dev/sdb1
usbdrive2       -fstype=ext3,rw,sync                 :/dev/sdc1

  however, plugging in the drive fails to mount it because
(speculation here) the directory /mnt doesn't exist.  when autofs is
started, /mnt is created thusly:

# ls -ld /mnt
drwxr-xr-x 2 root root 0 2009-09-24 12:06 /mnt
                       ^ ?????????

  that just looks wrong to me -- a directory of size zero?  that
resembles /sys and /proc.  and with those attributes, i can't even
"mkdir" a new directory under there:

# mkdir /mnt/rday
mkdir: cannot create directory `/mnt/rday': No such file or directory

  is that the problem?  for autofs to mount stuff under /mnt, must
/mnt already exist as a *regular* directory?  because i've never seen
a system lately that didn't have /mnt as a regular directory.


Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

More information about the kwlug-disc mailing list