1-byte file takes up 2 MB (yes, megabytes) on 6 TB exFAT Veracrypt volume. Why?

0

Screenshot:

File properties of file that takes up 2MB of disk space for 1 byte of data:

enter image description here

The drive is a 6TB single partition, mounted via Veracrypt and formatted as exFAT. The sector size on my 2TB volume, formatted and mounted the same way, is 512KB-- also large, but not quite as ridiculous (shouldn't it be 512 bytes?).

Why in the world is the sector size a whopping 2MB here? Since it's an advanced format drive, shouldn't it be 4KB?

The drives were formatted using Veracrypt; there was no option to specify sector size that I recall there is a cluster size option, but it maxes out at 64KB for exFAT. The 6TB drives and all their data are about to be moved to a RAIDZ2 ZFS array, so I don't necessarily need to fix this directly, but I really want to know how/why this happened.

J.D. Mallen

Posted 2017-11-29T19:30:31.693

Reputation: 103

Are you sure you’re not confusing IO block size and “cluster size”, a filesystem property? exFAT supports very larger clusters. You can check using diskpart’s filesystems command after selecting the volume. – Daniel B – 2017-11-29T19:56:07.167

It's quite possible I am. However, the mounted Veracrypt volumes do not appear in diskpart, just the "RAW" disks/volumes. – J.D. Mallen – 2017-11-29T20:07:03.490

What is content of the .text file – Dave – 2017-11-29T20:07:29.510

The single letter 'a'. – J.D. Mallen – 2017-11-29T20:08:49.950

I don't know about the implementation details, but crypto-hashing a zero-length string is going to have an output that is the same length as an input that is at the input-string-size limit. In addition, the size on disk is probably an information leak, and I suspect that what is happening is that the reported size includes bytes shared by other encrypted files/blocks/padding. Kind of like an archive file, only lower level. – Yorik – 2017-11-29T21:28:04.510

@Yorik No, Windows and Explorer don't know anything about the encryption, it's completely transparent. // I'll try what Windows does when formatting a 6 TB exFAT volume, and also what VeraCrypt does. It's quite possible the sector size dropdown is wrong for exFAT. – Daniel B – 2017-11-29T23:13:04.780

Answers

3

Well I can confirm that exFAT on a 6 TB volume defaults to 2 MiB clusters on Windows 10. If I explicitly select 64 KiB, it uses that though. 64 KiB is also the maximum size Disk Management has in its dropdown list.

Incidentally, Microsoft has an article on default cluster sizes for various filesystems and Windows version. Unfortunately, it does not include the exFAT/Windows 10 combination, for whatever reason.

Experimentally, I determined the following defaults:

Volume size   Cluster size
  500 GiB          128 KiB
 1000 GiB          256 KiB
 1500 GiB          512 KiB
 2000 GiB          512 KiB
 3000 GiB            1 MiB
 4000 GiB            1 MiB
 5000 GiB            2 MiB
 8000 GiB            2 MiB
10000 GiB            4 MiB
20000 GiB            8 MiB

Those are just samples, I didn’t bother checking the actual ranges. The pattern is quite clear though. It switches at powers of two, ie. 512 GiB, 1 TiB, 2 TiB, 4, TiB, 8 TiB, 16 TiB, ...

It’s basically

(volume size “step”) / (221)

Or, more colloquially: Divide by two, go two SI suffixes lower. 16 TiB → 8 TiB → 8 MiB.

Daniel B

Posted 2017-11-29T19:30:31.693

Reputation: 40 502

Maximum. Just as mentioned in the question. – Daniel B – 2017-11-30T22:10:52.157

It's the largest value in the dropdown list. That doesn't make it a technical limitation. Using diskpart, you can select all possible values. – Daniel B – 2017-11-30T22:37:40.840

Alright, I now understand what you meant. – Ramhound – 2017-12-01T00:02:59.330

That's surprising! But thank you for the answer and looking into it. I'll be careful not to just go with the default next time. – J.D. Mallen – 2017-12-04T03:27:24.517

just found this out myself as well. 2MiB cluster size...I was getting gigabytes of wasted space for just 30MB of small files. Absolutely insane, wonder why Microsoft thought this was a good idea – woojoo666 – 2018-09-16T09:27:15.930