E
E
eaa2012-03-22 13:53:30
linux
eaa, 2012-03-22 13:53:30

ext4 - block size?

I bought a NAS with a 2-gig screw, without hesitation I uploaded my working directory with sources there. When I compared the size, how much it took on my working screw and how much it began to take on a new one, I was horrified - about 2-3 times more. I began to dig into what the problem was - it turned out that if the block size on the working screw was 4096, then on the new NAS it turned out to be already 65536.
Actually, the question arises - what is the optimal block size? I store both sources with relatively small files, and films - i.e. the spread is quite large, but how to calculate which is more profitable? Maybe there are some ready-made solutions?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
gaelpa, 2012-03-22
@gaelpa

In a specific case with a NAS, it is more profitable to store the sources in tar / zip without compression.

Z
zuborg, 2012-03-22
@zuborg

The size of the space loss is approximately 1/2 * block size (for some FS - block fragment, as in UFS) * number of files (+folders) + FS overhead * number of blocks.
Based on the first term, the blocks should be made as small as possible, and from the second, as many as possible (then there will be fewer blocks).
The first term can be estimated directly (`df -i` for help), the second can be estimated by comparing the total space according to the output of the df command with the actual size of the disk (partition), usually the difference is of the order of a few percent. Ideally, both terms should be approximately equal.

@
@ismt, 2015-07-03
_

In fact, the block size makes sense when the screw is with a 4096 sector, there are articles about WD related to this
. to do the same, performance directly depends on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question