LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mageia
User Name
Password
Mageia This forum is for the discussion of Mageia Linux.

Notices


Reply
  Search this Thread
Old 06-29-2017, 08:26 PM   #1
apimente.br
Member
 
Registered: Aug 2003
Location: Sao Paulo - Brazil
Distribution: Mageia
Posts: 155

Rep: Reputation: 23
How to use autofs to mount a NFS share


I can not run the automatic mount for the following case:
- I have a mini NFS server where I store files mainly for back up purposes, I put in the /etc/fstab the mount configuration and everything worked fine. But if I'm not in my network (it is a notebook) the boot takes an eternity due the attempts to find the server.
- removed from /etc/fstab and started to mount and dismount manually when needed. This also works.
- I want to do something more automatic, searching I found the autofs that if it worked would be the solution to my problems. I read the man pages and saw how to do the setup.

But it does not work.

My /etc/autofs/auto.master:
Code:
cat auto.master
# Cubietruck
#
/media/NFS  /etc/autofs/auto.cubie  --timeout=60
My /etc/autofs/auto.cubie:
Code:
cat auto.cubie
# Cubietruck
/media/NFS  -fstype=nfs,rw,nosuid,nodev  :cubietruck:/media/hd/FS-01/
Code:
systemctl status  autofs.service
● autofs.service - Automounts filesystems on demand
  Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; vendor preset: enabled)
  Active: active (running) since Qui 2017-06-29 14:15:18 -03; 21min ago
  Process: 2527 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS)  
Main PID: 2535 (automount)  
  CGroup: /system.slice/autofs.service
  └─2535 /usr/sbin/automount --pid-file /run/autofs.pid

Jun 29 14:15:16 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand...
Jun 29 14:15:18 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
Jun 29 14:16:40 localhost.localdomain automount[2535]: key "media" not found in map source(s).
Jun 29 14:18:58 localhost.localdomain automount[2535]: key ":0" not found in map source(s).
Code:
ping cubietruck
PING cubietruck (192.168.123.3) 56(84) bytes of data.
64 bytes from cubietruck (192.168.123.3): icmp_seq=1 ttl=64 time=0.911 ms
64 bytes from cubietruck (192.168.123.3): icmp_seq=2 ttl=64 time=0.257 ms
64 bytes from cubietruck (192.168.123.3): icmp_seq=3 ttl=64 time=0.249 ms
64 bytes from cubietruck (192.168.123.3): icmp_seq=4 ttl=64 time=0.469 ms
64 bytes from cubietruck (192.168.123.3): icmp_seq=5 ttl=64 time=0.251 ms
64 bytes from cubietruck (192.168.123.3): icmp_seq=6 ttl=64 time=0.243 ms
^C
--- cubietruck ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5124ms
rtt min/avg/max/mdev = 0.243/0.396/0.911/0.244 ms
I'm using Mageia 6 but in Mageia 5 I got the same.

Thanks in advance.
 
Old 06-30-2017, 03:12 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
you do not need to put : before the name of the server.
/media/NFS -fstype=nfs,rw,nosuid,nodev :cubietruck:/media/hd/FS-01/
would be nice to check the logs, probably you will find a related message
 
1 members found this post helpful.
Old 06-30-2017, 04:02 AM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,793

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The first field specified in /etc/autofs.master should look like this

Code:
/media  /etc/autofs/auto.cubie  --timeout=60
and the first field in /etc/autofs/auto.cubie should just be NFS (as opposed to /media/NFS)

Code:
NFS  -fstype=nfs,rw,nosuid,nodev  cubietruck:/media/hd/FS-01/

Last edited by ferrari; 06-30-2017 at 04:04 AM.
 
1 members found this post helpful.
Old 06-30-2017, 07:37 AM   #4
apimente.br
Member
 
Registered: Aug 2003
Location: Sao Paulo - Brazil
Distribution: Mageia
Posts: 155

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by ferrari View Post
The first field specified in /etc/autofs.master should look like this

Code:
/media  /etc/autofs/auto.cubie  --timeout=60
and the first field in /etc/autofs/auto.cubie should just be NFS (as opposed to /media/NFS)

Code:
NFS  -fstype=nfs,rw,nosuid,nodev  cubietruck:/media/hd/FS-01/
It works. Thanks a lot.

pan64 - thank you!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Automount NFS share in Linux using autofs LXer Syndicated Linux News 0 02-16-2016 02:21 PM
How to mount nfs using automounter(autofs) nokia3310 Linux - Newbie 1 05-02-2013 04:22 AM
Multiple NFS mount using autofs luxaterna Linux - Newbie 4 04-21-2013 08:14 PM
Noob question: AutoFS and NFS Share Issue: Group mounts gerhardb Linux - Networking 0 03-20-2007 02:09 PM
nfs mount with fstab vs autofs rrich100 Linux - Networking 2 11-13-2003 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mageia

All times are GMT -5. The time now is 07:31 PM.

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