Ubuntu VM Size on Disk Massive

makani47

Cadet
Joined
Jul 1, 2019
Messages
5
I'm pretty new to FreeNAS, so this may be a simple matter. I created a Ubuntu Server VM in FreeNAS with a 30GB zvol. When I created it, I used all the default settings. In Ubuntu I created a Samba share and mapped it on my Windows computers. I transferred some Docker config directories to it coming in at 4.12GB. When you check the size, the size shows 4.12GB but the Size on disk shows 19.0GB. To me this is a huge difference and will fill my VM pretty quickly. I've looked online but can't seem to find a good solution. I'm not exactly sure where to go from here. I've deleted and recreated the VM 3 times now with no luck. I'm sure I am lacking some needed info to really help, just not sure what info I need to provide for this. Any help would be appreciated. Thank!
 

Attachments

  • Capture.JPG
    Capture.JPG
    73.1 KB · Views: 218

makani47

Cadet
Joined
Jul 1, 2019
Messages
5
I have not. I'm wondering if its just how Windows 10 is rounding up the file sizes when viewing the Samba shares. For instance a folder that is 450MB shows as like 15GB. This folder has a ton of very small <1mb files. If I putty into Ubuntu directly and run df -h, it shows I'm at about 62% of my 30GB virtual disk. If I check the Size on Disk for my entire Samaba shares coming from that VM, it far exceeds 30GB.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I have not. I'm wondering if its just how Windows 10 is rounding up the file sizes when viewing the Samba shares. For instance a folder that is 450MB shows as like 15GB. This folder has a ton of very small <1mb files. If I putty into Ubuntu directly and run df -h, it shows I'm at about 62% of my 30GB virtual disk. If I check the Size on Disk for my entire Samaba shares coming from that VM, it far exceeds 30GB.

Regarding samba shares, there's a default 1mb allocation roundup size parameter. It's disabled in 11.3, but will be default in any samba instance that isn't explicitly configured differently.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Can that be changed after the fact? Hate to have to redo everything.

Yes, absolutely.

1562789235106.png


Allow me to throw a little asterisk into things though in that it might cause a performance loss on certain very specific write workloads. For digging down that rabbit hole, check out the samba.org page here (yes, I'm aware it says "Linux performance" but it still has relevant information ;) )

https://wiki.samba.org/index.php/Linux_Performance
 

makani47

Cadet
Joined
Jul 1, 2019
Messages
5
Oh great! Glad to know it can be changed. I'll check out that link, it looks like quite a read. Not sure if it says anywhere about recommending roundup sizes?
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Oh great! Glad to know it can be changed. I'll check out that link, it looks like quite a read. Not sure if it says anywhere about recommending roundup sizes?
The upcoming 4.11 version of SMB will actually have the default disabled entirely according to the roadmap; @anodos might be able to speak to what the default will be in FreeNAS 11.3 or if it will be 0 as well - you can make this change now by setting the allocation roundup size = 0. However this might result in timeouts when handling "sparse" files from a Windows client as described in the samba.org page:

The Windows NTFS file system, although able to support "sparse" files, is a more traditional file system in that writing one byte at position 500MB will force the file system to immediately allocate the intermediate blocks. This can take some time, and so SMB and SMB2 network traffic uses the strategy described below to avoid request timeouts.

If you disable the roundup size or reduce it too far, writing to 500MB+1 bytes in a "sparse file" like this might result in timeouts, because SMB won't be able to "cheat" the allocation roundup size by "writing one byte per 1MB"

Personally I'd just ignore the loopy result Windows gives you for "size on disk" and pull the usage from Ubuntu instead. (And for giggles, see if ZFS is compressing it further.)
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
The upcoming 4.11 version of SMB will actually have the default disabled entirely according to the roadmap; @anodos might be able to speak to what the default will be in FreeNAS 11.3 or if it will be 0 as well - you can make this change now by setting the allocation roundup size = 0.
11.3 will be on Samba 4.10, but allocation roundup size will follow upstream guidelines for 4.11.
FreeNAS 12 will have Samba 4.11.
 

makani47

Cadet
Joined
Jul 1, 2019
Messages
5
As long as its not using up a lot of unnecessary disk space, which it doesn't appear to be, I'm fine with leaving it as is.
 
Top