The configuration you have is called indirect maps:
Indirect maps, create-mount points as subdirectories inside the main mount-point.
in this configuration, you are telling autofs in the auto.master
file:
/mnt/server /etc/auto.server --timeout=6000 --ghost
to look in /etc/auto.server
and mount under the main mount point of /mnt/server
(not /mnt
) ... and in the auto.server
file you have:
server -fstype=cifs,uid=1000,gid=1000,forceuid,forcegid,credentials=/etc/auto.auth ://10.0.0.10/share
server
being the name(of this mount point) ... so you get the expected result of:
/mnt/server/server
Change your auto.master
line to:
/mnt /etc/auto.server --timeout=6000 --ghost
and you will get what you want:
/mnt/server
Furthermore, why use two files autu.server1
and auto.server2
for the same main mount point and why two lines in auto.master
for the same main mount point … combine the two files in one auto.server
file with two lines like so:
server1 -fstype=cifs,uid=1000,gid=1000,forceuid,forcegid,credentials=/etc/auto.auth ://10.0.0.10/share
server2 -fstype=cifs,uid=1000,gid=1000,forceuid,forcegid,credentials=/etc/auto.auth ://10.0.0.20/share
and make the two lines in auto.master
into just one line referencing auto.server
like so:
/mnt /etc/auto.server --timeout=6000 --ghost
then, run :
sudo service autofs reload
to read the new changes.
Important notice:
Don't use any main mount-point that you specify in auto.master
with another mount service e.g. the default Ubuntu Disk Manager udisks
that is involved in user automatic(when connecting a USB disk) or manual(when clicking on the mount button in the GUI file manager or when issuing a mount ...
command in the terminal).
automount
is the program used to configure a mount point for autofs
. When autofs
is started, an automount
daemon is spawned for each map.
As you can see these are two different system services/animal species(metaphorically speaking) ... if you point them at each others mount point/food(again metaphorically), they will fight and this would cause conflicts and casualties(metaphorically again) and one of them(or both) will loose ... and you don't want that.
Therefor, use a separate mount points for each of these services ... you can either use readily available mount points like /mnt
and /media
or create your own mount point/s with like mkdir ~/my_mnt
and use it with like mount device ~/my_mnt
... everyone will be happier this way :)
autu.server1
andauto. server2
on the same main mount point and why two lines inauto.master
for the same main mount point … combine the two files in oneauto.server
file with two lines and make the two lines inauto.master
into just one line referencingauto.server
then runsudo service autofs reload
to read the new changes. – Raffa Jun 20 '22 at 04:55auto.tmp
,auto.sdc
andauto.loop
... You need to add their contents as separate lines beneath the already existing two lines inauto.server
and remove the old references to those files inauto.master
then reload the autofs service and then you'll have them back again. – Raffa Jun 22 '22 at 14:39mkdir ~/my_mnt
to manually mount them under it … you can also choose to change autofs main mount-point instead from/mnt
to a new mount point so you can manually mount under/mnt
… either choices will work fine. – Raffa Jun 22 '22 at 16:38