Talk:Mounting an NFS share on Ubuntu: Difference between revisions

From QNAPedia
Jump to navigation Jump to search
m cleanup visual-editor barf
m typo, spacing
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In Ubuntu 14.04, <code>portmap</code> has been replaced with <code>rcpbind</code>.
In Ubuntu 14.04, <code>portmap</code> has been replaced with <code>rcpbind</code>.


At any rate, the <code>mount</code> command give here just produces a <code>mount.nfs: an incorrect mount option was specified</code> error on the system I just tried it on. &nbsp;The share is set up to allow the user in question read/write access, and NFS host access turned on for this share in Edit Shared Folder Permission, so I'm not sure what the issue is yet. It is possible to mount the share with cifs. Have also tried adding the <code>vers=3</code> option, after <code>-o</code> and this did not fix the issue.&nbsp;[[User:SMcCandlish|SMcCandlish]] ([[User talk:SMcCandlish|talk]]) 10:53, 26 February 2016 (CST)
At any rate, the <code>mount</code> command give here just produces a <code>mount.nfs: an incorrect mount option was specified</code> error on the system I just tried it on. &nbsp;The share is set up to allow the user in question read/write access, and NFS host access turned on for this share in Edit Shared Folder Permission, so I'm not sure what the issue is yet. It is possible to mount the share with cifs. Have also tried adding the <code>vers=3</code> option, after <code>-o</code> and this did not fix the issue.&nbsp;[[User:SMcCandlish|SMcCandlish]] ([[User_talk:SMcCandlish|talk]]) 10:53, 26 February 2016 (CST)
 
== Mounting an NFS share on Ubuntu ==
 
I had the same problem as the previous user...
 
<code>mount.nfs: an incorrect mount option was specified</code>
 
...it looks like the username and password options are not valid for nfs mounts. &nbsp;I tried using vers=5, and this time I did not get the error above, but the drive did not mount...
 
<code>ryan@jonesdesktop:~$ sudo mount -vvv -t nfs -o username=ryan,password=removed,vers=5 192.168.0.101:ryan /home/ryan/ryannas<br/>mount: fstab path: "/etc/fstab"<br/>mount: mtab path: &nbsp;"/etc/mtab"<br/>mount: lock path: &nbsp;"/etc/mtab~"<br/>mount: temp path: &nbsp;"/etc/mtab.tmp"<br/>mount: UID: &nbsp; &nbsp; &nbsp; &nbsp;0<br/>mount: eUID: &nbsp; &nbsp; &nbsp; 0<br/>mount: spec: &nbsp;"192.168.0.101:ryan"<br/>mount: node: &nbsp;"/home/ryan/ryannas"<br/>mount: types: "nfs"<br/>mount: opts: &nbsp;"username=ryan,password=removed,vers=5"<br/>mount: external mount: argv[0] = "/sbin/mount.nfs"<br/>mount: external mount: argv[1] = "192.168.0.101:ryan"<br/>mount: external mount: argv[2] = "/home/ryan/ryannas"<br/>mount: external mount: argv[3] = "-v"<br/>mount: external mount: argv[4] = "-o"<br/>mount: external mount: argv[5] = "rw,username=ryan,password=removed,vers=5"</code>
 
.....this output looks like everything went fine, but the drive is not mapped. &nbsp;If I remove the vers=5 option, it looks like my Ubuntu system defaults to vers=4, but then it gives me the "incorrect mount option" error...
 
<code>ryan@jonesdesktop:~$ sudo mount -vvv -t nfs -o username=ryan,password=removed 192.168.0.101:ryan /home/ryan/ryannas<br/>mount: fstab path: "/etc/fstab"<br/>mount: mtab path: &nbsp;"/etc/mtab"<br/>mount: lock path: &nbsp;"/etc/mtab~"<br/>mount: temp path: &nbsp;"/etc/mtab.tmp"<br/>mount: UID: &nbsp; &nbsp; &nbsp; &nbsp;0<br/>mount: eUID: &nbsp; &nbsp; &nbsp; 0<br/>mount: spec: &nbsp;"192.168.0.101:ryan"<br/>mount: node: &nbsp;"/home/ryan/ryannas"<br/>mount: types: "nfs"<br/>mount: opts: &nbsp;"username=ryan,password=removed"<br/>mount: external mount: argv[0] = "/sbin/mount.nfs"<br/>mount: external mount: argv[1] = "192.168.0.101:ryan"<br/>mount: external mount: argv[2] = "/home/ryan/ryannas"<br/>mount: external mount: argv[3] = "-v"<br/>mount: external mount: argv[4] = "-o"<br/>mount: external mount: argv[5] = "rw,username=ryan,password=removed"<br/>mount.nfs: timeout set for Tue Dec &nbsp;6 13:48:28 2016<br/>mount.nfs: trying text-based options 'username=ryan,password=removed,vers=4,addr=192.168.0.101,clientaddr=192.168.0.20'<br/>mount.nfs: mount(2): Invalid argument<br/>mount.nfs: an incorrect mount option was specified</code>
 
Has anyone figured out how to resolve this?
 
