Allocation Unit Size (Formatting 500GB)

Status
Not open for further replies.

Username2324

Distinguished
Oct 26, 2008
22
0
18,510
I am about to format my 500GB harddrive and I was wondering what Allocation unit size I should use:

512Kb
1024Kb
2048Kb
4096Kb

What exactly is the Allocation size, and does it matter which I choose?
 
Allocate the full drive unless you want to partition it for some reason.

Some people choose to create partitions for their OS files, games, music.....

If you choose to partition it, each partition will be treated almost as a seperate drive.
 

Username2324

Distinguished
Oct 26, 2008
22
0
18,510
That's not quite what I meant, I am formatting the drive through windows on my TB drive, and it asks what allocation unit size (the above except its in bytes). I dont know what it means but from other forums they say 4096 bytes is best.

Thanks anyways
 

MrLinux

Distinguished
Dec 28, 2007
1,036
0
19,310
Allocation units are the granularity with which disk space will be allocated to files, so if you have a 4k allocation unit, a 1k file will be allocated 4k, and a 10k file will be allocated 12k. A smaller allocation size will give less "wasted" space, but will also be slower to access (actual data) due to increased MFT/FAT access.
 

CaRLiTo99

Distinguished
Apr 11, 2010
1
0
18,510
hello user232 !!!
these guyz knw wat allocation size is... but cant help you in the manner you desire... listen u already read wat Mr. Linux sed.. in simple word
less speed more space... more speed less space
your answer is: 4096KB (recommended for normal usage...)
 
G

Guest

Guest


I've never been here before but looking for a simular question and you seem the one to ask. 4096KB... 1.) what do you mean recommended for normal usage and 2.) does it change when dealing with say a Seagate FreeAgent 1.5? Thanks
 

Q22

Distinguished
May 28, 2010
1
0
18,510
Hey

With reference to your questions;

1) It's basically a toss-up between space and speed. Usually, with FAT32, the drive allocates a substantial amount of space to what's commonly known as 'slack', to allow for reasonable operating speeds.

The same principle applies to NTFS. The choice is merely based on the allocation size for each byte of data on the hard drive.

The lower the allocation size, the more space you have, but accessing the data on the drive will be slow and vice versa.

The default unit allocation size is a good balance between space and speed, so my advice would be to stick with 4096 bytes.

Fear not, you will gain space by reformating from FAT32 to NTFS and you can always change back again if need be.

2) The above applies to hard drives of all sizes, both internal and external and is not dependant on the software you recieve on the drive or choose to install at a later stage.
 

Weezy_21

Distinguished
Nov 16, 2011
1
0
18,510
Hey - I came across this forum because I own a 1 TB Western Digital external hard drive and I could not transfer files over 4 GB onto the drive. After some research, I came to the conclusion that I had to format my drive and use a new file system. The default file system is NTFS with an allocation unit size of 4096 bytes. I had to change this to a exFAT file system and I chose to use an allocation unit size of 32768 kilobytes (the largest listed). This worked best for me because I transfer large files. If you transfer smaller files you should choose a smaller allocation unit size. It took a while to format the drive(obviously, make sure you backup all of your files prior to formatting or else you will lose everything), but now my drive is able to accept files over 4 GB. Good luck!
 


Your drive must have originally been FAT32 which has a maximum file size of 4GB. NTFS has a file size limit of 16TB.
 

Nate1985

Distinguished
Nov 25, 2011
1
0
18,510
When it comes to formatting a Hard Drive for a PC Based compurter NTFS is the way to go.
NTFS provides security when it comes to file sharing and other such things.. as well as it allows much larger files to be stored.

However if you have both a PC and a MAC and want to use the Hard Drive for both the FAT format will be your only option.

With regards to the allocation size:
Allocation refers to the size of each "section" of memory on the hard drive. For instance the recomended allocation size is 4096 bytes (4 kilobytes).
The hard drive is split into sections so that it has a way to find information that you put on it. When you format the hard drive your hard drive developes what is called a "Allocation Table" that is like a built in spread sheet that keeps track of what data is put where on the drive.

What this means:
Lets say you have a file that is 1024 bytes and you save it to your hard drive. Your hard drive will find the first available "Section" and place that file in it. Even tho that file is only 1024 bytes it will consume the entire 4096 byte section and nothing else will be allowed to be saved in that "section" of the hard drive. So essentually you lost 3072 bytes (4096 - 1024).
Conversly if you have a file larger then the 4096 bytes the file will simply fill the first "section" and spill over to the next.

So like the others said; the smaller the allocation size you use, the less Hard Drive space that will go to waste. But your Hard Drive will run a little slower because it has more "sections" to check.

The larger the allocation size you use, the more Hard Drive space that will go to waste. But your Hard Drive will run a little faster because it has less "Sections" to check.

Hope this helps a little..
 

roadrunner440x6

Distinguished
Jan 4, 2012
1
0
18,510


Are these wasted spaces recovered through defrag?

When formatting my SSD, it was recommended I align the partition myself. The alignment figure I was given was 4096. Do these two number have any correlation? Specifically, does having the same value have any affect on their ability to transfer data to each other, or are these two numbers irrelevant, and just a coincidence?
 

johnthelad

Distinguished
Jan 3, 2012
4
0
18,510


Irrelevant and just a coincidence. Since the foundational language of electronics is binary, everything's multiples of two, or 2^X. 4096 is 4*2^10, so multiples of 2 show up everywhere. Still stick with 4KB though because it is a good balance between speed and archival. You only need massive cluster sizes if you're running protein folding or physics software or a server farm.

Example: I have a WD 320GB 7200RPM drive with 4MB cache and a default cluster size of 4096 and a WD 80GB 7200RPM 4MB cache and set it's cluster size to 16K. The 320 processes and transfers faster, averaging 30-33MB/s compared to the 80s 16-20MB/s, but for files over 16GB in size, the 80GB goes faster, about 35-51MB/s, especially for encryption and games. But even modern games aren't that big yet.

And no, you can't recover the space. It's technically part of the file. Though it doesn't amount to much. Maybe a few GB on a 1TB hard drive.
 

williams101

Distinguished
Feb 6, 2012
2
0
18,510
Agree with the guys so far.

To add my 2 bytes worth...

It is going to depend on what you are using the drive for... e.g. if you are storing large VHD files (for virtualisation), large movie files or exchange databases etc. you should probably put them on the largest allocation unit as you won't lose very much.

The point is, each file starts at the beginning of a block sized at 4096 bytes by default and 10x 512 byte files will use 10 blocks of 4096 bytes (40960 bytes). So if you increase the block size to 32kbytes, then create 10 512 byte files, you will use 320kbytes (10 x 32kbytes). Every file starts at the beginning of a block. If the file is bigger than the allocation unit, it will use as many units as needed to more than cover it. 9.6 blocks needed -> 10 get used and the 0.4 is wasted.

The key to changing it is to know what sort of data is going to be stored ahead of time. The 4k cluster size is more than likely based on an analysis (by Microsoft) of average file sizes - which is probably out of date. My advice, unless you know you are storing especially large or especially small files which need to perform better, leave it alone.
 
Status
Not open for further replies.