LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-11-2020, 05:23 AM   #1
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Rep: Reputation: Disabled
Question Don't get NFS Mount up and running


Hi and a very good afternoon to all of you!
I hope that everyone is doing well in this strange days?!

I cannot get a NFS mount on my Raspberry Pi2B to run, although I read and tried many things.
I think (most of) my configurations are set up correctly and it just fails on one little thing.

So here is what I have tried so far and how it turns out...

Code:
pi@Pi2B:~ $ showmount -e 192.168.0.10
Export list for 192.168.0.10:
/metadata.db
/homes
/Backup
So here I can see, that /Backup has been exported the right way on the server side (a QNAP TS-420 NAS)?
On my NFS Server (the NAS) is says:

Code:
[~] # cat /etc/exports
"/share/MD0_DATA/Backup" 192.168.0.13(rw,async,no_subtree_check,insecure,no_root_squash)
Where 192.168.0.13 is the static IP address of my Pi.
That should be fine too in my opinion, right?

The next thing I did was to install autofs and added a auto.nfs file on the Pi:

Code:
pi@Pi2B:/etc $ cat /etc/auto.nfs
Pi2B -fstype=nfs,rw,retry=0 192.168.0.10:/Backup
Moreover, I created an entry in the auto.master config-file:

Code:
pi@Pi2B:/etc $ cat /etc/auto.master
+dir:/etc/auto.master.d
+auto.master
/mnt/backup/ /etc/auto.nfs
This should, as far as I understood the theory, make a mount point located at

Code:
/mnt/backup/
with a subdirectory called Pi2B.

To sum it up there should be a directory named

Code:
/mnt/backup/Pi2B
since in auto.master it says 'create a mount point at /mnt/backup'.
Tha path 'Pi2B' in the auto.nfs file should be appended here, right?

I read this at
https://wiki.archlinux.org/index.php/Autofs
and
https://help.ubuntu.com/community/Autofs

After that, I restarted autofs with

sudo service autofs restart

and checked, if the directory got mounted successfully...

Code:
ls /mnt/backup/Pi2B
Unfortunately, the directory Pi2B was not found at all
and the parent directory /mnt/backup was completely empty?!

I checked the logs with

Code:
pi@Pi2B:/mnt/backup $ sudo cat /var/log/syslog | grep -i automount
Jul 11 11:49:41 Pi2B systemd[1]: Starting Automounts filesystems on demand...
Jul 11 11:49:41 Pi2B systemd[1]: Started Automounts filesystems on demand.
and did not find anything crucial I think?

mount says the following

Code:
pi@Pi2B:/mnt/backup $ mount
/etc/auto.nfs on /mnt/backup type autofs (rw,relatime,fd=6,pgrp=1412,timeout=300,minproto=5,maxproto=5,indirect)
pi@Pi2B:/mnt/backup $
I don't know what to do next?!
Am I missing something?
Could it be that the directory permissions are wrong on the server?
Do I have to setup my mounting points on the client with su rights? Who should be the owner of the client's directories?

Any help is highly appreciated!

Many thanks in advance!
Mike
 
Old 07-11-2020, 06:23 AM   #2
tinfoil3d
Member
 
Registered: Apr 2020
Location: Japan/RJCC
Distribution: debian, lfs, whatever else i need in qemu
Posts: 268

Rep: Reputation: 75
what does ls -la /mnt/backup say?
 
Old 07-11-2020, 06:50 AM   #3
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
It says that the folder is empty

Code:
pi@Pi2B:~ $ ls -la /mnt/backup
insgesamt 4
drwxr-xr-x 2 root root    0 Jul 11 11:49 .
drwxr-xr-x 4 root root 4096 Jul 11 11:48 ..
pi@Pi2B:~ $
See in my first post

Quote:
Unfortunately, the directory Pi2B was not found at all
and the parent directory /mnt/backup was completely empty?!
Directory structure on the server (NAS)
Code:
[~] # ls -la /share/MD0_DATA/Backup
drwxrwxrwx    5 admin    administ      4096 May 27 20:20 ./
drwxrwxrwx   50 admin    administ      4096 Jul  9 21:28 ../
drwxrwx---   33 admin    administ      4096 Mar 23 12:20 Pi2B/
drwxrwxrwx    5 admin    administ      4096 May 27 19:19 Pi3A/
drwxr-xr-x    3 admin    administ      4096 May  1 20:26 rSync/
[~] #

Last edited by snorre; 07-11-2020 at 06:52 AM.
 
Old 07-11-2020, 07:31 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
I had to add the following line to my /etc/nsswitch.conf file before autofs would automount.

automount: files

Be sure to restart autofs and then try
cd /mnt/backup/Pi2B
 
Old 07-11-2020, 07:52 AM   #5
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
I did

Code:
pi@Pi2B:~ $ sudo nano /etc/nsswitch.conf

...
...
protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

# 2020-07-11 -> see linuxquestions.org forum
automount:      files
Restarted the service via

Code:
pi@Pi2B:~ $ sudo service autofs restart
Unfortunately, the directory cannot be seen under /mnt/backup?

Code:
pi@Pi2B:/mnt $ cd backup
pi@Pi2B:/mnt/backup $ ls -la
insgesamt 4
drwxr-xr-x 2 root root    0 Jul 11 14:49 .
drwxr-xr-x 4 root root 4096 Jul 11 11:48 ..
pi@Pi2B:/mnt/backup $
pi@Pi2B:/mnt/backup $
pi@Pi2B:/mnt/backup $
pi@Pi2B:/mnt/backup $
I don't get it
 
Old 07-11-2020, 07:59 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Just try
cd /mnt/backup/Pi2B

Check your /var/log/syslog for errors.
 
Old 07-11-2020, 08:07 AM   #7
markd81
LQ Newbie
 
Registered: Jul 2020
Location: Netherlands
Distribution: Debian
Posts: 17

Rep: Reputation: 3
Im not sure if the order of the lines in the config matter, but in case it does. My config looks like this:

Code:
md@nukkie:~$ grep -v -e '^#' /etc/auto.master
/mnt/nfs/blokje /etc/auto.blokje
+dir:/etc/auto.master.d
+auto.master
In /etc/auto.blokje
Code:
* -fstype=nfs,rw 192.168.1.2:/mnt/datadump/&
I want it to mount all mounts on the nfs server.

Last edited by markd81; 07-11-2020 at 08:10 AM. Reason: Made post more clear.
 
Old 07-11-2020, 08:07 AM   #8
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Code:
pi@Pi2B:/ $ cd /mnt/backup/Pi2B
-bash: cd: /mnt/backup/Pi2B: Datei oder Verzeichnis nicht gefunden
Don't bother about the German language

Code:
pi@Pi2B:/ $ cat /var/log/syslog

...
...
Jul 11 14:49:43 Pi2B systemd[1]: Stopped Automounts filesystems on demand.
Jul 11 14:49:43 Pi2B systemd[1]: Starting Automounts filesystems on demand...
Jul 11 14:49:43 Pi2B systemd[448]: tmp-auto0EqAJ6.mount: Succeeded.
Jul 11 14:49:43 Pi2B systemd[1]: tmp-auto0EqAJ6.mount: Succeeded.
Jul 11 14:49:43 Pi2B systemd[448]: tmp-auto0LOjdl.mount: Succeeded.
Jul 11 14:49:44 Pi2B systemd[1]: tmp-auto0LOjdl.mount: Succeeded.
Jul 11 14:49:44 Pi2B systemd[1]: Started Automounts filesystems on demand.
Jul 11 15:01:33 Pi2B systemd[1]: Starting Cleanup of Temporary Directories...
Jul 11 15:01:33 Pi2B systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
Jul 11 15:01:33 Pi2B systemd[1]: Started Cleanup of Temporary Directories.
pi@Pi2B:/ $
Nothing special in here...?
 
