LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-28-2016, 10:49 AM   #1
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Autofs ampersand mount in hostfield


Hi all,

I've read the following:
Code:
*         mysever:/export/home/&
I understand that the key would be used as the path on the remote server so: /export/home/keyvalue

However I don't get how this works:
Code:
*         &:/export/home/&
Quote:
You can use the ampersand character to represent both the remote server and the remote subdirectory, in the same line of the indirect map. For example, if the user’s home directories are physically located on many different servers, but the directory under which the home directories are located is called /export/home/servername on all the servers, the following line in the /etc/auto_home map mounts all the users home directories from any server:
So how does autofs know what all those NFS servers are? There is no definition of what NFS servers to use.

I'm probably missing something obvious here.
 
Old 01-29-2016, 01:10 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,793

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
It will substitute all & by the key.
Say the map is rooted in /home according to auto.master then going to /home/user1 will do
Code:
user1      user1:/export/home/user1

Last edited by MadeInGermany; 01-29-2016 at 01:12 AM.
 
Old 01-29-2016, 07:36 AM   #3
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Original Poster
Rep: Reputation: 79
Quote:
Originally Posted by MadeInGermany View Post
It will substitute all & by the key.
Say the map is rooted in /home according to auto.master then going to /home/user1 will do
Code:
user1      user1:/export/home/user1
Thanks for your reply.
I really wonder why you would ever use that. It's not like you have a server for each user.
And the quote
Quote:
if the user’s home directories are physically located on many different servers ...
looks misleading to me and not clear.
 
Old 01-29-2016, 08:39 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
I think where your thinking is going wrong is in assuming that the key will always represent a user. For a user home directory export it certainly doesn't make much sense, but if you had a bunch of servers, each exporting a /export/$hostname then an indirect "* &:/export/&" map attached at /servers may actually be useful.

Last edited by GazL; 01-29-2016 at 08:54 AM.
 
Old 01-29-2016, 04:14 PM   #5
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Original Poster
Rep: Reputation: 79
Quote:
Originally Posted by GazL View Post
I think where your thinking is going wrong is in assuming that the key will always represent a user. For a user home directory export it certainly doesn't make much sense, but if you had a bunch of servers, each exporting a /export/$hostname then an indirect "* &:/export/&" map attached at /servers may actually be useful.
Ow yes yes yes Thanks! That makes it clear.
It just looks a bit weird to do an export on the server that has the same directory name as the server itself. It could be as well /nfsexport(on each server), ...
And then this on the autofs client side would work too
Quote:
* &:/nfsexport/
.

Thanks for clarifying!
 
Old 01-29-2016, 05:12 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by deadeyes View Post
It just looks a bit weird to do an export on the server that has the same directory name
Yes, I know what you mean, and I don't think anyone would use that naming scheme on a standalone server as there's no point, but if you had a 2 node cluster where the nodes provide mutual application fail-over for each other, in the event of failure you could potentially end up with both /export/hostname-1 and /export/hostname-2 on the same node at the same time, so you couldn't use the same name for the directory. Of course, this was the way things were done in the pre-virtualisation/containerisation days. I expect you'd just move the whole virtual machine image across nowadays, but this was how it was done before virtual-machines came along. I installed and supported a couple of warehouse management systems on clusters that worked just like this back in the good old days.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple NFS mount using autofs luxaterna Linux - Newbie 4 04-21-2013 08:14 PM
Autofs Mount problem kernelzack Linux - Software 1 04-22-2010 11:22 AM
how to use autofs to mount ntfs carlcs Linux - Newbie 10 04-22-2008 08:12 AM
autofs doesn't mount my CD rwcooper Linux From Scratch 3 07-12-2007 07:44 PM
how to mount fstab vs autofs rrich100 Red Hat 1 11-13-2003 11:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration