Can't get a FreeNAS mount from a Ubuntu computer

Status
Not open for further replies.

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
I have been trying for a few weeks to get a ubuntu folder mounted to Freenas.
I have a directory in a Ubuntu machine /mnt/CCTV/xeoma, and I want to mount it on my Freenas drive. On Freenas I have created datasets for the above, but cannot get ubuntu to mount the local folder.
Like this:
sudo mount -t cifs -o username=root, password=****** //192.168.0.22/CCTV/xeoma mnt/CCTV/xeoma.

I have googled this and what I have above is what I have read or seen when reading other posts on this
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I don't think FreeNAS is supposed to work that way, but if it was able to work that way, you would not create a dataset and then try to mount a remote directory to it. You would just create a 'plain' directory, not in the storage pool, and mout the remote directory there.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
The problem description from @avalon60 is not very clear. The mount statement is being made in Ubuntu and it contains one obvious syntax error, "mnt/CCTV/xeoma" should be "/mnt/CCTV/xeoma". But no info was giving that a smb share had been correctly set up on FreeNAS , so it's really not clear what's happening here.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Oops, it was a mistake on my part re the syntax error.
I have created a dataset /CCTV/xeoma on my FreeNAS machine.
On the local Ubuntu machine I have created a directory under /mnt/CCTV/xeoma.
I don't know how to setup an smb share on FreeNAS.
What I am trying to do is to get videos and pictures from the xeoma cctv program, to be stored on the FreeNAS /CCTV/xeoma folder or directory.
To do this I know that I need to mount the said folder on the ubuntu macne to the FreeNAS machine, if that sounds right??
The mount script I used is:
sudo mount -t cifs -o username=root, password=*******//192.168.0.22/CCTV/xeoma /mnt/CCTV/xeoma
But when I run it, I get an error saying mount: bad usage.

Yet when I ran a similar script on a PiZero, it worked just fine
sudo mount -t cifs -o username=root,password=*******,uid=pi,gid=pi //192.168.0.22/CCTV/PiZero/ /mnt/CCTV/PiZero

I see that it has a uid and a gid =pi, but don't know what to use from the Ubuntu machine
Thanks
 
Last edited:

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@avalon60 You must have created SMB share on FreeNAS in order for that mount command to work on your PiZero. So you'll need to create another share for your CCTV/xeoma dataset. As far as what uid/gid to use on Ubuntu is concerned, it depends on how you've set up permission on the FreeNAS dataset and the mount dir in Ubuntu, together with which user/group combination exists on both FreeNAS and Ubuntu.

What ownership and permissions have you set on yourt CCTV/PiZero dataset? Asuming PI is the default non-root user on your PiZero. What are the numeric values for uid/gid for user Pi? You can just type the command id at the CLI on your PiZero to find that out. This should give you a guide of what to use in Ubuntu where you made need to add a normal user account if you haven't already done so.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
As far as I can remember, for the PiZero, I just created a dataset on FreeNAS for it and the permissions are : Owner user: root, Owner Group: nobody
On the PiZero itself the permissions on the /mnt sub folders are set to: anybody.
The uid on the PiZero is 1000(pi), and gid=1000(pi)
On the Ubuntu machine, the uid=1000(rob) and gid=1000(rob)
The permissions on the said machine are set to Me on both the CCTV/xeoma folders
So I now add the uid and gid as rob in the maount script, but it still gives me a mount error of bad usage.

Thanks
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Anyone?
I have also tried
mount.nfs username=root, password=*******,uid=root,gid=wheel //192.168.0.22/CCTV/xeoma /mnt/CCTV/xeoma
This comes back with mount.nfs bla bla does not exist

On my NAS server the uid and gid is for that, and I do have a NFS share:
/mnt/CCTV/xeoma
 

c32767a

Patron
Joined
Dec 13, 2012
Messages
371
Anyone?
I have also tried
mount.nfs username=root, password=*******,uid=root,gid=wheel //192.168.0.22/CCTV/xeoma /mnt/CCTV/xeoma
This comes back with mount.nfs bla bla does not exist

