dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

how to use automounter with thumbdrive - bsd.freebsd.misc

This is a discussion on how to use automounter with thumbdrive - bsd.freebsd.misc ; I've been mounting my thumb drives by hand and would like to use the automounter to do this, both for convenience and also so that I learn how to use the automounter. The usually execellent Handbook has failed to help ...


Home > Database Forum > Operating Systems > bsd.freebsd.misc > how to use automounter with thumbdrive

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 10-30-2008, 08:41 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default how to use automounter with thumbdrive

I've been mounting my thumb drives by hand and would like to use the
automounter to do this, both for convenience and also so that I learn how
to use the automounter. The usually execellent Handbook has failed to help
- it basically just points to the man pages for amd(8) and amd.conf(5), and
these in turn have proved to be totally opaque to me. Can anyone give me
clear directions on how to automount a thumb drive? I currently have
labelled the thumb drive and added an entry in /etc/fstab that allows me
mount the drive manually:

/dev/label/mtd /mtd msdosfs rw,noauto,-M775,-m664,-l

I know that I have to enable the automounter in /etc/rc.conf:

amd_enable="YES"

I am completely mystified about what has to be in /etc/amd.conf and
/etc/amd.map to get this to work.

(And, yes, I *have* googled, and the few examples of how to supposedly do
this are either out of date or otherwise have failed to provide an answer.)

--
Will
Reply With Quote
  #2  
Old 11-06-2008, 04:11 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

On 2008-10-31, Will Parsons wrote:
> I've been mounting my thumb drives by hand and would like to use the
> automounter to do this, both for convenience and also so that I learn how
> to use the automounter. The usually execellent Handbook has failed to help
> - it basically just points to the man pages for amd(8) and amd.conf(5), and
> these in turn have proved to be totally opaque to me. Can anyone give me
> clear directions on how to automount a thumb drive? I currently have
> labelled the thumb drive and added an entry in /etc/fstab that allows me
> mount the drive manually:
>
> /dev/label/mtd /mtd msdosfs rw,noauto,-M775,-m664,-l
>
> I know that I have to enable the automounter in /etc/rc.conf:
>
> amd_enable="YES"
>
> I am completely mystified about what has to be in /etc/amd.conf and
> /etc/amd.map to get this to work.


Hi Will,

Here is my configuration, which is working (for me ):

/etc/amd.conf:
[ global ]
restart_mounts = yes
unmount_on_exit= yes

/etc/amd.map:
flash type:=program;fs:=/mnt/flash;\
mount:="/sbin/mount mount /mnt/flash";\
unmount:="/sbin/umount umount /mnt/flash"

/etc/fstab:
/dev/label/tdk /mnt/flash msdosfs rw,noauto 0 0

/etc/rc.conf:
portmap_enable=YES
portmap_flags="-h 127.0.0.1"
amd_enable=YES
amd_flags="-a /.amd_mnt -c 10 -w 2 -l syslog /media /etc/amd.map"

I used the examples from the amd manual:
http://www.am-utils.org/docs/am-util...16.html#SEC279

and this guide:
http://networking.ringofsaturn.com/U...dautomount.php

Tom

--
Reply With Quote
  #3  
Old 11-06-2008, 07:31 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

Tom Canich wrote:
> On 2008-10-31, Will Parsons wrote:
>> I've been mounting my thumb drives by hand and would like to use the
>> automounter to do this, both for convenience and also so that I learn how
>> to use the automounter. The usually execellent Handbook has failed to help
>> - it basically just points to the man pages for amd(8) and amd.conf(5), and
>> these in turn have proved to be totally opaque to me. Can anyone give me
>> clear directions on how to automount a thumb drive? I currently have
>> labelled the thumb drive and added an entry in /etc/fstab that allows me
>> mount the drive manually:
>>
>> /dev/label/mtd /mtd msdosfs rw,noauto,-M775,-m664,-l
>>
>> I know that I have to enable the automounter in /etc/rc.conf:
>>
>> amd_enable="YES"
>>
>> I am completely mystified about what has to be in /etc/amd.conf and
>> /etc/amd.map to get this to work.

