Hard disk drive (HDD) and solid state drive (SSD)

Table of contents

The smallest unit of mechanical hard disk (HDD) is a sector

hard disk structure

How hard drives work

Data Organization on Hard Disk

hard disk index

Factors Affecting Performance

Solid state drive (SSD) The smallest storage unit is Cell

Features of SSD

SSD architecture

NAND Flash

flash media

Address Mapping Management

FTL Flash Translation Layer


The smallest unit of mechanical hard disk (HDD ) is a sector

hard disk structure

How hard drives work

  • Initially, the read / write heads are parked on a special area of ​​the platter near the spindle, the start-stop zone.
  • The spindle connects all the platters and connects to a single motor. The spindle motor spins at a constant speed, turning the platter.
  • When the spindle rotates, there is a very small air gap between the read / write head and the disk, which is called the flying height of the head.
  • The read / write head is installed on the top of the head arm, and the head arm drives the head to move above the position of the disk where data needs to be written or retrieved.
  • The magnetic head reads and writes data in binary form on the surface of the hard disk, and the read data is stored in the flash chip of the hard disk, and finally transmitted to the program to run.

Notice

The disk stores data, the control circuit controls the high-speed rotation of the disk, and the head arm controls the head to read/write (each disk has two read-write heads, located on two surfaces respectively)

The unit of disk speed is RPM, and now enterprises generally use 10K~15K (at this time, the hard disk is generally running in a vacuum)

The platter has a surface (two sides), tracks on the surface, and sectors on the tracks.

Data writing is written according to the vertical direction of the cylinder (the first vertical, then the second vertical)

Why Vertical Literacy

When reading and writing, it is necessary to determine which track to read and write data (seek time) + which sector to determine after determining the track (rotation delay) + data read and write transmission time

It takes less time physically (seek time + rotation delay) to read and write vertically

Data Organization on Hard Disk

Disk surface: Each disk of the hard disk has two disk surfaces, and each disk surface can store data and become an effective disk.

  • Each valid disk has a disk number, numbered from 0 in descending order.
  • In the hard disk system, the disk number is also called the head number, because each effective disk has a corresponding read and write head.

Track ( Track ): A track is a concentric ring around the main shaft on the platter, and data is recorded on the track.

  • Tracks are numbered sequentially starting from 0 from the outermost circle to the inner circle .
  • Each surface of a hard disk has 300~1024 tracks, and the new large-capacity hard disk has more tracks on each side. Usually, the number of tracks per inch ( TPI , also called track density) on the disk is used to measure the tightness of the track arrangement on the disk. .
  • Tracks are invisible to the naked eye, just some magnetized areas on the disk surface that are magnetized in a special way.

Cylinder : In the same hard disk, all platters (including the upper and lower disks) have the same numbered tracks to form a cylinder, which is called the cylinder of the hard disk .

  • The heads on each cylinder are numbered from top to bottom starting from 0 , and the data is read and written according to the cylinder.
  • That is, when the magnetic head reads and writes data, it first operates from head 0 in the same cylinder, and then operates on different disk surfaces (ie, magnetic heads) on the same cylinder in turn.
  • Only after all the heads on the same cylinder have finished reading and writing, the head is transferred to write a cylinder, because the selection of the head only needs to be switched electronically, and the selection of the cylinder side must be switched mechanically, that is, seeking.
  • Usually the position of the magnetic head in the hard disk is described by cylinder number, not by track number.

Sector : Each track is divided into smaller units called sectors. The purpose of dividing sectors is to make data storage more organized .

  • A sector is the smallest storage unit in a hard disk that can be individually addressed. The number of sectors of different hard disk tracks can be different.
  • Normally, a sector can hold 512 bytes of user data, but some hard drives can be formatted with larger sector sizes, such as 4KB sectors.

hard disk index

Hard drive capacity

Hard disk capacity = number of cylinders * number of heads * number of sectors * sector size , the unit is MB or GB

The factors that affect the hard disk capacity are the capacity of a single disk and the number of disks.

hard disk cache

In order to solve the CPU waiting problem when the hard disk reads and writes data , an appropriate high-speed cache is set on the hard disk.

average access time

Average seek time: refers to the time required for the head of the hard disk to move from the initial position to the specified track on the disk surface (the smaller the better)

