Hello,
I'm wanting to convert our environment from static fstab entries to autofs.
One of the problems I ran into while testing things is I can't change any existing paths in use by the company today - the pipeline code has paths hard coded in, along with other legacy reasons.
Currently with fstab, under /mnt we statically mount 3 main directories:
/mnt/editorial
/mnt/library
/mnt/projects
We want to change these to be controlled by automount.
The editorial and library base dirs operate as expected with automount, and have no special requirements. Mounting the base of them is what we want and works.
If we were to cd into /mnt/projects (while statically mounted via fstab) we would see our project directories, example:
/mnt/projects/apple_vex
/mnt/projects/starwars
/mnt/projects/ironman23
We want to change this behaviour, so only the project dir accessed will mount. (similar to how the homedirs map only mounts the user dir, not the base of user dirs) But the "legacy" path is causing this not to work.
auto.master:
/usr/people /etc/auto.home
/mnt/projects /etc/auto.projects
/mnt /etc/auto.production
auto.production
editorial -fstype=nfs,rw storage1.work.com:/editorial
library -fstype=nfs,rw storage1.work.com:/library
auto.projects
* -fstype=nfs,rw storage1.work.com:/projects/&
auto.home
* -fstype=nfs,rw,vers=3,sec=sys homedirs.work.com:/usr/people/&
The above auto.projects doesn't work as the directory /mnt/projects doesn't exist and you can't make it, which makes sense. This is what we are trying to solve, if its solvable.
[root@lnx-greg ~]# mkdir /mnt/projects
mkdir: cannot create directory ‘/mnt/projects’: Permission denied
And autofs can't help us if we try to cd into a project dir:
[root@lnx-greg ~]# cd /mnt/projects/testshow
-bash: cd: /mnt/projects/testshow: No such file or directory
/mnt <-- auto.production
/mnt/projects <-- auto.projects
In summary my question is: Are you aware of a way or workaround so a dir under an existing autofs mount-point can be the mount-point of another autofs map? We want to be able to cd into /mnt/projects/starwars and only have the sub dir starwars mount instead of the /mnt/projects directory itself (/mnt/projects vs /mnt/projects/starwars).
I understand you can't mount over an existing mount normally, but thought there may be some autofs magic we could use.
hope i'm making sense here.
thanks,
-greg