Timeouts on SMB Share from Ubuntu

Status
Not open for further replies.

Geek Baba

Explorer
Joined
Sep 2, 2011
Messages
73
Does the problem still occur if you try NT1 with Unix extensions turned off? I'm curious if it's a problem with NT1 Unix Extensions. If we can narrow down enough, you might be able to post a bug report against cifs-utils. :)
I can try that, but from the description it looks like this is to help UNIX system right?
Code:
allows non-Windows SMB clients to access symbolic links and hard links, has no effect on Windows clients
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I can try that, but from the description it looks like this is to help UNIX system right?
Code:
allows non-Windows SMB clients to access symbolic links and hard links, has no effect on Windows clients

That's not the full story. I believe that there aren't any SMB2 Unix Extensions, and SMB3 extensions are still under development. The main things NT1 unix extensions buy you is the ability to mkfifo, mknod, improved user / group mapping, etc. Basically, it makes SMB more like a posix filesystem.
 

Geek Baba

Explorer
Joined
Sep 2, 2011
Messages
73
That's not the full story. I believe that there aren't any SMB2 Unix Extensions, and SMB3 extensions are still under development. The main things NT1 unix extensions buy you is the ability to mkfifo, mknod, improved user / group mapping, etc. Basically, it makes SMB more like a posix filesystem.
Ok so I just turn off unix extension off and use SMB2 right?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Ok so I just turn off unix extension off and use SMB2 right?

The problem does not occur when using SMB2, right?
I was trying to troubleshoot NT1 connection problems (I believe Linux clients default to NT1). Turn off Unix Extensions and modify the mount string on the linux client to specify NT1 (vers=1 or however cifs-utils designates it).
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
Arg, I must be missing something.... changing the smb version from 1.0 to 2.1 (or 2.0 or 3.0 for that matter) seems to cause the share to be mounted with stranger permissions.

OS Info:
FreeNAS: FreeNAS-9.10.2-U4 (27ae72978)
Ubuntu: Ubuntu 16.04 LTS

I have the following line in my /etc/fstab file on my Ubuntu VM:

//10.10.10.10/Media /mnt/Media cifs credentials=/etc/mount_Media,vers=1.0,iocharset=utf8,rw,uid=1000,gid=1000 0 0

And Ubuntu mounts the share properly. I have the following auxiliary parameters specified in the 'Media' share configuration on FreeNAS:

create mask = 666
force create mode = 666
directory mask = 2777
force directory mode = 2777
force user = nobody
force group = nobody

So when I specify vers=1.0 in my fstab file on Ubuntu, the share gets mounted with relaxed permissions. When I switch to vers=2.1, I can browse the directories and I can sort of write files.... the command 'touch test' produces the following result:

touch: setting times of 'test': Permission denied

The 'test' file is created. I can delete it as well. Adding sudo in front of the touch command produces the same result.
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Arg, I must be missing something.... changing the smb version from 1.0 to 2.1 (or 2.0 or 3.0 for that matter) seems to cause the share to be mounted with stranger permissions.

OS Info:
FreeNAS: FreeNAS-9.10.2-U4 (27ae72978)
Ubuntu: Ubuntu 16.04 LTS

I have the following line in my /etc/fstab file on my Ubuntu VM:

//10.10.10.10/Media /mnt/Media cifs credentials=/etc/mount_Media,vers=1.0,iocharset=utf8,rw,uid=1000,gid=1000 0 0

And Ubuntu mounts the share properly. I have the following auxiliary parameters specified in the 'Media' share configuration on FreeNAS:

create mask = 666
force create mode = 666
directory mask = 2777
force directory mode = 2777
force user = nobody
force group = nobody

So when I specify vers=1.0 in my fstab file on Ubuntu, the share gets mounted with relaxed permissions. When I switch to vers=2.1, I can browse the directories and I can sort of write files.... the command 'touch test' produces the following result:

touch: setting times of 'test': Permission denied

The 'test' file is created. I can delete it as well. Adding sudo in front of the touch command produces the same result.
That's because "unix extensions" aren't supported in >SMB1. Try removing "uid=1000,gid=1000" and add "noperm".
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
That's because "unix extensions" aren't supported in >SMB1. Try removing "uid=1000,gid=1000" and add "noperm".

Thanks for the reply!

I made the suggested changes, rebooted the Ubuntu VM and I am still getting a permission denied message:

"touch: cannot touch 'test': Permission denied"

