File Sizes from Samba Share are too High - CentOS 7 - Encrypted

My new server has CentOS7 installed. I’ve used LVM to span together 4 - 1TB drives into a large Logical Volume. I’ve encrypted the volume. I installed Samba and shared a folder.

It all works well until I look at the "size on disk" reported from Windows 10. The “Size On Disk” being reported is sometimes double the real size.

When I test the same from my Windows 7 workstation, the file sizes are reasonable. Please see screenshots attached.

Other NAS shares on my network don’t display this issue from W10 or W7. Is there a fix on the CentOS server for this?

Thank you!

John Caspary
dllhost_2017-12-13_13-28-41.png
dllhost_2017-12-13_13-30-47.png
mstsc_2017-12-13_13-29-37.png
mstsc_2017-12-13_13-32-19.png
JohnMan777Asked:
Who is Participating?
 
McKnifeCommented:
YES!

I asked our Linux admin and this is what he did: 1st, open the man page for smb.conf (command: man smb.conf)
 Inside, you find this section:
"allocation roundup size". All the info needs to be considered.

To report correct sizes, open /etc/samba/smb.conf with vi or geany or whatever, move to the section [global] and set
allocation roundup size = 0 

Open in new window

Afterwards, restart the smb daemon (rcsmb restart).
Fixed.
0
 
arnoldCommented:
You are encrypting the data,
Create a single character file and see what the inode size is.
0
 
tfewsterCommented:
You missed describing a step - how did you create the filesystem on the volume?

"Size on disk" will be the minimum number of filesystem blocks* needed to hold the file. If the block size is 1kb, a file smaller than that still reserves a 1k block of disk. A 3.5k files needs 4 blocks. That's indicated by the W7 screenshots, assuming W7 has detected the filesystem blocksize correctly. W10 clearly hssn't, as it thinks the filesystem blocksize is 1mb.

* When new filesystems are created, mkfs formats the volume into blocks**, each with an address.  When a file is created, it's allocated one of those blocks. The inode (information node) for a file lists all the block addresses used for that file, and adds new blocks as the file expands.

** Block size is a trade-off between efficiency and physical space usage. Small blocks lead to file fragmentation and a large inode table to keep track of blocks, large blocks limit the number of files that can be stored.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
JohnMan777Author Commented:
tfewster,

What can be done to have Windows 10 show it correctly? Is this a bug in windows 10?

Thank you,

John
0
 
JohnMan777Author Commented:
arnold,

How does one do that?

Thank you,

John
0
 
McKnifeCommented:
John, simply ignore what windows tells you - it is wrong. 1 MB is wrong, check the file sizes on linux, everything is ok, it's a misdetection. We had exactly the same recently on a new samba file server.
0
 
arnoldCommented:
As McKnife,
In the Linux in the samba share space, echo 'a' >test_file
ls -l test_file
This will tell you the minimum space
Another option
df -I
This will tell you how many inodes are available divide the total storage by the inode count. It will tell the how much space each inode represents.
On each mounted file system.
0
 
JohnMan777Author Commented:
McKnife,

I believe your advise is the best. Simply ignore it.

However I believe Windows 7 is closer to the truth than Windows 10.  How can I get W10 to speak more honestly?

Thank you,

John
0
 
JohnMan777Author Commented:
Arnold,

Here is the result you requested:

-rw-r--r--. 1 root root     2 Dec 14 08:07 test_file

I'd like a way for Windows 10 to display the result similar to Windows 7. If this isn't possible, I'll give up on this issue. It seems like a but in Samba or Windows 10.

Thank you,

John
0
 
arnoldCommented:
look at df -i it reports the number of individual files that can be created on the partition.
0
 
JohnMan777Author Commented:
Does anyone know how to get this fixed in windows 10?
0
 
JohnMan777Author Commented:
Amazing! This fixed it. Thanks a million!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.