4 K alignment

Source: Internet
Author: User
Concept

4 K alignment is associated with a partition technology called "Advanced formatting. [1] First, let's take a look at what is "4 K alignment ". In fact, "4 K alignment" is associated with a partition technology called "Advanced formatting. "Advanced formatting" is the name used by the International Association of hard drive devices and materials for the new data structure format. This is mainly because with the development of the times and the constant expansion of hard disk capacity, the 512 bytes per sector defined previously is no longer so reasonable, so 512 bytes per sector is changed to 4096 bytes per sector, that is, the" 4 K slice". As NTFS becomes a standard hard disk file system, the default allocation unit size (cluster) of its file system is also 4096 bytes. To make the cluster correspond to the sector Physical hard disk partitioningUsed with computers Logical partition alignmentTo ensure hard disk read/write efficiency, so there is" 4 K alignment. Each sector of a traditional hard disk is fixed to 512 bytes. The new standard "4 K Sector" hard disk, hard disk manufacturers to ensure compatibility with the operating system, also simulate the sector into B sectors, then there will be 4 K sliceAnd 4 k clustersNon-Alignment occurs. So we need to use" 4 K alignment", The hard disk simulation sector to the" 4 K Sector ". 4 K alignment"Is to align the hard disk sectors An integer multiple of eight or eight simulated sectors,That is, 512b * 8 = 4096b, 4096 bytes is 4 K. When formatting Hard Disk Partitions using win7, the default is to align the hard disk sector to an integer multiple of 2048 sectors, that is, 512b * 2048 = 1048576b = 1024kb, that is, 1 m alignment, and 4 K alignment is satisfied, this value is 4 K aligned as long as it is a multiple of 4096b. In fact, the definition of 512 bytes per sector originated from the early stages of computer development. Therefore, splitting the hard disk capacity into 512 bytes per disk is a balance between file management and storage. As hard disk capacity has increased, the popularization of 1 TB or even higher-capacity hard disks. Using old standards to manage ultra-large-capacity hard disks is not only cumbersome, but also reduces efficiency. Therefore, it is imperative to increase the capacity of a single sector. After learning the definition of "4 K slice", it is easy to understand what is "4 K alignment. 4 K alignment is a hard disk formatted according to the definition of 4 K slice and data is written according to the rule of 4 K slice. If there is a "4 K alignment", there must be a "4 K
". Why is there a "4 K" mismatch? This is because in ntfs6.x's previous specification, the data write point is exactly between two 4 K
That is to say, even if the minimum data volume is written, two 4 K sectors are used. Obviously, this will have a great impact on the write speed and read speed. Therefore, when 4 K is not aligned, it must be changed to 4 K alignment. Otherwise, SSD will not only greatly speed down data writing and reading, it also causes unnecessary writes to the SSD.

If OK is displayed, 4 K is aligned. If bad is displayed, 4 K is not aligned.

Alignment Method

Finally, let's talk about how to achieve "4 K alignment ". If you use the built-in system tool to partition Windows 7, the formatted partition will be a "4 K alignment" partition by default, and you do not need to set any more. If you are still using the XP operating system, you need to rely on third-party tools to achieve "4 K alignment. For example, the "diskgenius" software can be used to manually select eight or more sectors to achieve "4 K alignment" after "an integer multiple of the following sectors ". Use diskgenius partitioning software to quickly partition and align [2] SSD partitions and Alignment Methods: re-enter the windowspe system, run diskgenius, delete the original SSD partition, and then click "create partition ". Select "primary disk partition", set the file system type to "NTFS", and click "detailed parameters ". You can see the starting cylinder. The head is 1 and the slice is 1. Change the head to 32 and the slice to 33. Note that the "Start fan ID" Below is changed to 2048. (This method is harmful. A partition error occurs when a hard disk with data is changed. If the PM correction is used, All the disks are bad .) On the left side, select "an integer multiple of the following sectors", change "number of sectors" to "2048", and click "OK ". In this way, the C disk will be split, and the remaining 30 GB space will be selected as the "extended disk partition" and the "file system type" will be NTFS. Do not change anything else, click "OK" directly. After the extended partition is created, the partition is complete. After all the partitions are complete, click "Save changes". Then, the process is completed. Other partition software, such as domestic partition assistants, can implement this function similarly. Achieve alignment

Of course, in terms of "4 K alignment", not all users need to struggle. After all, it is still necessary to change a hard disk with 4 K Non-Alignment into 4 K alignment. Therefore, it is recommended that the "4 K" alignment is not important if the hard disk is used as a warehouse disk rather than a system disk. In addition, although it is limited by the 4 K read performance, however, for writing, 4 K alignment also improves the performance. Although it is not as big as SSD, there are still some, so for general mechanical hard drive users, "4 K" alignment is equally important. If it is a solid state drive user, "4 K" must be aligned!

After a 4 K slice disk is partitioned, it must be formatted into a file system, such as NTFS, FAT32, and ext4. Windows File Systems store files in clusters, while NTFS clusters are 4 K by default. 4 K slice alignment means that the 4 K slice of the hard disk exactly corresponds to the 4 K cluster. 4 K cluster, allocation unit size: 4096 bytes.

Non-Alignment is caused by the fact that the system or partition software did not consider this situation. The starting position of the first partition is the 512 sector of the 64th-byte sector disk, this position is the last position of the eighth sector on a 4 K sector disk:

If the system stores data at location 4, you need to modify location 1 and Location 2, that is, to save a data, you need to double the original work. If data is stored at Location 5, and data is stored in the first half of the second, the data needs to be moved out first, so that 4 K can be stored at location 2, that is, this process involves three steps: "Read-Modify-write", which are time-consuming and time-consuming. In this process, reading continuous clusters is not affected, and data storage is not sequential.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.