Samba SMB share hosted on Debian "Jessie" in a private home network setup.

Can connect to share, open files and copy files to / from share OK.

Attempting to make any changes to a file on the share (example: edit a text document) results in ALL CONTENT OF THE FILE ERASED. File itself remains on share but with file size of 0.

Shared directory on the server has permissions 775.

Have tried chown combinations of root:root and root:users without success.

Settings smb.conf for share sets both writable=yes and browsable=yes. Have tried combinations of force user, force group and create mask without success.


security = user
encrypt passwords = true
obey pam restrictions = yes
unix password sync = yes

EDIT: I seem to have narrowed down the issue to Leafpad, specifically. Other apps seem to be able to edit documents on the share OK. Ironically, I was using Leafpad as the simplest tool to test opening and editing.

  • Is "ALL CONTENT OF THE FILE ERASED" an error message that you get from something? If so, what produces this message? Or are you just using formatted text to emphasise the problem at hand? Is there anything relevant in the log files under /var/log/samba? How much disk space do you have on the partition hosting your Samba share (df -h /path/to/samba/share/...) May 11, 2015 at 22:41

2 Answers 2


One of the few reasons for a file being truncated unexpectedly is lack of disk space.

It would be worth confirming the amount of available disk space using df -h. For example, if the share is hosted on /home/share then the command df -h /home/share will provide the necessary information.

$ df -h /home/share
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        15G   12G  2.1G  85% /

In this example there is 85% used, so 15% available on the root partition hosting /home/share.

Typically 5% of the available disk space is reserved for root, so unless there is at least this amount of disk space files cannot be created or extended except by the root user. (Samba does not generally write files with root ownership.)


This is a known bug:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .