LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 10:12 AM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951

Nope.
 
Old 07-11-2020, 10:27 AM   #17
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Did the following changes:

Changed the folder for the mountpoint -> should be /mnt/backup

Code:
pi@Pi2B:/mnt/backup $ sudo nano /etc/auto.master
  GNU nano 3.2                                /etc/auto.master

+dir:/etc/auto.master.d
+auto.master
/mnt /etc/auto.nfs
Gave your suggestion a try:

Code:
pi@Pi2B:/mnt/backup $ sudo nano /etc/auto.nfs
  GNU nano 3.2                                  /etc/auto.nfs
backup -rw,soft,intr 192.168.0.10:/Backup
Restarted the service
Code:
pi@Pi2B:/mnt/backup $ sudo service autofs restart
Checked mount points
Code:
/etc/auto.nfs on /mnt type autofs (rw,relatime,fd=6,pgrp=1529,timeout=300,minproto=5,maxproto=5,indirect)
Did a
Code:
ls /mnt/backup/Pi2B
-> Directory not exists
 
Old 07-11-2020, 10:33 AM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
The directory is not created/mounted until you access it i.e
cd /mnt/backup/Pi2B
 
Old 07-11-2020, 10:37 AM   #19
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Sorry, I did not mention that before!
Obviously, I tried that too!

Code:
pi@Pi2B:/ $ cd /mnt/backup/Pi2B
-bash: cd: /mnt/backup/Pi2B: Datei oder Verzeichnis nicht gefunden
pi@Pi2B:/ $
 
Old 07-11-2020, 10:53 AM   #20
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Now, I started the automount in debug mode...

I started it, waited a while and the tried to access the directory
in a different console window. I got the following errors:

handle_packet_missing_indirect: token 1, name backup

Code:
pi@Pi2B:/mnt $ sudo automount -f --debug
Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.03
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup(file): failed to read included master map auto.master
lookup_read_master: lookup(file): read entry /mnt/nfs
master_do_mount: mounting /mnt/nfs
automount_path_to_fifo: fifo name /var/run/autofs.fifo-mnt-nfs
lookup_nss_read_map: reading map file /etc/auto.nfs
do_init: parse(sun): init gathered global options: (null)
mounted indirect on /mnt/nfs with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /mnt/nfs
handle_packet: type = 3
handle_packet_missing_indirect: token 1, name backup, request pid 1478
attempting to mount entry /mnt/nfs/backup
lookup_mount: lookup(program): looking up backup
lookup(program): lookup for backup failed
dev_ioctl_send_fail: token = 1
failed to mount /mnt/nfs/backup
handle_packet: type = 3
handle_packet_missing_indirect: token 2, name backup, request pid 1478
dev_ioctl_send_fail: token = 2
handle_packet: type = 3
handle_packet_missing_indirect: token 3, name backup, request pid 1478
dev_ioctl_send_fail: token = 3
 
Old 07-11-2020, 10:54 AM   #21
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
I give up...

What operating system is running on your Pi? If the lastest raspbian or other that uses systemd you can use its automounting feature instead. Stop autofs and add this to your /etc/fstab:

192.168.0.10:/Backup /mnt/backup nfs _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0
 
Old 07-11-2020, 11:01 AM   #22
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
It's just the official one...

Code:
pi@Pi2B:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@Pi2B:~ $
Are there any risks for a 'deadlock' when I use fstab if the NAS is not online?
That's the reason why I thought I should switch to autofs.

Quote:
I give up...
Anyhows, many, many thanks for your support Michael!
I highly appreciate it!
 
Old 07-11-2020, 11:15 AM   #23
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
I'm not sure why it isn't working...

No, the x-systemd.automount option is basically the same thing as autofs except it does not create the mount directory. The noauto,_netdev options keep it from mounting at boot and waits until networking is up. The share is only mounted when the directory is accessed and automatically unmounted if the idle timeout has expired. x-systemd.device-timeout=10 determines how long to attempt a mount before moving on.
 
Old 07-11-2020, 11:27 AM   #24
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks again for your answer and your clarification, Michael.
When I'm using the noauto,_netdev options and I'm using a bash-script (rsync backup to the NAS),
do I then have to wait for the mount in the script?