>
> Hi Will,
>
> Here is my configuration, which is working (for me ):
>
> /etc/amd.conf:
> [ global ]
> restart_mounts = yes
> unmount_on_exit= yes
>
> /etc/amd.map:
> flash type:=program;fs:=/mnt/flash;\
> mount:="/sbin/mount mount /mnt/flash";\
> unmount:="/sbin/umount umount /mnt/flash"
>
> /etc/fstab:
> /dev/label/tdk /mnt/flash msdosfs rw,noauto 0 0
>
> /etc/rc.conf:
> portmap_enable=YES
> portmap_flags="-h 127.0.0.1"
> amd_enable=YES
> amd_flags="-a /.amd_mnt -c 10 -w 2 -l syslog /media /etc/amd.map"


Thanks for the reply, but it still doesn't work for me. I modified my
amd.conf, amd.map, fstab, and rc.conf to exactly match yours, with the
single exception of the entry in fstab where I use my disk label:

/dev/label/mtd /mnt/flash msdosfs rw,noauto,-M775,-m664,-l

But still no joy...

--
Will
Reply With Quote
  #4  
Old 11-07-2008, 10:00 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

On 2008-11-06, Will Parsons wrote:
> Tom Canich wrote:
>> On 2008-10-31, Will Parsons wrote:
>>> I've been mounting my thumb drives by hand and would like to use the
>>> automounter to do this, both for convenience and also so that I learn how
>>> to use the automounter. The usually execellent Handbook has failed to help
>>> - it basically just points to the man pages for amd(8) and amd.conf(5), and
>>> these in turn have proved to be totally opaque to me. Can anyone give me
>>> clear directions on how to automount a thumb drive? I currently have


>> /etc/amd.conf:
>> [ global ]
>> restart_mounts = yes
>> unmount_on_exit= yes
>>
>> /etc/amd.map:
>> flash type:=program;fs:=/mnt/flash;\
>> mount:="/sbin/mount mount /mnt/flash";\
>> unmount:="/sbin/umount umount /mnt/flash"
>>
>> /etc/fstab:
>> /dev/label/tdk /mnt/flash msdosfs rw,noauto 0 0
>>
>> /etc/rc.conf:
>> portmap_enable=YES
>> portmap_flags="-h 127.0.0.1"
>> amd_enable=YES
>> amd_flags="-a /.amd_mnt -c 10 -w 2 -l syslog /media /etc/amd.map"


> Thanks for the reply, but it still doesn't work for me. I modified my
> amd.conf, amd.map, fstab, and rc.conf to exactly match yours, with the
> single exception of the entry in fstab where I use my disk label:
>
> /dev/label/mtd /mnt/flash msdosfs rw,noauto,-M775,-m664,-l


Hi Will,

Does /mnt/flash exist? Are amd and portmap running? Any relevant log output?
Does the 'mount /mnt/flash' work?

$ ps -ax | grep 'amd\|rpc'
700 ?? Is 0:00.04 /usr/sbin/rpcbind
702 ?? Ss 0:00.15 /usr/sbin/amd -p -a /.amd_mnt -c 10 -w 2 -l syslog \
/media /etc/amd.map

Tom



--
Reply With Quote
  #5  
Old 11-07-2008, 09:16 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

Tom Canich wrote:
> On 2008-11-06, Will Parsons wrote:
>> Tom Canich wrote:
>>> On 2008-10-31, Will Parsons wrote:
>>>> I've been mounting my thumb drives by hand and would like to use the
>>>> automounter to do this, both for convenience and also so that I learn how
>>>> to use the automounter. The usually execellent Handbook has failed to help
>>>> - it basically just points to the man pages for amd(8) and amd.conf(5), and
>>>> these in turn have proved to be totally opaque to me. Can anyone give me
>>>> clear directions on how to automount a thumb drive? I currently have