On my NAS server the uid and gid is for that, and I do have a NFS share:
/mnt/CCTV/xeoma

Depending on what version of Ubuntu you installed (client, server, etc) you may not actually have the packages installed for Ubuntu to operate as an NFS or CIFS client.

Once you have the NFS client software installed and running, you'll need to make sure the local directory exists for the mountpoint.

For instance, if I want my NFS share accessible at /files/nfsshare, I would make sure the directory exists on my Ubuntu client and then issue the following command as root:

"mount 192.168.1.51:/mnt/vol1/nfsfiles /files/nfsshare"

The first part is the server and the path to the shared location on the server. (eg /mnt/vol1/nfsfiles, which is the kind of path I'd expect to see for a FreeNAS nfs share.) the second part is the local path where the NFS mountpoint should be attached. When the mount completes, files in /mnt/vol1/nfsfiles on the server will appear in /files/nfsshare on the client.

The mount command is intelligent enough to determine the protocol to use based on the format of the path given in the command line. The format of the path is significant. Your command above mixes CIFS and NFS formatting and won't work.

If the mount command completes without errors, you can do "df" to see the filesystem mounted.

That should get you started, but there are a ton of details you'll need to consider. The most important of which is that using this command to do an NFS mount will not persist across reboots. I would strongly suggest reading up on using NFS version 3 on Ubuntu.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
First , on my Freenas box, when I do testparm, it shows the xeoma folder as mounted, but when I do the same in my Ubuntu 18.04 client, it says that Server role: ROLE_STANDALONE, and then go a dump of service definitions, the xeoma fold is not mounted. Doing df on the ubuntu machine doesn't show the said folder as mounted.
In the /etc/fsab file on ubuntu I have this:
//192.168.0.22/mnt/CCTV/xeoma /mnt/CCTV/xeoma.
When I run:
sudo mount.cifs -o username=root, password=******uid=rob,gid=rob //192.168.0.22/CCTV/xeoma /mnt/CCTV/xeoma
It returns:
Couldn't chdir to //192.168.0.22/CCTV/xeoma: No such file or directory.
I assume it means on my Ubuntu machine, and it was the first thing I did, to mkdir CCTV and mkdir xeoma, both of which are under the /mnt folder
Doing that, I have mistakenly thought that the said folders would be mounted, and especially since I have an entry in /etc/fstab.

On my PiZero I used this to mount the PiZero folder on my Freenas box:
sudo mount -t cifs -o username=root,password=******,uid=pi,gid=pi //192.168.0.22/CCTV/PiZero/ /mnt/CCTV/PiZero.

This worked fine, but using the same format on ubuntu doesn't work.
Putting in the uid and gid in the line or ubuntu does not make any difference.

I have installed cifs utils as well nfs files, and I was only trying nfs share to see if anything, it would work.
 

c32767a

Patron
Joined
Dec 13, 2012
Messages
371
I have installed cifs utils as well nfs files, and I was only trying nfs share to see if anything, it would work.

Sorry, I don't do CIFS so I can't help you with that. All our *nix systems use NFS for file sharing.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Ok then, but could you show me a similar line for nfs that would work:

mount.nfs username=root, password=*******,uid=root,gid=wheel //192.168.0.22/CCTV/xeoma /mnt/CCTV/xeoma
as this one doesn't.

Thanks
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
This is what I did to get it working.
On the Ubuntu machine I created a .smbclient file and entered the FreeNAS server's login details, then edited the /etc/fstab file . Here I changed this:
//192.168.0.22/mnt/CCTV/xeoma /mnt/CCTV/xeoma.

to this:
//192.168.0.22/xeoma /mnt/CCTV/xeoma cifs credentials=/home/rob/.smbclient 0 0
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Ok then, but could you show me a similar line for nfs that would work:
When I've mounted NFS at the FreeNAS command line, it's simply been mount host_ip:/path/to/export /mnt/nfs. The same syntax works under Ubuntu.
 
Status
Not open for further replies.
Top