FreeNAS NFS share mounted on Ubuntu samba server

Status
Not open for further replies.

mmerlone

Cadet
Joined
Jun 3, 2013
Messages
9
Greetings.

I am testing FreeNAS as a NAS solution on my job with some tens network clients.

I have set FreeNAS with a NFS share '/mnt/SAS/ftp' and mounted this share on a Ubuntu server just fine on '/home/ftp'. This mount point used to be a local filesystem on this server and was just replaced by that NFS share. I set owner, group, permissions, etc and locally at the ubuntu machine everything is fine, I am able to create new files and operate normally.

The problem is that '/home/ftp' is samba exported for the network on this ubuntu server. It used to work ok when local, but now it raises an error "The process cannot access the file because another process has locked a portion of the file" when anyone try to paste a file on this share. I am still able to create an empty file foo.txt on the samba share, but when editing and trying to save I get the same error. I can delete the file afterwards with no problem.

So, in short:
FreeNAS --NFS--> Ubuntu --smbd--> Client
SSHing the ubuntu machine I can do everything just fine. The client doesn't. That smbd share used to work fine when it was local and problem started when mounting as a NFS share from FreeNAS.

On ubuntu's samba error log I get this:
Code:
[2013/06/03 11:24:18,  2] smbd/dosmode.c:97(unix_mode)
  unix_mode(ftp.xpto/Ftp/desktop.ini) inheriting from ftp.xpto/Ftp
[2013/06/03 11:24:18,  2] smbd/dosmode.c:106(unix_mode)
  unix_mode(ftp.xpto/Ftp/desktop.ini) inherit mode 42770
[2013/06/03 11:24:18,  2] smbd/dosmode.c:97(unix_mode)
  unix_mode(ftp.xpto/Ftp) inheriting from ftp.xpto
[2013/06/03 11:24:18,  2] smbd/dosmode.c:106(unix_mode)
  unix_mode(ftp.xpto/Ftp) inherit mode 42770
[2013/06/03 11:24:18,  2] smbd/open.c:2447(open_directory)
  open_directory: unable to create ftp.xpto/Ftp. Error was NT_STATUS_OBJECT_NAME_COLLISION
[2013/06/03 11:24:18,  2] smbd/dosmode.c:97(unix_mode)
  unix_mode(ftp.xpto/Ftp/***) inheriting from ftp.xpto/Ftp
[2013/06/03 11:24:18,  2] smbd/dosmode.c:106(unix_mode)
  unix_mode(ftp.xpto/Ftp/***) inherit mode 42770
[2013/06/03 11:24:18,  2] smbd/open.c:580(open_file)
  marcio.merlone opened file ftp.xpto/Ftp/*** read=No write=Yes (numopen=3)
[2013/06/03 11:24:18,  2] smbd/close.c:612(close_normal_file)
  marcio.merlone closed file ftp.xpto/Ftp/*** (numopen=2) NT_STATUS_OK



Ubuntu /etc/fstab for this mount point is:
Code:
192.168.x.x:/mnt/SATA/ftp  /home/ftp   nfs   defaults    0   0


The respective samba export is:
Code:
[ftp]
    comment = Pastas de FTP
    path = /home/ftp
    read only = No
    create mask = 0770
    force create mode = 0770
    directory mask = 0770
    force directory mode = 0770
    force group = +ftp
    inherit permissions = Yes
    hide special files = Yes
    dos filemode = Yes
    hosts allow = 127.0.0.1/32, 192.168.0.0/16


I also have problems with other two similar nfs mount points not samba exported, one for CVS and another for apache access.

Can anybody help me? Thanks in advance and best regards.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
So you are trying to export via CIFS a filesystem that is mounted over NFS from a FreeNAS server.

Um. Don't do that. It isn't expected to work. It might be kind-of possible to make it work if you aggressively disable file locking and maybe some other things, but then you have introduced other problems.

The correct answer is to have the CIFS clients mount the share from FreeNAS.
 

mmerlone

Cadet
Joined
Jun 3, 2013
Messages
9
So you are trying to export via CIFS a filesystem that is mounted over NFS from a FreeNAS server.

Um. Don't do that.
Funny you, that link it was not necessary ;) besides the first result has very good info.
I just googled wrong before.

It isn't expected to work. It might be kind-of possible to make it work if you aggressively disable file locking and maybe some other things, but then you have introduced other problems.
Indeed, mounting with nolock works. For other disabled things, I have noatime,nodev,nosuid,noexec of wich none is likely to induce errors, and are not related to the problem.

The correct answer is to have the CIFS clients mount the share from FreeNAS.
I am still digging on how to make FreeNAS join my existing samba 3.x domain. Another issue is that there is no ready bacula-client available to FreeNAS, so I have to backup from the ubuntu box, which makes me need it mounted as NFS on the samba server anyway.

So, for other googlers, this is a samba issue with NFS mount points, not a FreeNAS issue. Thanks you.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It still won't be working correctly or safely, you've just made some of the more obvious problems appear to vanish.
 

mmerlone

Cadet
Joined
Jun 3, 2013
Messages
9
Problem is I cannot join FreeNAS on my existing samba 3.x domain and thus my clients are unable to connect to \\freenas or \\ip.add.re.ss
 
Status
Not open for further replies.
Top