格式化硬盘驱动器时,您可以做出的选择之一是分配单元的大小。大多数人只是将其保留在推荐的默认值上,然后继续他们的生活。
但是,您是否想知道更改该数字的大小会产生什么影响?默认号码是否最适合您的需求?让我们看看哪种分配单元大小最适合您。它实际上没有你想象的那么复杂!
驱动器格式速成课程
在我们具体讨论分配单元之前,我们需要简要介绍一下驱动器格式(drive formats)。当驱动器未格式化时,物理驱动器空间就像一个广阔的领域。当您格式化驱动器时,它会被组织成地址,就好像那个广阔的领域被分割成小块土地一样。
不同的格式有不同的系统来安排可用空间,每种都有自己的优缺点,但这是另一篇文章的故事。
什么是分配单元大小?
如果格式化驱动器就像将空地转换为更小的土地,那么分配单元将是这些地块之一。它有时也被称为“集群”大小。分配单元是驱动器可以存储的最小数据位。
这意味着即使单个文件小于分配单元大小,它仍然会占用整个文件。因此,任何剩余的物理空间都被浪费了。
默认分配单元大小(Default Allocation Units Size Determined)如何确定?
哪种分配单元大小最好取决于许多因素。从驱动器的总大小到您使用的特定操作系统。必须选择分配单元大小,以便在驱动器性能和有效空间使用之间取得良好的平衡。
但是,作为一个示例,存储在系统驱动器上的文件类型可能与仅用于存储媒体文件的驱动器上的文件类型大不相同。
然后我们有固态驱动器(solid state drives)的问题,当文件碎片发生时,它不会遭受性能损失。碎片化也部分是分配大小的函数。因此,格式化驱动器时为您提供的默认分配大小是一种通用大小,在大多数情况下应该适用于大多数人。
分配单元大小(Allocation Unit Size)对性能(Performance)有什么影响?
分配(Allocation)单元大小确实对驱动器性能有影响。尤其是机械硬盘。基本上(Basically),分配单元的大小越大,分配单元的总数就越少。这是有道理的,因为您的驱动房地产“地块”更大。因此,当您的计算机必须查找数据的物理位置时,地址簿要薄得多。
这减少了驱动器的“寻道时间”。即在文件分配表中查找文件的位置,然后访问正确的分配单元需要多长时间。同样(Again),在机械驱动器上,这是一个重大问题,因为它物理上必须将硬盘驱动器的读/写磁头移动到您希望它访问的分配单元的位置。
分配大小非常小也可能导致极度碎片化。这是因为任何大于分配单元的文件都会被写入多个单元。这里的问题是,随着文件随着时间的推移被写入和删除,打开的单元可能会分散在整个驱动器中。
分配单元大小(Allocation Unit Size)对驱动器空间(Drive Space)有什么影响?
硬盘驱动器的格式化空间与包装上宣传的总原始空间不同。其主要原因与分配单元大小无关。这是因为每个人都将 1 MB 定义为 1024 KB 的一个相当愚蠢的事实,除了硬盘制造商将其四舍五入到 1000。这是因为计算机内存和存储是用二进制单位而不是十进制来衡量的,但这与分配并不严格相关单位大小。
文件的实际大小和它在磁盘上占用的空间量不同的另一个原因与分配单元大小有关。(othe)单位大小决定了文件可以在驱动器上占用的最小空间量。因此,如果您的单元大小为 4KB,但文件为 2KB,那么您最终会得到 2KB 的填充数据。如果驱动器上的每个文件只有 2KB 大小,那么您将浪费一半的驱动器空间!
问题是文件有各种大小。尤其是在系统驱动器上,可能有数百万个包含配置数据的小文本文件,还有大量媒体文件,如演示文稿或高分辨率照片。
如果您将分配大小设置得太大,则会浪费空间,因为许多单元最终会部分满。使它们太小,最终会导致文件被拆分为许多不同的分配单元。尽管现代硬盘驱动器如此之大,以至于担心浪费的文件分配单元空间已经不再重要了。
推荐的分配单元大小
所以现在你知道了分配单元是什么,它为什么存在以及当你改变它时它对性能和空间有什么影响。剩下的问题是您是否应该在现代计算机上更改它。
诚实的答案是,作为用户,在标准台式计算机上,它可能不会对您产生明显的影响。当我们谈论服务器集群或专用驱动器阵列中的专用驱动器时,它可能很重要。对您而言,最好的选择通常是将其保留在您的操作系统所说的默认值。
可能有例外。例如,假设您有一个仅用于存储大型媒体文件的外部机械USB驱动器。(USB)如果您知道该驱动器上的几乎所有文件都将大于最大分配单元大小,那么您不必担心浪费空间。将单元大小增加到比该驱动器上的典型文件更小的最大大小将使您享受更快的查找时间。
让我们尝试另一个场景。您有一台带有微型SSD作为主驱动器的超极本或上网本。类似于 16GB 或 32GB 的设备。空间(Space)非常紧张,因此通过减小分配单元大小可以减少浪费的空间。由于它是SSD ,因此数据是否在驱动器上(SSD)分段(fragmented)并不重要,因为没有读/写头。访问(Access)是即时的。
果汁值得挤压吗?
至于硬数字,我们无法告诉您哪个分配单元大小将 100% 用于哪个目的。如果您没有时间或机会进行实验,那么您还不如使用默认设置。
对于NTFS Windows驱动器,该数字为 4096 字节。微软(Which Microsoft)认为最适合典型用户的通用尺寸。仅当您知道它将使您的特定用例变得更好时,才应更改默认值。
What Allocation Unit Size Is Best for Drive Formatting
When yoυ format a hard drive, one of the choicеs you can make is what size the allocation unit іs. Moѕt people just leave it on the recommended default value and get on with their lives.
However, have you wondered what effect changing that size of that number will have? Is the default number best for your needs? Let’s look at which allocation unit size is best for you. It’s actually less complicated than you think!
A Crash Course on Drive Formats
Before we get to allocation units specifically, we need to briefly touch upon drive formats. When a drive is unformatted, the physical drive space is like a wide open field. When you format the drive it gets organized into addresses, as if that wide open field got parceled into little plots of land.
Different formats have different systems for arranging the available space, each with their own pros and cons, but that’s a story for another article.
What Is Allocation Unit Size?
If formatting a drive is like converting an open field into smaller plots of land, then the allocation unit would be one of those plots. It’s sometimes also referred to as the “cluster” size. The allocation unit is the smallest bit of data that a drive can store.
This means that even if a single file is smaller than the allocation unit size, it will still take up the entire thing. Any remaining physical space is therefore wasted.
How Is the Default Allocation Units Size Determined?
Which allocation unit size is best depends on a number of factors. From the total size of the drive to the specific operating system that you’re using. The allocation units size has to be chosen so that there’s a good balance between drive performance and efficient space use.
However, the types of files that are stored on a system drive may be very different from those on a drive that will only be used to store media files, as one example.
Then we have the issue of solid state drives, which don’t suffer from performance loss when file fragmentation happens. Fragmentation is also in part a function of allocation size. So the default allocation size that you’re offered when formatting a drive is a general purpose size that should work for most people, most of the time.
What Effect Does Allocation Unit Size Have on Performance?
Allocation unit size does have an effect on drive performance. Especially mechanical hard drives. Basically, the bigger you make the allocation unit size, the fewer the total number of allocation units. This makes sense because your “plots” of drive real estate are larger. So when your computer has to look up the physical location of your data, the address book is much thinner.
This reduces the “seek time” of the drive. That is, how long it takes to look up the location of the file in the file allocation table and then to access the correct allocation units. Again, on mechanical drives this is a significant problem because it physically has to move the read/write heads of the hard drive to the location of the allocation unit you want it to access.
Having a very small allocation size can also lead to extreme fragmentation. That’s because any files that are larger than the allocation unit will be written to multiple units. The problem here is that open units can be scattered all across the drive as files are written and deleted over time.
What Effect Does Allocation Unit Size Have on Drive Space?
The formatted space of a hard drive is different from the total raw space advertised on the packaging. The main reason for this has nothing to do with allocation unit sizes. It’s because of the rather silly fact that everyone defines a megabyte as 1024 kilobytes, except for hard drive makers who round it to 1000. This is because computer memory and storage are measured in binary units, not decimal, but that’s not strictly related to allocation unit size.
The other reason the real size of a file and the amount of space it takes up on a disk are different has to do with the allocation units size. The unit size determines the smallest amount of space a file can take up on the drive. So if your unit size is 4KB, but the file is 2KB, you end up with 2KB of filler data. If every file on the drive was only 2KB in size, you’d waste half the drive space!
The problem is that files come in all sizes. Especially on system drives, where there may be millions of small text files that contain configuration data, but also massive media files such as presentations or high resolution photographs.
If you make the allocation size too big, you’ll waste space as many units end up partially full. Make them too small and you end up with files split across many different allocation units. Although modern hard drives are so large that concern about wasted file allocation unit space doesn’t really matter anymore.
Recommended Allocation Units Sizes
So now you know what an allocation unit is, why it exists and what effect it has on performance and space when you change it. The remaining question is whether you should change it on a modern computer.
The honest answer is that it probably won’t make a noticeable difference to you as the user, on a standard desktop computer. It may matter when we’re talking about specialized drives in a server cluster or in a purpose-built drive array. For you, the best option is usually just to leave it at whatever your operating system says the default should be.
There may be exceptions. For example, let’s say you have an external mechanical USB drive that will only be used to store large media files. If you know that virtually all of your files on that drive will be bigger than the biggest allocation unit size, you don’t have to worry about wasted space. Cranking up the unit size to the biggest size smaller than the typical file on that drive will let you enjoy faster seek times.
Let’s try another scenario. You have an ultrabook or netbook with a tiny SSD as its main drive. Something like a 16GB or 32GB unit. Space is very tight, so by making the allocation unit size small you can cut down on wasted space. Since it’s an SSD it doesn’t really matter if the data is fragmented over the drive, because there’s no read/write head. Access is instant.
Is the Juice Worth the Squeeze?
As for hard numbers, we can’t tell you which allocation unit size will work 100% for which purpose. If you don’t have the time or opportunity to experiment, then you may as well just go with the default.
For NTFS Windows drives that number is 4096 bytes. Which Microsoft considers the best general purpose size for typical users. Changing the default should only be done if you know it’s going to make your specific use case better.