Size on disk is 2.3X file size

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Thomas H

Member
Dec 2, 2017
60
25
18
53
My Size on disk is 2.3X of the file size. See picture attached. The test file is a large 1.0 GB .mp4 video file. It is stored on a ZFS storage on proxmox LXC bind mount shared from Samba. Pool created with these settings:
  • zpool create -o ashift=12 -o autoexpand=on tank raidz2 \ <list of ten 4TB HDDs)
  • zfs set compression=lz4 recordsize=4k xattr=sa dnodesize=auto tank
What is causing this?
 

Attachments

vl1969

Active Member
Feb 5, 2014
634
76
28
It has something to do with your coaster size and allocation.
Apparently your file require twice the cluster space on disk.
The size on disk is almost always larger than actual file size, and greatly depends on youf FS coaster block size and some other parameters.
 

Thomas H

Member
Dec 2, 2017
60
25
18
53
The drives are HGST HMS5C4040ALE640. "Sector size (logical/physical): 512 bytes / 4096 bytes" and my ashift=12.
Code:
cat /sys/block/sda/queue/{logical_block_size,physical_block_size,optimal_io_size}
512
4096
0
Code:
# fdisk -l
Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: DC21978B-3A79-5249-99C6-AE946843D642

Device          Start        End    Sectors  Size Type
/dev/sdb1        2048 7814019071 7814017024  3.7T Solaris /usr & Apple ZFS
/dev/sdb9  7814019072 7814035455      16384    8M Solaris reserved 1