Hard Disk Basics

Disk Basics

introduce

A disk is a direct-access storage device. It has a large capacity and is fast. It occupies a pivotal position in the computer system. A magnetic disk is generally composed of several platters, and each platter has many circles called tracks, and information is recorded on the tracks. There are two sides on each slice. The platter is mounted on a spindle and rotates at high speed around the spindle. When the track passes under the read-write head, the information can be read and written. As shown below.

figure 1
write picture description here

Common terms

track

The track is a ring with the center axis as the center. Different disks have different numbers of tracks, and there are gaps between the tracks. The track is the medium on which the disk stores data. There is a layer of magnetic medium on the track, and the polarity of the magnetic medium can be converted into an electrical signal through the magnetic head.

sector

Each track is composed of multiple arc sectors. As shown in the figure below, a sector is the smallest unit of disk storage and the basic read-write unit of a disk. The general sector size is 512Byte.

cylinder

A cylinder consists of tracks of equal radius on different surfaces of a disk.

write picture description here
write picture description here

Disk read and write process

Labeling a specific information on a disk requires three parameters: cylinder number, disk number, and sector number.
In order to access a piece of information, one must first find the cylinder, move the arm to move the head to the desired cylinder (called positioning or seek); then wait for the information to be accessed to go under the head; and finally read/write the desired information . So the time required to read and write a piece of information on the disk consists of 3 parts:
T = seek time + waiting time + transmission time
Seeking time: the time for positioning the read/write head
Waiting time: waiting for the sector to rotate under the read/write head
transfer it takes to read and write a sector

Since the rotation speed of the disk is relatively fast, the waiting time is average, and the transmission rate of the disk is generally 2, the read and write time of the disk is mainly spent on the search time, so the related data stored on the disk should be placed on the same cylinder or adjacent to the cylinder as much as possible. , to reduce the number of random accesses.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324736913&siteId=291194637