Max_G
Posts: 42
Joined: Sat May 28, 2016 8:27 am

fstab entry producing errors; manual mount works

Sun Dec 01, 2019 3:21 am

I spent the better of three hours to get to thebottom of this, no to no avail.

I am on a standard rPi Stretch lite install (machine A); have another rPi on strecth lite (machine B).

I am logged into A, and want to access my home directory on B.

when I type in a terminal:

Code: Select all

sudo mount 192.168.1.8:/home/maxg/       /home/maxg/rpi32
... this works, as in getting read only access to this remote directory

None of the machines runs sshfs, export or SAMBA

what is the proper command to connect via IP?
And what do I need to put into fstab to get r/w access to this remote directory on B?

I have tried the following to no avail:

Code: Select all

//192.168.1.8/home/maxg       /home/maxg/rpi32        nfs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
mount.nfs: remote share not in 'host:dir' format

//192.168.1.8:/home/maxg       /home/maxg/rpi32        nfs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
mount.nfs: Failed to resolve server //192.168.1.8: Name or service not known

//192.168.1.8:/home/maxg       /home/maxg/rpi32        nfs  username=maxg,password=maxe-pw
mount.nfs: Failed to resolve server //192.168.1.8: Name or service not known



192.168.1.8:/home/maxg          /home/maxg/rpi32        nfs4  _netdev,auto 0 0
--> works

192.168.1.8:/home/maxg          /home/maxg/rpi32        nfs4   username=maxg,password=maxe-pw,uid=1001,gid=1001,auto 0 0
mount.nfs4: an incorrect mount option was specified



192.168.1.8:/home/maxg       /home/maxg/rpi32        cifs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
mount.cifs: bad UNC (192.168.1.8:/home/maxg)

192.168.1.8/home/maxg       /home/maxg/rpi32        cifs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
mount.cifs: bad UNC (192.168.1.8/home/maxg)

//192.168.1.8/home/maxg       /home/maxg/rpi32        cifs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

//rpi32/home/maxg       /home/maxg/rpi32        cifs  username=maxg,password=maxe-pw,uid=1001,gid=1001 0 0
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
CIFS seems to related to SAMBA, since I am not using it, it explains the failing commands.

Any hints appreciated.
Last edited by Max_G on Sun Dec 01, 2019 9:44 am, edited 1 time in total.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: fstab entry producing errors; manual mount works

Sun Dec 01, 2019 9:19 am

I haven't checked, but I think the username and pw are not valid for NFS.

What's wrong with the working solution?

Max_G
Posts: 42
Joined: Sat May 28, 2016 8:27 am

Re: fstab entry producing errors; manual mount works

Sun Dec 01, 2019 9:46 am

DirkS wrote:
Sun Dec 01, 2019 9:19 am
I haven't checked, but I think the username and pw are not valid for NFS.
What's wrong with the working solution?
It is read only. :(

BTW: Congrats to your 10,000's post! :)

iznobe
Posts: 426
Joined: Sun Feb 05, 2017 4:14 pm
Location: Avignon , FRANCE

Re: fstab entry producing errors; manual mount works

Sun Dec 01, 2019 11:31 am

Hi ,

first step you must install NFS , so

Code: Select all

sudo apt install nfs-common nfs-kernel-server
on the 2 PIs

when this is done you must install NFS on 2 differents parts .

first you have to declare the exports directory on the " pi server "

so edit the file /etc/exports and add the complete directory with rights you want to give to the client machine , and verify rights ( and owner ) are goods to what you want to give .

second step mount in your client machine the server directory :

create a new directory with the goods rights and owner .
then test to mount your server directory in your new client directory .

once this is working you can edit your /etc/fstab file and a new line to mount automatically the acces to your distant files and test tit with a command like " sudo mount -a " , if no error appear after sending this command , and this all working fine you can reboot and all will be ok .

for more information , google search about " debian NFS " can give more details .

or look here : https://www.google.com/url?sa=t&rct=j&q ... M-PDJ3-edu

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: fstab entry producing errors; manual mount works

Sun Dec 01, 2019 12:25 pm

iznobe wrote:
Sun Dec 01, 2019 11:31 am
first step you must install NFS , so

Code: Select all

sudo apt install nfs-common nfs-kernel-server
on the 2 PIs
Why? NFS is clearly working, just not quite right...
And why would you need the NFS server software on the client?

User avatar
thagrol
Posts: 3106
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: fstab entry producing errors; manual mount works

Sun Dec 01, 2019 2:09 pm

Max_G wrote:
Sun Dec 01, 2019 9:46 am
DirkS wrote:
Sun Dec 01, 2019 9:19 am
I haven't checked, but I think the username and pw are not valid for NFS.
They're not. See

Code: Select all

man nfs
Max_G wrote:
Sun Dec 01, 2019 9:46 am
What's wrong with the working solution?
It is read only. :(

BTW: Congrats to your 10,000's post! :)

Check the server settings.
  • Has the exported storage been mounted read/write?
  • Has it been exported read/write?
  • Have permissions been set correctly to allow write access by your remote users?
  • Not sure whether this will make a difference but do the local (on the server) and remote users have the same numeric ID for both user and group?
Arguing with strangers on the internet since 1993.

Return to “Troubleshooting”