LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Having trouble with explicit autofs mount (https://www.linuxquestions.org/questions/linux-networking-3/having-trouble-with-explicit-autofs-mount-4175576419/)

mfoley 04-01-2016 12:06 PM

Having trouble with explicit autofs mount
 
I am trying to create an explict mount, not a map, in auto.master. I'm finding no examples browsing the net. I have the following in my auto.master file:

Code:

/home/HPRS              /etc/auto.domUsers      --timeout 1200
/Xdrive        -fstype=nfs,rw,nfsvers=4        ohprsstorage:/mnt/RAID/public

The auto.domUsers map works just fine. The /Xdrive explict does not work. Note that the following fstab entry (currently commented out) does work:

Code:

ohprsstorage:/mnt/RAID/public /Xdrive  nfs    nfsvers=4,rw      0 0
When restarting the autofs service I get the following in /var/log/syslog:

Code:

Apr  1 13:01:37 labrat automount[16985]: mount_autofs_indirect: failed to read map for /Xdrive
What am I doing wrong?

tshikose 04-02-2016 08:10 AM

Hi,

Hoping that you have read the man pages related to autofs, why are you trying to not use a map bwith autofs ut an explicit mount, while autofs is effectively designed to work with map?
Or maybe you what to do what is called a direct map with autofs. If so you are not doing it correctly, read the man pages to find out how.

The error in /var/log/syslog complains about not seeing an expected map!

mfoley 04-02-2016 11:58 PM

Yes, I suppose I mean direct map. The reason I want to use a direct map is that on a different (production) computer I used a map for the /mnt mountpoint, but had other non-autofs folders manually mounted (nfs) under /mnt configured in /etc/fstab. It turned out that autofs and these manual mounts under /mnt interfered with each other. So, I'm trying to find a solution that doesn't map all of /mnt.

I did read the man page and searched for online examples, but couldn't find the answer (possibly because I didn't use the right search term).

Can you offer a suggestion based on my example?

tshikose 04-03-2016 04:09 AM

Hi,

