官术网_书友最值得收藏!

Configuring sector sizes

In a computer storage system, the allocation unit or a cluster is a unit of disk space allocated to files. An allocation unit is the smallest unit, or disk space, that an operating system can assign to store the data, that is, a file. Allocation unit sizes vary, depending on the chosen filesystem. This diagram shows the physical structure of a disk system, illustrating the differences between DISK SECTOR, TRACK SECTOR, CLUSTER OR ALLOCATION UNIT, and TRACK:

NTFS supports several allocation unit sizes, while ReFS has fewer choices, as shown here:

For example, if you store a 20-kilobyte file on a disk formatted with 16-kilobyte allocation units, the operating system allocates two allocation units for storing the file, or 32 kilobytes in total. That means the 20-kilobyte file uses 32 kilobytes of disk space. The difference, 12 kilobytes, is called slack space. The default NTFS allocation unit size is 4,096 bytes, although you can choose between 512 and 64 kilobyte sizes.

Depending on the sector size and on the typical file sizes you store on a volume, the slack space varies. For example, if you store mostly large files on a volume formatted with a smaller size sector, the slack space is smaller. On the other hand, if you store mostly small files on a volume formatted with a large sector size, expect to have a much larger slack space. 

If you are running Hyper-V, the sector size choice has a direct impact on the storage I/O performance. From Windows Server 2012, VHD format has been optimized to have a 4,096-byte alignment with the host storage subsystem, resulting in better performance. If you used VHD files created with operating systems prior to Windows Server 2012, these VHDs are not aligned and will not achieve the same performance as VHDs created with the newer Windows operating systems.

To convert a VHD into a new format, use this PowerShell command:

Convert-VHD –Path E:\vms\testvhd\test.vhd –DestinationPath E:\vms\testvhd\test-converted.vhd

To check whether the VHD is aligned, type the following PowerShell command:

Get-VHD –Path E:\vms\testvhd\test.vhd

Non-aligned VHDs will return the Alignment property as 0 (zero), while aligned VHDs will return the Alignment property as 1 (one).

VHD files use 512-byte logical sector sizes, while VHDX files use 4,096-byte logical sector sizes. Thus, choosing a default 4,096-byte disk sector size aligns perfectly with a VHDX logical sector size, avoiding any negative impact on the performance. Other major difference between the VHD and VHDX files is that the VHD maximum size is 2 TB, does not provide data protection, can't be resized live, and supports vendors other than Microsoft. On the other hand, VHDX files have a maximum size of 64 TB, provide data protection, can be resized live, handle snapshots better, and are only supported by Microsoft. 

主站蜘蛛池模板: 石阡县| 寻甸| 铜川市| 灵石县| 连山| 佛学| 巫山县| 哈尔滨市| 关岭| 浦江县| 巴楚县| 收藏| 郸城县| 河北区| 南木林县| 三明市| 腾冲县| 安平县| 梁河县| 依兰县| 鹤山市| 中阳县| 金寨县| 慈利县| SHOW| 涿州市| 福建省| 柳州市| 瓮安县| 新绛县| 峡江县| 株洲县| 衡山县| 定远县| 集贤县| 根河市| 大宁县| 沙河市| 张家口市| 安阳县| 昌乐县|