>
>>> /etc/amd.conf:
>>> [ global ]
>>> restart_mounts = yes
>>> unmount_on_exit= yes
>>>
>>> /etc/amd.map:
>>> flash type:=program;fs:=/mnt/flash;\
>>> mount:="/sbin/mount mount /mnt/flash";\
>>> unmount:="/sbin/umount umount /mnt/flash"
>>>
>>> /etc/fstab:
>>> /dev/label/tdk /mnt/flash msdosfs rw,noauto 0 0
>>>
>>> /etc/rc.conf:
>>> portmap_enable=YES
>>> portmap_flags="-h 127.0.0.1"
>>> amd_enable=YES
>>> amd_flags="-a /.amd_mnt -c 10 -w 2 -l syslog /media /etc/amd.map"

>
>> Thanks for the reply, but it still doesn't work for me. I modified my
>> amd.conf, amd.map, fstab, and rc.conf to exactly match yours, with the
>> single exception of the entry in fstab where I use my disk label:
>>
>> /dev/label/mtd /mnt/flash msdosfs rw,noauto,-M775,-m664,-l

>
> Hi Will,
>
> Does /mnt/flash exist? Are amd and portmap running? Any relevant log output?
> Does the 'mount /mnt/flash' work?
>
> $ ps -ax | grep 'amd\|rpc'
> 700 ?? Is 0:00.04 /usr/sbin/rpcbind
> 702 ?? Ss 0:00.15 /usr/sbin/amd -p -a /.amd_mnt -c 10 -w 2 -l syslog \
> /media /etc/amd.map


Yes, I created /mnt/flash and can mount it manually without problem. Both
amd and rpcbind are running. There are no messages from amd of any kind in
/var/log/messages. (Incidentally, although I added the portmap entries to
/etc/rc.conf just as you have, I think they may not do anything. It looks
like portmap was renamed to rpcbind at some point in the past, but I
already had rpcbind_enable="YES" in my /etc/rc.conf because I'm using NFS.)

--
Will
Reply With Quote
  #6  
Old 11-08-2008, 09:53 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

On 2008-11-08, Will Parsons wrote:
> Yes, I created /mnt/flash and can mount it manually without problem. Both
> amd and rpcbind are running. There are no messages from amd of any kind in
> /var/log/messages. (Incidentally, although I added the portmap entries to
> /etc/rc.conf just as you have, I think they may not do anything. It looks
> like portmap was renamed to rpcbind at some point in the past, but I
> already had rpcbind_enable="YES" in my /etc/rc.conf because I'm using NFS.)


I think you are right about portmap becoming rpcbind. I've changed rc.conf
to use rpcbind_enable and rpcbind_flags -- this works on my system.

You can turn on debugging by adding "-D all" to amd_flags in rc.conf.

Tom



--
Reply With Quote
  #7  
Old 11-10-2008, 09:14 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

Tom Canich wrote:
> On 2008-11-08, Will Parsons wrote:
>> Yes, I created /mnt/flash and can mount it manually without problem. Both
>> amd and rpcbind are running. There are no messages from amd of any kind in
>> /var/log/messages. (Incidentally, although I added the portmap entries to
>> /etc/rc.conf just as you have, I think they may not do anything. It looks
>> like portmap was renamed to rpcbind at some point in the past, but I
>> already had rpcbind_enable="YES" in my /etc/rc.conf because I'm using NFS.)

>
> I think you are right about portmap becoming rpcbind. I've changed rc.conf
> to use rpcbind_enable and rpcbind_flags -- this works on my system.
>
> You can turn on debugging by adding "-D all" to amd_flags in rc.conf.


No difference - the log file still shows no messages. I've been
re-studying the man pages for amd(8) and amd.conf(5), but nowhere do they
explain exactly what a "map" is or its format. It's very frustrating.

--
Will
Reply With Quote
  #8  
Old 11-11-2008, 01:59 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

On 2008-11-11, Will Parsons wrote:
>
> No difference - the log file still shows no messages. I've been
> re-studying the man pages for amd(8) and amd.conf(5), but nowhere do they
> explain exactly what a "map" is or its format. It's very frustrating.


I used the web manual for am-utils[1] as a reference for amd.map. While
reviewing amd(8) I noticed amq(8), which is the automounter query tool.
It'd be interesting to see what this returns on your system.

Tom


[1] http://am-utils.com/docs/am-utils/am-utils.html


--
Reply With Quote
  #9  
Old 11-12-2008, 06:35 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to use automounter with thumbdrive

Tom Canich wrote:
> On 2008-11-11, Will Parsons wrote:
>>
>> No difference - the log file still shows no messages. I've been
>> re-studying the man pages for amd(8) and amd.conf(5), but nowhere do they
>> explain exactly what a "map" is or its format. It's very frustrating.

>
> I used the web manual for am-utils[1] as a reference for amd.map. While
> reviewing amd(8) I noticed amq(8), which is the automounter query tool.
> It'd be interesting to see what this returns on your system.
>
> [1] http://am-utils.com/docs/am-utils/am-utils.html


I've been playing around with the configuration and now have the following:

In /etc/fstab:

/dev/label/mtd /mtd msdosfs rw,noauto,-M775,-m664,-l

In /etc/amd.conf:

[ global ]
restart_mounts = yes
unmount_on_exit= yes

[ /mtd ]
map_name = amd.map

In /etc/amd.map:

mtd type:=program;fs:=/mtd;\
mount:="/sbin/mount mount /mtd";\
unmount:="/sbin/umount umount /mtd"

In /etc/rc.conf:

amd_enable="YES"
amd_flags="-c 10 -w 2 -l syslog:local0 /mtd /etc/amd.map"

(I discovered that if I explicitly specify a syslog level as above, I do
get messages logged, as shown below.)

Output of amq:
/ root "root" nephthyspid1018)
/mtd toplvl /etc/amd.map /mtd

Log entries in /var/log/local0 (timestamps edited out to save space):

amd[1017]: switched to logfile "syslog:local0"
amd[1017]: AM-UTILS VERSION INFORMATION:
amd[1017]: Copyright (c) 1997-2004 Erez Zadok
amd[1017]: Copyright (c) 1990 Jan-Simon Pendry
amd[1017]: Copyright (c) 1990 Imperial College of Science, Technology & Medicine
amd[1017]: Copyright (c) 1990 The Regents of the University of California.
amd[1017]: am-utils version 6.0.10-20040513 (build 700055).
amd[1017]: Built by root@logan.cse.buffalo.edu on date Sun Feb 24 16:32:16 UTC 2008.
amd[1017]: cpu=i386 (little-endian), arch=i386, karch=i386.
amd[1017]: full_os=freebsd7.0, os=freebsd7, osver=7.0, vendor=unknown.
amd[1017]: Map support for: root, passwd, union, nis, ndbm, file, error.
amd[1017]: AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit, ufs,
amd[1017]: cdfs, pcfs, auto, direct, toplvl, error.
amd[1017]: FS: cd9660, nfs, nfs3, nullfs, msdosfs, ufs, unionfs.
amd[1017]: Network: wire="192.168.1.0" (netnumber=192.168.1).
amd[1017]: My ip addr is 127.0.0.1
amd[1018]: released controlling tty using setsid()
amd[1018]: file server localhost, type local, state starts up
amd[1019]: /mtd: disabling nfs congestion window
amd[1018]: first time load of map /etc/amd.map succeeded
amd[1018]: /etc/amd.map mounted fstype toplvl on /mtd
amd[1018]: reload of map /etc/amd.map is not needed (in sync)

--
Will
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 09:40 AM.