Here is a snippet of my backup-script, which I, unfortunately, never got to run due to the mounting problems
Do i still need the mount command, or will the mounting point automatically mounted at first access?

Code:
if ! mountpoint -q "${MOUNT_POINT}"; then
  echo "Mount backup directory ${MOUNT_POINT}." >> "${LOG}"
  if ! mount "${MOUNT_POINT}"; then
    echo "Error on mounting. Backup will be cancelled!" >> "${LOG}"
    exit 5
  else
    echo "  Successfully mounted backup directory." >> "${LOG}"
  fi
else
  echo "${MOUNT_POINT} already mounted." >> "${LOG}"
fi
Thanks again!
 
Old 07-11-2020, 11:41 AM   #25
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
No, should be automatic but don't think I have ever tried either...
 
Old 07-11-2020, 12:21 PM   #26
markd81
LQ Newbie
 
Registered: Jul 2020
Location: Netherlands
Distribution: Debian
Posts: 17

Rep: Reputation: 3
Quote:
Originally Posted by snorre View Post
Do i still need the mount command, or will the mounting point automatically mounted at first access?
It will automatically mount at first access. I just tested one share with ls command and another share with touching a file.
 
Old 07-11-2020, 12:59 PM   #27
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Me again
I now have changed to fstab and added an entry for the mountpoint on the NAS exactly how you told me.
After I rebooted the Pi the directory in /mnt/backup was not there.
I then changed the directory INTO the child dir, and after a while I saw the directories Hooray!

Unfortunately I don't have permission to browse into the subdirecties?!

Code:
insgesamt 36
drwxrwxrwx  5 root root 4096 Mai 27 20:20 .
drwxr-xr-x  3 root root 4096 Jul 11 19:48 ..
drwxrwxr-- 33 root root 4096 Mär 23 12:20 Pi2B
drwxrwx---  5 root root 4096 Mai 27 19:19 Pi3A
drwxr-xr-x  3 root root 4096 Mai  1 20:26 rSync
pi@Pi2B:/mnt/nfs/backup $
pi@Pi2B:/mnt/nfs/backup $
pi@Pi2B:/mnt/nfs/backup $ cd Pi3A
-bash: cd: Pi3A: Keine Berechtigung
Which permission do I need in that case and do I have to edit these on the server
or must I create the directories, which I did now manually on the client, under
a different user? Or do I have to change the owner of the directories to make it work?

Many thanks again!
 
Old 07-11-2020, 01:09 PM   #28
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
Hmm, what happens if you add rw to the options in the /etc/fstab file.
 
Old 07-11-2020, 01:19 PM   #29
snorre
LQ Newbie
 
Registered: Jul 2020
Posts: 20

Original Poster
Rep: Reputation: Disabled
Nothing's changed?!

Code:
pi@Pi2B:/mnt/nfs/backup $ ls -la
insgesamt 36
drwxrwxrwx  5 root root 4096 Mai 27 20:20 .
drwxr-xr-x  3 root root 4096 Jul 11 19:48 ..
drwxrwxr-- 33 root root 4096 Mär 23 12:20 Pi2B
drwxrwx---  5 root root 4096 Mai 27 19:19 Pi3A
drwxr-xr-x  3 root root 4096 Mai  1 20:26 rSync
pi@Pi2B:/mnt/nfs/backup $
pi@Pi2B:/mnt/nfs/backup $
pi@Pi2B:/mnt/nfs/backup $
pi@Pi2B:/mnt/nfs/backup $ cd Pi2B
-bash: cd: Pi2B: Keine Berechtigung
Here is the mount entry...

Code:
192.168.0.10:/Backup on /mnt/nfs/backup type nfs (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=14,retrans                       =2,sec=sys,mountaddr=192.168.0.10,mountvers=3,mountport=30000,mountproto=udp,local_lock=none,addr=192.168.0.10,_netdev)
 
Old 07-11-2020, 02:51 PM   #30
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,790

Rep: Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951Reputation: 5951
Permissions need to be drwxrwxr-x to access Pi2B directory.
 
  


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 05:33 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