Average waiting time: refers to the time when the magnetic head is already in the track to be accessed, waiting for the sector to be accessed to rotate below the magnetic head (the smaller the better)

data transfer rate

Internal transfer rate: the highest rate when the magnetic head reads and writes the hard disk under physical conditions

External transfer rate/interface transfer rate: It refers to the data transfer rate between the system bus and the hard disk buffer, which is related to the type of hard disk interface and the size of the hard disk cache.

 Hard disk IOPS and transmission bandwidth 

IOPS: Input and output per second (number of reads and writes); theoretically, the maximum IOPS of the hard disk can be calculated, that is, IOPS=1000ms/(seek time + rotation delay)

Transmission bandwidth (throughput): the amount of data successfully transmitted per unit time

parallel transfer and serial transfer

Parallel: The transmission efficiency is high, but the transmission distance is not long, and the transmission frequency is not high; (generally about 10 meters)

Serial: The transmission rate is not high, but the overall transmission speed can be increased by the transmission frequency (random generally has a higher transmission rate than parallel)

Factors Affecting Performance


The smallest storage unit of solid state drive ( SSD ) is Cell

Features of SSD

  • Using flash technology to store information, the data transmission speed is faster than HDD
  • There is no mechanical structure inside, so the power consumption is less, the heat dissipation is small, and the noise is low
  • The service life of the SSD is affected by the number of erasing and writing (the smallest unit of the hard disk, C ell , is constantly erasing and writing. When the number of erasing and writing reaches the limit, it cannot continue to read and write data )

SSD architecture

SSD is mainly composed of storage unit (mainly flash memory particles) and control unit

Control unit: SSD controller, host interface, DRAM, etc.

  • SSD controller: responsible for read and write access and protocol conversion from the host to the back-end media, table entry management, data caching and verification, etc., and is the core component of the SSD .
  • Host interface: The protocol and physical interface for the host to access the SSD , such as SATA , SAS and PCIe .
  • DRAM : FTL ( Flash translation layer , flash translation layer) entry and data cache to provide data access performance.

Storage unit: NAND FLASH particles

  • NAND FLASH : A physical device for data storage, which is a non-volatile random access storage medium.
  • Multi-channel concurrent, flash particle multiplexing timing within the channel. Support TCQ/NCQ , respond to multiple IO requests at one time.

NAND Flash

NAND flash memory particles use floating gate transistors to store data

Internal storage units include: LUN , Plane , Block , Page , Cell

  • LUN:   The smallest physical unit that can be encapsulated independently, usually including multiple planes       
  • Plane: has independent Page registers, usually containing 1K or 2K odd or even Blocks        
  • Block:  The smallest unit capable of performing an erase operation, usually consisting of multiple Pages      
  • Page:  The smallest unit that can perform programming and reading operations, usually 16KB in size
  • Cell:    The minimum operation erase and read unit in Page , corresponding to a floating gate transistor, can store 1 bit or more bits  

The operation of reading and writing data on NAND Flash mainly involves erasing (Erase), programming (Program) and reading (Read)

Nand flsh is a non-volatile medium. Before writing new data, the Block must be erased. Erasing the Block once and then writing it again is called a P/E Cycle
  

flash media

NAND Flash particles are divided into different flash media according to the different bit data stored in the Cell (mainly four types)

Address Mapping Management

The host accesses the SSD through LBA, and the SSD master converts it into PBA through FTL flash conversion for data reading

  • LBA : Logical Block Address , logical block address

                It may refer to the address of a certain data block or the data block pointed to by a certain address.

  • PBA : Physics Block Address , physical block address

FTL Flash Translation Layer

basic concept

FTL acts as a translator. It converts the logical address sent by Host (computer, mobile phone, etc.) to Device (eMMC, SSD) into the physical address written into Flash (address mapping management).

working principle

Given a logical address by the Host, FTL establishes a mapping relationship on the logical mapping table according to this logical address, and connects to the physical address on the Flash.

Generally speaking, after FTL processes the logical address, the established mapping relationship includes the Block number, Page number, etc. of the Flash. When data is read, it finds the data at the corresponding position of the Flash according to these information and transmits it to the Host.

Guess you like

Origin blog.csdn.net/m0_49864110/article/details/130450019
Recommended