Solved

How to recursively automount

Posted on 2000-02-23
9
447 Views
Last Modified: 2013-12-16
I am looking for a way to recursively automount another machines directories.  Automounting is setup and working for a single directory layer, for example I have a /hosts/spike directory on my local machine that automounts the root directory of the machine spike, ie 'spike:/' when I cd into that directory.

I would like automount to also work for other drives mounted on the spike machine.  For example, the spike machine has another drive that is mount at '/disk1'.  When I cd into my local machines '/hosts/spike/disk1' directory I would like 'spike:/disk1' to be automounted at this point.  Currently '/hosts/spike/disk1' looks like an empty directory.

My current configuration files:
auto.master:
/misc   /etc/auto.misc  --timeout 60
/home   auto.home
/hosts  /etc/auto.hosts

auto.hosts:
spike   spike:/

I have tried adding the line '/hosts/spike    /etc/auto.spike' to the auto.master file, and creating an auto.spike file that contains the entry 'disk1    spike:/disk1', but that didn't work.
0
Comment
Question by:brian1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2553168
Basically you can't automount onto an automount point. You can, however, automount points that aren't a home dir. In my auto.home table I have things like:

levie     chimera.dom.com:/nfs0/levie
src       chimera.dom.com:/nfs0/sources
dist      chimera.dom.com:/attic/dist
chaos     chaos.dom.com:/nfs0/levie
chaos-src chaos.dom.com:/nfs0/sources

/home/levie is my normal home dir, but I have another system that doesn't use NIS+ that has a local home dir for me. I can reference that data by looking at /home/chaos.
0
 

Author Comment

by:brian1
ID: 2555759
But still no way to recursively automount directories?  We have an two older servers here(a SUN and SGI) that recursively automount each others' file systems.  I trying to replace these machines with some newer Linux machines, and would really like this to work.

Anyone out there done this before?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2556340
I'm sorry, I misunderstood what you were asking. Your comment about the Sun's and Sgi's tells me what you meant. Let me check something and I'll be back shortly.
0
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 
LVL 2

Expert Comment

by:ventolin
ID: 2559832
is /etc/exports set up right on spike?
0
 

Author Comment

by:brian1
ID: 2559969
spike is exporting all of its drives with read/write access.  spike is an SGI, and a SUN box is succesfully recursively automounting all of the exported drives.

I can explicitly mount all the drives on spike from a Linux box with the mount command, but cannot recursively automount the drives that are mounted onto spike's root level.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2560039
Okay I found it... Per the man page for autofs(5) which describes the automount map files:

UNSUPPORTED
       The  automounter  does  not support  direct maps or mount
       trees (more than one filesystem to be mounted under a spe­
       cific automount point), and handles SunOS-style replicated
       filesystems only to the extent that mount(8) does.

So as far as Linux is concerned you can't have a multiple mount entry (aka recursive) mount point.
0
 
LVL 2

Expert Comment

by:jeffa072897
ID: 2566431
jlevie's oh so right.

I spent many hours trying to get it to work.
Simply put, it dosen't.
It's on the wish list for the autofs folks.
0
 

Author Comment

by:brian1
ID: 2566469
Thanks for your help with this.  I guess I will pay attention to autofs updates and watch for this feature.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2566494
I'm going to consider this to be the answer as subsequent comments bear it out.

Okay I found it... Per the man page for autofs(5) which describes the automount map files:

UNSUPPORTED
   The  automounter  does  not support  direct maps or mount
   trees (more than one filesystem to be mounted under a spe­
   cific automount point), and handles SunOS-style replicated
   filesystems only to the extent that mount(8) does.

So as far as Linux is concerned you can't have a multiple mount entry (aka recursive) mount point.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question