Old 07-11-2020, 08:20 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
I would restart the Pi.

Look at the output of the mount command to see if there is an autofs line.

Can you manually mount the share?

Last edited by michaelk; 07-11-2020 at 08:35 AM.
 
Old 07-11-2020, 08:26 AM   #10
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Just restarted the Pi and looked at the mount output.

Code:
pi@Pi2B:~ $ mount
...
...
/dev/sda1 on /mnt/sda1 type ext4 (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/etc/auto.nfs on /mnt/backup type autofs (rw,relatime,fd=6,pgrp=376,timeout=300,minproto=5,maxproto=5,indirect)
The entry is there...

The output says...

Code:
pi@Pi2B:~ $ sudo cat /var/log/syslog | grep -i automount
Jul 11 15:23:14 Pi2B systemd[1]: Starting Automounts filesystems on demand...
Jul 11 15:23:18 Pi2B systemd[1]: Started Automounts filesystems on demand.

Edit:
Should i recreate the directories under a different user?
Check the permissions, owners, etc...?

Last edited by snorre; 07-11-2020 at 08:27 AM.
 
Old 07-11-2020, 08:37 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
I updated my previous post. Can you manually mount the share?
 
Old 07-11-2020, 08:52 AM   #12
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Code:
pi@Pi2B:~ $ sudo mount -o v3 192.168.0.10:/Backup /mnt/backup/
pi@Pi2B:~ $ cd /mnt/backup
pi@Pi2B:/mnt/backup $ ls -la
insgesamt 36
drwxrwxrwx  5 root root 4096 Mai 27 20:20 .
drwxr-xr-x  4 root root 4096 Jul 11 11:48 ..
drwxrwx--- 33 root root 4096 Mär 23 12:20 Pi2B
drwxrwxrwx  5 root root 4096 Mai 27 19:19 Pi3A
drwxr-xr-x  3 root root 4096 Mai  1 20:26 rSync
pi@Pi2B:/mnt/backup $
Yes, indeed
 
Old 07-11-2020, 09:28 AM   #13
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Just tried to start autofs in the foreground

Code:
[pi@Pi2B:/ $ sudo service autofs stop
pi@Pi2B:/ $ sudo automount -f -v
Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.03
lookup(file): failed to read included master map auto.master
mounted indirect on /mnt with timeout 300, freq 75 seconds
1 submounts remaining in /mnt
1 remaining in /mnt
1 submounts remaining in /mnt
1 remaining in /mnt
^C1 submounts remaining in /mnt
1 remaining in /mnt
umounted indirect mount /mnt
shut down path /mnt
autofs stopped
Any ideas what this means?
 
Old 07-11-2020, 09:54 AM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Do you still have /backup mounted from post #12?

At least nfs is working.

It looks like autofs is starting ok but just for kicks would restart the Pi. Do you know if your NAS is running nfs version 4?

Maybe try this in your auto.nfs file

Pi2B -rw,soft,intr 192.168.0.10:/Backup
 
Old 07-11-2020, 10:07 AM   #15
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
My NAS is currently supporting NFS-v2 as well as NFS-v3
The checkbox for v4 is not checked in the settings of the QNAP control panel.

No, I have unmounted the mount before I did a manual (verbose) test in the foreground
I did a normal
Code:
sudo umount --force /mnt/backup
before I tried it...

Would this
Quote:
Pi2B -rw,soft,intr 192.168.0.10:/Backup
be for version 4?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount NFS error - mount.nfs: mount(2): Permission denied ndtatlive SUSE / openSUSE 1 09-20-2018 10:46 PM
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 13 04-11-2016 11:30 PM
[SOLVED] NFS mount points don't mount during boot Quakeboy02 Debian 11 06-16-2013 07:11 AM
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
[SOLVED] mount.nfs: mount to NFS server 'rpcbind' failed w1k0 Slackware 4 03-30-2010 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:41 AM.

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