Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After having some problems with my NAS, I switched to Debian/Lenny. I've managed to install and configure most of the software I need, but I've hit a brick wall with Samba. I can access the shares and read all the files, but if I try and send anything across it tells me there's not enough space.

I'm using Windows, so I opened a command prompt and ran

> dir \\MyNAS.home\Public  
1 File(s)     44,814,336 bytes  
12 Dir(s)  507,998,060,544 bytes free

The free space reported is correct (~500GB), so what's the problem? The following is my smb.conf:

[global]
  workgroup = MEDUS
  realm = WORKGROUP
  netbios name = MyNAS
  map to guest = bad user
  server string = My Book Network Storage
  load printers = no
  printing = bsd
  printcap name = /dev/null
  disable spoolss = yes
  log file = /var/log/samba/log.smbd
  max log size = 50
  dead time = 15
  security = share
  auth methods = guest, sam_ignoredomain, winbind:ntdomain
  encrypt passwords = yes
  passdb backend = smbpasswd:/opt/etc/samba/smbpasswd  
  create mask = 0664
  directory mask = 0775
  local master = no
  domain master = no
  preferred master = no
  socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
  min receivefile size = 128k
  use sendfile = yes
  dns proxy = no
  idmap uid = 10000-65000
  idmap gid = 10000-65000
  dont descend = /proc,/dev,/etc
  admin users =
  null passwords = yes
  guest account = nobody
  unix extensions = no 

[Public]
  path=/shares/internal/PUBLIC
  guest ok = yes
  read only = no
  dfree cache time = 10
  dfree command = /opt/etc/samba/dfree

The dfree command parameters I added myself, in an attempt to fix the problem (which didn't work). However, I suspect that the NAS is reporting the correct disk space anyway, as evident from the results of the command I used above.

I've also tried playing around with the block size command, to no avail. I was able to create an empty text file on the share, and I repeatedly edited and saved the file — it stopped at around 130 bytes.

Does anyone have any idea what the problem might be?

share|improve this question
add comment

2 Answers

Are quotas enabled? Check with:

sudo quotacheck -avugm

Try disabling it:

sudo quotaoff -fvpa
share|improve this answer
    
+1, it was a good idea. Quotas were something that did occur to me early on, but I checked and they weren't enabled. Thanks for answering. –  Andy E Apr 6 '11 at 14:49
add comment
up vote 1 down vote accepted

After going through my smb.conf file and commenting out almost everything, I found that the problem was caused by the configuration setting min receivefile size.

This option changes the behavior of smbd(8) when processing SMBwriteX calls. Any incoming SMBwriteX call on a non-signed SMB/CIFS connection greater than this value will not be processed in the normal way but will be passed to any underlying kernel recvfile or splice system call (if there is no such call Samba will emulate in user space). This allows zero-copy writes directly from network socket buffers into the filesystem buffer cache, if available. It may improve performance but user testing is recommended. If set to zero Samba processes SMBwriteX calls in the normal way. To enable POSIX large write support (SMB/CIFS writes up to 16Mb) this option must be nonzero. The maximum value is 128k. Values greater than 128k will be silently set to 128k.

Commenting out this line in the conf file fixed the issue, I guess this is what happens when you use someone else's recommended config settings. I'm not sure I fully understand what this setting does, anyway.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.