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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnMan777Author Commented:
Amazing! This fixed it. Thanks a million!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.