[The previous unsigned comment was posted by [[User:Rpjones007|Rpjones007]], 04:30, 7 December 2016‎ (UTC)]
 
 
: '''Yes. The following command worked for me:'''
:: <code>sudo mount -vvv -t cifs -o username=yevgen,password=removed //10.0.0.3:/data /mnt/qnap/</code>
: [The previous unsigned comment was posted by [[User:Yevgen|Yevgen]], 08:01, 31 January 2017 ‎(UTC)]
 
 
:: That's a CIFS (SMB) mount, not an NFS mount. Totally different protocols.  While knowing how to do that is useful, being able to do it with NFS is necessary sometimes.  I did get NFS to work for a client. I can dig up the details.<p>Here it is. This worked in Ubuntu 14.04 and 16.04, and Xubuntu 16.04:</p>
::: <code>sudo mount -w -v -t nfs -o user=<var>theusername</var> <var>qnap.ip.or.hostname</var>:<var>/path/sharename</var> /mnt/<var>sharename</var></code>
 
:: and enter the password when prompted (or you can add it as a commandline parameter, but I prefer not to, since that makes it visible to anyone looking over your shoulder.<p>However, one must first set up the share on Qnap, and then enable NFS access to it as a share option, and ensure that its details are set correct (<code>no_root_squash</code>, or whatever), then create the local directory for the mount point, then do the above <code>mount</code> command.  To make the share permanent, it needs a corresponding entry in the client machine's /etc/fstab (or an /etc/fstab.d/ file), too.</p>Hope that helps. &mdash;&thinsp;[[User:SMcCandlish|SMcCandlish]] ([[User talk:SMcCandlish|talk]]) 19:23, 31 January 2017 (CST)</p>

Latest revision as of 19:26, 31 January 2017

In Ubuntu 14.04, portmap has been replaced with rcpbind.

At any rate, the mount command give here just produces a mount.nfs: an incorrect mount option was specified error on the system I just tried it on.  The share is set up to allow the user in question read/write access, and NFS host access turned on for this share in Edit Shared Folder Permission, so I'm not sure what the issue is yet. It is possible to mount the share with cifs. Have also tried adding the vers=3 option, after -o and this did not fix the issue. SMcCandlish (talk) 10:53, 26 February 2016 (CST)

Mounting an NFS share on Ubuntu

I had the same problem as the previous user...

mount.nfs: an incorrect mount option was specified

...it looks like the username and password options are not valid for nfs mounts.  I tried using vers=5, and this time I did not get the error above, but the drive did not mount...

ryan@jonesdesktop:~$ sudo mount -vvv -t nfs -o username=ryan,password=removed,vers=5 192.168.0.101:ryan /home/ryan/ryannas
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: spec:  "192.168.0.101:ryan"
mount: node:  "/home/ryan/ryannas"
mount: types: "nfs"
mount: opts:  "username=ryan,password=removed,vers=5"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "192.168.0.101:ryan"
mount: external mount: argv[2] = "/home/ryan/ryannas"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,username=ryan,password=removed,vers=5"

.....this output looks like everything went fine, but the drive is not mapped.  If I remove the vers=5 option, it looks like my Ubuntu system defaults to vers=4, but then it gives me the "incorrect mount option" error...

ryan@jonesdesktop:~$ sudo mount -vvv -t nfs -o username=ryan,password=removed 192.168.0.101:ryan /home/ryan/ryannas
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: spec:  "192.168.0.101:ryan"
mount: node:  "/home/ryan/ryannas"
mount: types: "nfs"
mount: opts:  "username=ryan,password=removed"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "192.168.0.101:ryan"
mount: external mount: argv[2] = "/home/ryan/ryannas"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,username=ryan,password=removed"
mount.nfs: timeout set for Tue Dec  6 13:48:28 2016
mount.nfs: trying text-based options 'username=ryan,password=removed,vers=4,addr=192.168.0.101,clientaddr=192.168.0.20'
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

Has anyone figured out how to resolve this?

[The previous unsigned comment was posted by Rpjones007, 04:30, 7 December 2016‎ (UTC)]


Yes. The following command worked for me:
sudo mount -vvv -t cifs -o username=yevgen,password=removed //10.0.0.3:/data /mnt/qnap/
[The previous unsigned comment was posted by Yevgen, 08:01, 31 January 2017 ‎(UTC)]


That's a CIFS (SMB) mount, not an NFS mount. Totally different protocols. While knowing how to do that is useful, being able to do it with NFS is necessary sometimes. I did get NFS to work for a client. I can dig up the details.

Here it is. This worked in Ubuntu 14.04 and 16.04, and Xubuntu 16.04:

sudo mount -w -v -t nfs -o user=theusername qnap.ip.or.hostname:/path/sharename /mnt/sharename
and enter the password when prompted (or you can add it as a commandline parameter, but I prefer not to, since that makes it visible to anyone looking over your shoulder.

However, one must first set up the share on Qnap, and then enable NFS access to it as a share option, and ensure that its details are set correct (no_root_squash, or whatever), then create the local directory for the mount point, then do the above mount command. To make the share permanent, it needs a corresponding entry in the client machine's /etc/fstab (or an /etc/fstab.d/ file), too.

Hope that helps. — SMcCandlish (talk) 19:23, 31 January 2017 (CST)