Try, check (because I haven't) and test the below.


/etc/auto.master:
/- /etc/auto.direct

/etc/auto.direct:
/Xdrive -fstype=nfs,rw,nfsvers=4 ohprsstorage:/mnt/RAID/public

tshikose 04-03-2016 04:12 AM

Hi,

You can also divide /mnt in several dedicated subfolders.

/mnt/auto/local/
/mnt/auto/remote/
/mnt/fstab/
/mnt/manual/
/mnt/nfs/
/mnt/cifs/
/mnt/tmp/

mfoley 04-04-2016 12:09 AM

Quote:

Originally Posted by tshikose (Post 5525859)
Try, check (because I haven't) and test the below. ...

That seems to have worked on my test system. I'll try it on the production system tomorrow where I actually have the multiple mounts subordinate to /mnt and post back.

Quote:

You can also divide /mnt in several dedicated subfolders.
Yes, I thought of that, but that would require a lot of rearranging of the various local USB and remote nfs mounts all under /mnt -- not to mention checking for the various scripts that mount or expect these volumes to be there. If it works, the autofs direct mount thing will be simpler. That way, nothing except a SSD will be mount all the time, ohprsstorage:/mnt/RAID/public will be mounted on-demand by users, and the various backup USB drives will be explicitly mounted/unmounted by the cron scripts that use them.

We'll see ...

mfoley 04-08-2016 12:32 AM

Well, this is working horribly! After putting the following in /etc/auto.master on the production server WEBSERVER:

/- /etc/auto.direct --timeout=3600

and the follow in /etc/auto.direct:

/mnt/public -fstype=nfs,rw,nfsvers=4 ohprsstorage:/mnt/RAID/public

It appears to work on the WEBSERVER host. But, this same folder, in addition to being nfs exported from OHPRSSTORAGE, is also samba shared by OHPRSSTORAGE for the benefit of Windows workstations. After doing the automount as configured above, all of the Windows workstations lost their samba maps, even their maps to linux hosts other than OHPRSSTORAGE! And I could not re-map the drive (forgot to note the actual error). Also, when I went to use RSAT on an unrelated matter, I got a message saying it could not find the domain controller. After removing the autofs configuration, putting back the nfs mount in /etc/fstab and rebooting both WEBSERVER and OHPRSSTORAGE, everything was back to normal; Windows workstations were able to see the samba maps without me having to re-map; RSAT started working again.

This all appeared to work fine on my Ubuntu workstation, although access from that to the ohprsstorage:/mnt/RAID/public volume is rare, so possibly not a thorough test.

Differences between working and trashing configurations:

Working: Ubuntu 15.10, automount version 5.1.1, nothing else mounted under /Xdrive

Not working: Slackware 14.1, automount version 5.0.7, other volumes mounted under /mnt

I couldn't find anything describing the differences between version 5.1.1 and 5.0.7.

Any ideas?

tshikose 04-08-2016 05:15 AM

Hi,

Unfortunately, I have never tried to share a folder both by NFS and Samba.
My suggestion is: drop NFS and get all the machines (Windows and Linux) use Samba to access the folder.

mfoley 04-08-2016 12:44 PM

Quote:

Originally Posted by tshikose (Post 5528082)
Hi,

Unfortunately, I have never tried to share a folder both by NFS and Samba.
My suggestion is: drop NFS and get all the machines (Windows and Linux) use Samba to access the folder.

yes, but Samba does not have the auto-mount-on-demand feature which is what I'm looking for.

Although ...

My main issue is that e.g. when WEBSERVER and OHPRSSTORAGE both reboot at similar times (for example, after a power failure), if WEBSERVER comes up first, the nfs mount is tried once. If OHPRSSTORAGE is not there when it tries, it never mounts the exported folder, which is very bad. OHPRSSTORAGE has to be up first and the mountpoint exported.

I'm not sure Samba has this problem. I'll try mounting using Samba instead of NFS, doing that reboot test, and verifying that Samba will eventually see the mount.

Having not done Samba mounts to Linux before, does this look correct for the fstab entry?

ohprsstorage:/public /mnt/public cifs defaults 0 0

(also, I might try putting the autofs mountpoint somewhere other than /mnt with NO OTHER volumes mounted thereunder. I do like the 'unmount after period of no activity' feature of autofs)

mfoley 04-09-2016 04:34 PM

I did try doing the autmount again. It just seemed to me that the problems with Windows workstations losing the share, and esp. RSAT not finding the domain controller had to be coincidental -- don't see how autofs could mess all that up.

So, I tried again with that same config described in your 04-03-16, 05:09 AM post. So far, it's working. No network-wide trashing of mounts. It's been over 24 hours, however there is little user activity on the weekends.

I've done some web-researching on nfs versus cifs and I've found nothing conclusive other than nfs seem more suitable (and efficient?) for Linux clients and cifs is more suitable for Windows client. Some people thought it a bad idea to mix, others saw no problem. As I've been running Samba and NFS mixed for several years, I think I'll just leave it this way. The nuance here is using autofs to auto-mount/unmount the NFS directory rather than leave it always mounted ... if that works!

tshikose 04-10-2016 09:00 AM

Hi,

I think it is also possible to have Samba automount with autofs.
Google a little for it.

mfoley 05-04-2016 04:54 PM

I'm back with more autofs issues ... I have the following setup on Slackware64 14.1:

/etc/auto.master
Code:

/- /etc/auto.direct
/etc/auto.direct
Code:

/mnt/public -fstype=nfs,rw,nfsvers=4 ohprsstorage:/mnt/RAID/public
/etc/default/autofs
Code:

TIMEOUT=3600
BROWSE_MODE="no"
USE_MISC_DEVICE="yes"

My problem is that the timeout doesn't seem to work. If I'm editing a file on the /mnt/public mountpoint, I get long pauses every time the editor auto-saves -- which is quite often (every 60 characters or so). The default is supposedly 600 (10 minutes?), but the pauses seem even more frequent than that. I've also tried:

/- /etc/auto.direct -- --timeout 3600
and
/- /etc/auto.direct --timeout=3600

in /etc/auto.master, but nothing seems to work.

What am I doing wrong?


All times are GMT -5. The time now is 03:58 PM.