Disk Physical Structure and IO Process

Source: Internet
Author: User

Disk Physical Structure and IO Process

Disk management can be divided into disk surface, Head, track, cylinder, and fan area.

Disk Surface: A disk is composed of a stack of disks, as shown in the lower left figure.

Head (Heads): Each head corresponds to a disk and is responsible for reading and writing data on the disk.

Track: each disc is divided into multiple concentric circles around the center. Each circle is called a Track.

Cylinders: A Cylinders is a three-dimensional system composed of tracks at the same position on all disks.

Sector (Sector): the disk management unit is still too large, so the computer predecessors have divided each track into multiple sectors, see

On Linux, you can run the fdisk command to view the physical information of the disks used by the current system.
[Root @ dbserver ~] # Fdisk-l

Disk/dev/sda: 1199.6 GB, 1199638052864 bytes
255 heads, 63 sectors/track, 145847 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x54ab02ca

Device Boot Start End Blocks Id System
/Dev/sda1 1 5 40131 de Dell Utility
Partition 1 does not end on cylinder boundary.
/Dev/sda2*6 267 2097152 c W95 FAT32 (LBA)
......

 
We can see that my disk has 255 heads, that is, a total of 255 disks. There are 145847 cylinders, that is to say, each disk has 145847 channels, and 63 sectors/track describes a total of 63 sectors on each track. The command result also shows that the Sector size value is 512 bytes. Calculate the disk size.
255 disc x 145847 cylindrical x 63 sectors * 512 bytes per sector = 1199632412160 bytes = 1117.25 GB
The result is 1117.25 GB, which is consistent with the total disk size.
If an error (marked in red) can be found, that is, the start position of/dev/sda1 is deleted from the first sector. If 1st to 62 sectors are deleted, that is, the first Magnetic Track (cylinders) is separately reserved for the disk MBR and partitioned from 64th sectors, that is, the second Magnetic Track (cylinders), which will greatly improve the performance of the file system.

Next let's take a look at the disk IO process.
The first step is to move the head radial to find the track where the data is located. This part of time is called the seek time.
Step 2: Find the target track and rotate it on the disk to move the target sector to the bottom of the head.
Step 3: read or write data to the target slice. So far, one disk IO has been completed.
Therefore, I/O time of a single disk = seek time + rotation delay + Access time.

For the rotation delay, the current mainstream servers often use 1 W to/minute disks, the time required for each week of rotation is 60*1000/10000 = 6 ms, therefore, the rotation delay is (0-6 ms ). The access time generally takes a short time, which is a few milliseconds. For the track time, the modern disk is about 3-15 ms. The track time is mainly affected by the relative distance between the current position of the head and the target track.
The operating system divides partitions by the cylinder corresponding to the track to reduce the time spent on disk IO and improve the disk read/write performance.

This article permanently updates the link address:

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.