Tried with sudo and I get the same message :(

I think I'll make a new share and fiddle around with it. I must have some unique switch turned on causing some issue.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Thanks for the reply!

I made the suggested changes, rebooted the Ubuntu VM and I am still getting a permission denied message:

"touch: cannot touch 'test': Permission denied"

Tried with sudo and I get the same message :(

I think I'll make a new share and fiddle around with it. I must have some unique switch turned on causing some issue.
Perhaps you can PM me a debug file.
 

Geek Baba

Explorer
Joined
Sep 2, 2011
Messages
73
The problem does not occur when using SMB2, right?
I was trying to troubleshoot NT1 connection problems (I believe Linux clients default to NT1). Turn off Unix Extensions and modify the mount string on the linux client to specify NT1 (vers=1 or however cifs-utils designates it).
Finally was able to do this today, created a brand new ubuntu instance and was able to reproduce it after disabling unix permission and using default cifs mount option.
 

mloiterman

Dabbler
Joined
Jan 30, 2013
Messages
45
Finally was able to do this today, created a brand new ubuntu instance and was able to reproduce it after disabling unix permission and using default cifs mount option.

Perhaps I can add to the discussion with the following data points.

I have the following running as separate physical machines (no VMs):
  1. FreeNAS-9.10.2-U4 (27ae72978)
    Samba Version 4.5.10
  2. Debian (8.8) 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux
    Samba Version 4.2.14-Debian
  3. Raspberry Pi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
    Samba Version 4.2.14-Debian
FreeNAS Samba Options:
Code:
ea support = no
store dos attributes = no
map archive = no
map hidden = no
map readonly = no
map system = no
ntlm auth = yes


Debian /etc/fstab:
Code:
//freenas-server/backup /mnt/backup cifs sec=ntlm,credentials=/etc/cifspasswd,iocharset=utf8 0 0

Raspberry Pi /etc/fstab:
Code:
//freenas-server/share/Games /home/pi/RetroPie/roms cifs sec=ntlm,username=xxxx,password=xxxx,uid=pi,gid=pi,nounix,noserverino,users,x-systemd.automount 0 0

The Debian machine and share mount cause no problems on my FreeNAS box.

The Raspberry Pi machine, after mounting the share, causes the following problems:

  1. 12%-20% CPU usage
  2. Constant 650Kb to 1Mb Network traffic from the box to the LAN
I also get hundreds of entries like this when I run netstat:

Code:
tcp4	   0	  0 freenas-server.microsoft-d raspberrypi.54371	   TIME_WAIT


After unmounting the share, all the TIME_WAIT entries die off and the network traffic stops. Would really like to solve this.
 

Geek Baba

Explorer
Joined
Sep 2, 2011
Messages
73
Perhaps I can add to the discussion with the following data points.

I have the following running as separate physical machines (no VMs):
  1. FreeNAS-9.10.2-U4 (27ae72978)
    Samba Version 4.5.10
  2. Debian (8.8) 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux
    Samba Version 4.2.14-Debian
  3. Raspberry Pi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
    Samba Version 4.2.14-Debian
FreeNAS Samba Options:
Code:
ea support = no
store dos attributes = no
map archive = no
map hidden = no
map readonly = no
map system = no
ntlm auth = yes


Debian /etc/fstab:
Code:
//freenas-server/backup /mnt/backup cifs sec=ntlm,credentials=/etc/cifspasswd,iocharset=utf8 0 0

Raspberry Pi /etc/fstab:
Code:
//freenas-server/share/Games /home/pi/RetroPie/roms cifs sec=ntlm,username=xxxx,password=xxxx,uid=pi,gid=pi,nounix,noserverino,users,x-systemd.automount 0 0

The Debian machine and share mount cause no problems on my FreeNAS box.

The Raspberry Pi machine, after mounting the share, causes the following problems:

  1. 12%-20% CPU usage
  2. Constant 650Kb to 1Mb Network traffic from the box to the LAN
I also get hundreds of entries like this when I run netstat:

Code:
tcp4	   0	  0 freenas-server.microsoft-d raspberrypi.54371	   TIME_WAIT


After unmounting the share, all the TIME_WAIT entries die off and the network traffic stops. Would really like to solve this.
What is the kernel version of your both distros?
 

mloiterman

Dabbler
Joined
Jan 30, 2013
Messages
45
What is the kernel version of your both distros?

already listed above, but:

Raspian: #993 SMP Wed Apr 26 18:01:23 BST 2017
Debian: #1 SMP Debian 3.16.43-2 (2017-04-30)

I also have the following other physical machines connected to FreeNAS without incident:
  1. Mac: 10.12.5
  2. FreeBSD 1: FreeBSD 10.1-RELEASE-p3 #0 r276637
  3. FreeBSD 2: FreeBSD 11.0-RELEASE-p10 #0 r318949
The only machine and OS that has an issue is the Raspian with Kernel #993 SMP Wed Apr 26 18:01:23 BST 2017
 

Geek Baba

Explorer
Joined
Sep 2, 2011
Messages
73
already listed above, but:

Raspian: #993 SMP Wed Apr 26 18:01:23 BST 2017
Debian: #1 SMP Debian 3.16.43-2 (2017-04-30)

I also have the following other physical machines connected to FreeNAS without incident:
  1. Mac: 10.12.5
  2. FreeBSD 1: FreeBSD 10.1-RELEASE-p3 #0 r276637
  3. FreeBSD 2: FreeBSD 11.0-RELEASE-p10 #0 r318949
The only machine and OS that has an issue is the Raspian with Kernel #993 SMP Wed Apr 26 18:01:23 BST 2017
No its not listed - please run this and post the output for each system:
Code:
uname -r
 
Status
Not open for further replies.
Top