What is block size in operating system?

Compiler

Disciple
Hi i know little bit about blocks in harddisk.
Whenever i format any harddisk it ask me for block size(mostly default allocation size will be selected which i guess is 4096 byte i.e. 4k).

Can you guys please explain whats the funda of block size in formatting the hardisk.What if i make it too large like 1 mb ? or what if i make them very small i.e. 1k?
Why 4k is considered to be standard?
 
IIRC, make the block size larger if you store large files on the partition like isos or movie files. Make it smaller if you need to save space and store small files, like, source code files. Making it too small will decrease speed and too large will waste space.
 
haraakiri said:
IIRC, make the block size larger if you store large files on the partition like isos or movie files. Make it smaller if you need to save space and store small files, like, source code files. Making it too small will decrease speed and too large will waste space.
Got it but why 4k is considered to be standard.Is the operating system is build that way?

This is what i understand correct me if i m wrong.

if you format your disk with 4k block size and store 9k file then 3k get waste on 3rd block where the file is been written.

But my question is why 4k is considered to be standard?

Can u please guide on what should be the block size if the iso or movie file size is about 700mb?

Do they consider this factor while formatting an operating system?

Does it really make any difference?
 
pinga123 said:
Got it but why 4k is considered to be standard.Is the operating system is build that way?

This is what i understand correct me if i m wrong.

if you format your disk with 4k block size and store 9k file then 3k get waste on 3rd block where the file is been written.

But my question is why 4k is considered to be standard?

Can u please guide on what should be the block size if the iso or movie file size is about 700mb?

Do they consider this factor while formatting an operating system?

Does it really make any difference?

There is a a huge performance hit when going for a block size <4K in WinXP. I once tried a block size of 512 bytes for my HDD and the system slowed to a crawl during installation of the OS itself.

The performance drop is probably due to the extra overhead required to address each block independently.

Choosing a block size >4K does result in some small performance gain if I recall correctly but you get a lot of wasted space on your system. This only matters on your main drive i.e the HDD where you store your OS. An OS drive generally contains a large no.of small files and a large cluster size wastes a bit more space. However, this used to be an area of concern earlier. I don't know how much of a concern it is right now with HDDs being relatively cheap and 500GB being almost the standard minimum size of a HDD today.

If you use your HDD to store a lot of media(movies, songs etc), a larger cluster size would be much better IMO.
 
sydras said:
If you use your HDD to store a lot of media(movies, songs etc), a larger cluster size would be much better IMO.
I've found this is more reverse reasoning than actual mesaurable fact. The idea being too small a block size makes things slow therefore larger block sizes ought to speeds things up. Not always true, even if all you store on the HDD is large media files because the OS cache + HDD cache work behind the scenes making these factors less of an issue. Just stick with the default 4k size which is default for NTFS.

If the OP wants to play around with different block sizes to see if it makes any tangible difference then he should use Iozone to benchmark various block sizes and see whether there are any improvments in terms of read & write speeds for large file sizes.

We expect a report from the OP on his findings in this regard by 0900 tomorrow :P
 
Back
Top