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

Re: where would i configure an external HD to be automounted?



On Thu, 24 Sep 2009, ghammar@sv-phoenix.com wrote:

> Quoting "Robert P. J. Day" <rpjday@crashcourse.ca>:
>
> > 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
> > --
> >
> It should be pretty easy. I have a USB drive that mounts automatically
> (sometimes even when I don't want it to).
>
> 1. Create a directory for your drive to mount to. In this case, it looks like
> you want:
>
> mkdir /mnt/rday
>
> The mount point has to exist before you can mount to it.
>
> 2. Create an entry in /etc/fstab like this:
>
> /dev/sdc1   /mnt/rday   ext3   user,auto,rw,exec,suid,dev	0	0
>
> You can twiddle the options as you need, but this should get you going.
>
> Giff

  no, i don't think i should need to do that.  the *old* system
didn't have an entry in /etc fstab for this.  what i'm puzzled by is
that, if the automounter isn't running, there's *no* /mnt directory on
this system.  i always thought that /mnt should exist as a normal (but
empty) directory.  i'm *guessing* that what i need to do is stop the
automounter, then "mkdir /mnt", then restart the automounter.  i get
the impression that, for the above to work, /mnt must already exist,
and the automounter will be responsible for creating the appropriate
subdirectory mount points.

  does that sound reasonable?  because, as it stands, the automounting
just isn't working.  is anyone else out there using autofs like this?
does the top-level mount directory already exist for you?

rday

p.s.  i'm sure i can simplify this with udev, but i'm trying to simply
reproduce what was on the old system for now.

--



========================================================================
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: