Re: Autofs howto

2009-05-09 Thread Paul Schmehl
--On May 7, 2009 10:16:01 PM -0500 Jason Garrett kinged...@gmail.com 
wrote:



While cryptic, It has worked well for me with multiple FreeBSD and Linux
hosts on my network.



And I'm sure it will for me as well, if I can ever figure it out.  Here's 
how our linux hosts are automounting drives:


cat /etc/auto.master
/home   ldap //foobar.utdallas.edu/nismapname=auto_home,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp
/proj   ldap //foobar.utdallas.edu/nismapname=auto_proj,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp

/net-hosts

How do I translate that into FBSD amd speak?

I have to tell you, the amd docs are not for the faint of heart.

Paul Schmehl, If it isn't already
obvious, my opinions are my own
and not those of my employer.
**
WARNING: Check the headers before replying

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-09 Thread Paul Schmehl
--On May 7, 2009 10:16:01 PM -0500 Jason Garrett kinged...@gmail.com 
wrote:



While cryptic, It has worked well for me with multiple FreeBSD and Linux
hosts on my network.



And I'm sure it will for me as well, if I can ever figure it out.  Here's 
how our Linux hosts are automounting drives.


cat /etc/auto.master
/home   ldap //foobar.utdallas.edu/nismapname=auto_home,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp
/proj   ldap //foobar.utdallas.edu/nismapname=auto_proj,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp

/net-hosts

Can anyone translate that into FBSD amd speak?

I have to tell you, the docs for amd are not for the faint of heart.

Paul Schmehl, If it isn't already
obvious, my opinions are my own
and not those of my employer.
**
WARNING: Check the headers before replying

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-08 Thread Paul Schmehl
--On Thursday, May 07, 2009 22:16:01 -0500 Jason Garrett kinged...@gmail.com 
wrote:



While cryptic, It has worked well for me with multiple FreeBSD and Linux
hosts on my network.



Hopefully it will work well for me too.  However, I am struggling with the 
documentation, trying to figure out how to translate the developer-speak into 
normal human language.


Here's what one of our guys is using on linux (I changed the hostname to 
foobar):


cat /etc/auto.master
/home   ldap //foobar.utdallas.edu/nismapname=auto_home,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp
/proj   ldap //foobar.utdallas.edu/nismapname=auto_proj,dc=utdallas,dc=edu 
nfsvers=3 proto=tcp

/net-hosts

So how do I tranlsate that into FreeBSD amd conf and map files?  It's got me 
stumped.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
Check the headers before clicking on Reply.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-08 Thread Christopher Sean Hilton


On May 8, 2009, at 10:57 AM, Paul Schmehl wrote:

--On Thursday, May 07, 2009 22:16:01 -0500 Jason Garrett kinged...@gmail.com 
 wrote:


While cryptic, It has worked well for me with multiple FreeBSD and  
Linux

hosts on my network.



Hopefully it will work well for me too.  However, I am struggling  
with the documentation, trying to figure out how to translate the  
developer-speak into normal human language.


Here's what one of our guys is using on linux (I changed the  
hostname to foobar):



cat /etc/auto.master
/home   ldap //foobar.utdallas.edu/ 
nismapname=auto_home,dc=utdallas,dc=edu nfsvers=3 proto=tcp
/proj   ldap //foobar.utdallas.edu/ 
nismapname=auto_proj,dc=utdallas,dc=edu nfsvers=3 proto=tcp

/net-hosts



I haven't played with Linux's autofs and when I did my look at it was  
shallow. From what you have here it looks like foobar.utdallas.edu is  
a NFS v3 server that offers a pair of directory hierarchies. He's  
mounting one of them on locally as /home and another as /proj. If you  
want to do that in FreeBSD this should get you going.



*** /etc/amd/amd.conf ***

[ global ]
browsable_dirs =no
map_type =  file
mount_type =nfs
search_path =   /etc

auto_dir =  /.amd
cache_duration =30
log_file =  syslog:daemon
log_options =   fatal,error
print_pid = yes
pid_file =  /var/run/ 
amd.pid

restart_mounts =yes
selectors_in_defaults = no

[ /home ]
map_name =  /etc/amd/ 
home.map


[ /proj ]
map_name =  /etc/amd/ 
proj.map


*** /etc/amd/home.map ***

/defaults   type:=nfs;opts:=tcp,intr,nodev,nosuid,umount,vers=3;\
rhost:=foobar.utdallas.edu;rfs:=/home/${key}

*   fs:=${autodir}/home/${key}

*** /etc/amd/proj.map ***

/defaults   type:=nfs;opts:=tcp,intr,nodev,nosuid,umount,vers=3;\
rhost:=foobar.utdallas.edu;rfs:=/proj/${key}

*   fs:=${autodir}/proj/${key}


---

In the map files you'll need to make sure that the rfs entry matches  
the directory tree that foobar.utdallas.edu is exporting. e.g. if you  
would manually mount the directory under FreeBSD like this:


 # mount_nfs -o tcp,intr,nodev,nosuid foobar.utdallas.edu:/home/ 
pschmehl /home/pschmehl


or the fstab entry that you would use looks like this:

 # foobar.utdallas.edu:/home/pschmehl /home/pschmehl nfs  
noauto,tcp,intr 0 0


Then the rfs entry should look like this:

 ...;rfs:=/home/${key}

This setup assumes that you've exported the directory try with  
FreeBSD's equivalent of the -alldirs option. This option allows you to  
mount any point under the exported tree rather than forcing you to  
mount the entire filesystem. A typical setup on FreeBSD would be to  
export /home with --alldirs then an NFS client can mount /home/ 
cshilton or /home/jbauer or whatever.


Hope this helps

-- Chris

Sorry if I've got some minor bobbles in the syntax on the mount or  
fstab lines.







So how do I tranlsate that into FreeBSD amd conf and map files?   
It's got me stumped.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
Check the headers before clicking on Reply.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org 





--
Chris Hilton   chris-at-vindaloo-dot-com

   All I was doing was trying to get home from work!
-- Rosa Parks

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-08 Thread Michel Talon
Paul Schmehl wrote:

 /home   ldap
 //foobar.utdallas.edu/nismapname=auto_home,dc=utdallas,dc=edu 
 nfsvers=3 proto=tcp

According to the documentation of FreeBSD amd one can use ldap
maps with it (i have no experience of that). The doc is in:
/usr/src/contrib/amd/doc/am-utils.texi 




-- 

Michel TALON

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-08 Thread Paul Schmehl
--On Friday, May 08, 2009 14:56:34 -0500 Christopher Sean Hilton 
ch...@vindaloo.com wrote:


In the map files you'll need to make sure that the rfs entry matches
the directory tree that foobar.utdallas.edu is exporting. e.g. if you
would manually mount the directory under FreeBSD like this:

  # mount_nfs -o tcp,intr,nodev,nosuid foobar.utdallas.edu:/home/
pschmehl /home/pschmehl



I can mount my homedir this way:
# mount_nfs foobar.utdallas.edu:/home/003/p/pa/pauls /mnt/unix_home

I assume this means that this should work:
rfs:=/home/003/p/pa/${key}

And then I cd to /Home/pauls  (there's a section in my amd.conf file named 
[/Home] that has a corresponding map file amd.home which contains the syntax 
for mapping the drive.


# cat /etc/amd.conf | grep -A3 Home
[/Home]
map_type=nfs
map_name=amd.home
mount_type  =autofs

# cat /etc/amd.home
/defaults   type:=nfs;opts:=tcp,intr,nodev,nosuid,umount,vers=3 \
   rhost:olympus.utdallas.edu;rfs:=/home/003/p/pa/${key}

*   fs=${autodir}/${key}

But that fails with a directory does not exist error.

But I can already map my home drive manually.  What I'm trying to figure out is 
how to use our ldap server to mount my home drive so that when/if it gets moved 
again (which happens occasionally) it will still mount and not break.


The Linux construction is:
ldap //rhost/nismapname=auto_home,ldap_base,nfsvers=3,proto=tcp.  I can't for 
the life of me figure out how to get from that syntax to the amd syntax.  But 
since I can't even automount my home using what I thought was the right syntax 
for amd, I guess I need to figure that out first.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
Check the headers before clicking on Reply.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-07 Thread Paul Schmehl
--On Wednesday, May 06, 2009 22:55:23 -0500 Michel Talon 
ta...@lpthe.jussieu.fr wrote:




Paul Schmehl wrote:


I'm wondering if I can use autofs on FreeBSD.  Last time I asked the
question someone said I need amd, which I found rather cryptic.


Indeed it is cryptic, let me gave an example which works:

niobe% cat /etc/amd.conf
[global]
auto_dir= /.amd
log_file= /var/log/amd.log
log_options = error,fatal,user
map_type= file
search_path = /etc
[/Cd]
map_name= amd.cdrom
# For nfs mounts
[/Net]
map_name= amd.net



niobe% cat /etc/amd.cdrom
cdrom   type:=cdfs;opts:=ro,nosuid;dev:=/dev/acd0;fs:=${autodir}/cdrom


niobe% cat /etc/amd.net
/defaults   type:=host;fs:=${autodir}/${rhost};rhost:=${key}
*   opts:=rw,grpid,resvport,nosuid,nodev,soft

Now some comments. I use amd without options so it just uses
/etc/amd.conf to configure itself. When you try to access /Cd
it uses the configuration in /etc/amd.cdrom, and if you try to access
/Net it uses the configuration in /etc/amd.net.

Finally if you try to access /Net/ada for example, the key is ada, and
so is the remote host. It is queried for NFS mounts and everything is
mounted. After
niobe% cd /Net/ada
i have:
niobe% df
...
ada:/ada36196652  26972064  735623279% /.amd/ada/ada
ada:/ada1  287391356 246682696 2610999690% /.amd/ada/ada1
ada:/ada2  288362876 180649856 9306495666% /.amd/ada/ada2
ada:/ada3   99188500  80794628 1327396086% /.amd/ada/ada3
ada:/adm36204684   1682772 32653156 5% /.amd/ada/adm

Note that  autodir is /.amd and fs is ${autodir}/${rhost} as you can
see.

Getting out of /Net/ada those mounts are unmounted.

I hope this helps explaining some of the mysteries of amd.



Indeed it does, and I thank you very much for that example.

--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
Check the headers before clicking on Reply.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-07 Thread Jason Garrett
On Thu, May 7, 2009 at 10:14, Paul Schmehl pschmehl_li...@tx.rr.com wrote:

 --On Wednesday, May 06, 2009 22:55:23 -0500 Michel Talon 
 ta...@lpthe.jussieu.fr wrote:


 Paul Schmehl wrote:

  I'm wondering if I can use autofs on FreeBSD.  Last time I asked the
 question someone said I need amd, which I found rather cryptic.


 Indeed it is cryptic, let me gave an example which works:

 niobe% cat /etc/amd.conf
 [global]
 auto_dir= /.amd
 log_file= /var/log/amd.log
 log_options = error,fatal,user
 map_type= file
 search_path = /etc
 [/Cd]
 map_name= amd.cdrom
 # For nfs mounts
 [/Net]
 map_name= amd.net



 niobe% cat /etc/amd.cdrom
 cdrom   type:=cdfs;opts:=ro,nosuid;dev:=/dev/acd0;fs:=${autodir}/cdrom


 niobe% cat /etc/amd.net
 /defaults   type:=host;fs:=${autodir}/${rhost};rhost:=${key}
 *   opts:=rw,grpid,resvport,nosuid,nodev,soft

 Now some comments. I use amd without options so it just uses
 /etc/amd.conf to configure itself. When you try to access /Cd
 it uses the configuration in /etc/amd.cdrom, and if you try to access
 /Net it uses the configuration in /etc/amd.net.

 Finally if you try to access /Net/ada for example, the key is ada, and
 so is the remote host. It is queried for NFS mounts and everything is
 mounted. After
 niobe% cd /Net/ada
 i have:
 niobe% df
 ...
 ada:/ada36196652  26972064  735623279% /.amd/ada/ada
 ada:/ada1  287391356 246682696 2610999690% /.amd/ada/ada1
 ada:/ada2  288362876 180649856 9306495666% /.amd/ada/ada2
 ada:/ada3   99188500  80794628 1327396086% /.amd/ada/ada3
 ada:/adm36204684   1682772 32653156 5% /.amd/ada/adm

 Note that  autodir is /.amd and fs is ${autodir}/${rhost} as you can
 see.

 Getting out of /Net/ada those mounts are unmounted.

 I hope this helps explaining some of the mysteries of amd.


 Indeed it does, and I thank you very much for that example.

While cryptic, It has worked well for me with multiple FreeBSD and Linux
hosts on my network.


 --
 Paul Schmehl, Senior Infosec Analyst
 As if it wasn't already obvious, my opinions
 are my own and not those of my employer.
 ***
 Check the headers before clicking on Reply.

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
 freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Autofs howto

2009-05-06 Thread Paul Schmehl

I'm going to take another stab at this.

I'm wondering if I can use autofs on FreeBSD.  Last time I asked the question 
someone said I need amd, which I found rather cryptic.  I later discovered that 
there is a amd-utils in ports and an amd directory in contrib under source.


So, is amd a kernel module?  A separate program I compile?  Should I build the 
ports amd-util instead?  Will that give me autofs functionality?


I've searched the web for howtos, but they all seem to be for LInux, not 
FreeBSD.  It even seems the latest stuff for amd on FSBD is for 6.1.  (I just 
upgraded to 7.2 STABLE today.)


Has anyone ever done this?  Is anyone successfully using autofs on FBSD?

--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
Check the headers before clicking on Reply.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Autofs howto

2009-05-06 Thread Roland Smith
On Wed, May 06, 2009 at 06:17:29PM +, Paul Schmehl wrote:
 I'm going to take another stab at this.
 
 I'm wondering if I can use autofs on FreeBSD. 

There is a libautofs library and a mount_autofs program in my 7.2 source
tree, but I'm not sure what it is, since it's not installed or built on
my amd64 box.

 Last time I asked the
 question someone said I need amd, which I found rather cryptic.  I
 later discovered that there is a amd-utils in ports and an amd
 directory in contrib under source.
 
 So, is amd a kernel module?  A separate program I compile? 

It is a program that is part of the base system. See it's manual page;
'man amd'

From amd(8): The amd utility is a daemon that automatically mounts file
systems whenever a file or directory within that file system is
accessed.  File systems are automatically unmounted when they appear to
be quiescent.

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpGMRcDqKLWG.pgp
Description: PGP signature


Re: Autofs howto

2009-05-06 Thread Michel Talon
Paul Schmehl wrote:

 I'm wondering if I can use autofs on FreeBSD.  Last time I asked the
 question someone said I need amd, which I found rather cryptic. 

Indeed it is cryptic, let me gave an example which works:

niobe% cat /etc/amd.conf
[global]
auto_dir= /.amd
log_file= /var/log/amd.log
log_options = error,fatal,user
map_type= file
search_path = /etc
[/Cd]
map_name= amd.cdrom
# For nfs mounts
[/Net]
map_name= amd.net



niobe% cat /etc/amd.cdrom
cdrom   type:=cdfs;opts:=ro,nosuid;dev:=/dev/acd0;fs:=${autodir}/cdrom


niobe% cat /etc/amd.net
/defaults   type:=host;fs:=${autodir}/${rhost};rhost:=${key}
*   opts:=rw,grpid,resvport,nosuid,nodev,soft

Now some comments. I use amd without options so it just uses
/etc/amd.conf to configure itself. When you try to access /Cd
it uses the configuration in /etc/amd.cdrom, and if you try to access
/Net it uses the configuration in /etc/amd.net.

Finally if you try to access /Net/ada for example, the key is ada, and
so is the remote host. It is queried for NFS mounts and everything is
mounted. After 
niobe% cd /Net/ada
i have:
niobe% df
...
ada:/ada36196652  26972064  735623279% /.amd/ada/ada
ada:/ada1  287391356 246682696 2610999690% /.amd/ada/ada1
ada:/ada2  288362876 180649856 9306495666% /.amd/ada/ada2
ada:/ada3   99188500  80794628 1327396086% /.amd/ada/ada3
ada:/adm36204684   1682772 32653156 5% /.amd/ada/adm

Note that  autodir is /.amd and fs is ${autodir}/${rhost} as you can
see. 

Getting out of /Net/ada those mounts are unmounted.

I hope this helps explaining some of the mysteries of amd.



-- 

Michel TALON

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org