Ext4 block size?

Purchased the NAS with 2 gigovas screw, without hesitation, put up your working directory with the source code. When we compared the size, how many it occupied on my working screw, and as he began to take on a new — horrified — about 2-3 times more. He began to dig, what's the problem — it turned out that if on the start screen, screw the block size was 4096, then the new NAS it was already 65536.

In fact, the question arises — what is the optimal block size? I have kept sources with relatively small files, and movies — ie, the spread is quite large, but how to calculate what is more profitable? Maybe there are some ready solutions?
October 8th 19 at 01:34
3 answers
October 8th 19 at 01:36
In the specific case of NASом it is cheaper to keep the source code in tar/zip without compression.
October 8th 19 at 01:38
The size of the loss to place is approximately 1/2 * block size (for some FS — fragment block in UFS) * number of files (+folder) + FS overhead * the number of blocks.
On the basis of the first term — blocks to do as little as possible, while the second — as much as possible (then the blocks will be smaller).
The first term can be evaluated directly (`df -i` to help), second — rate, comparing the full place according to the output of the command df with the proper disk size (partition), usually a difference of the order of a few percent. Ideally, both terms should be approximately equal.
October 8th 19 at 01:40
In fact, the block size makes sense when you screw with 4096 sector, about WD, there are articles about the problems associated with this
If the screw normal 512 sector, let it be default (I think 1024) if with 4096 physical sector, and block size is better to do the same, this depends directly on performance.

Find more questions by tags * nix-like systemsLinuxExtended file system