Hard Disk Drive | My Note

Hard Disk Drive

Updated: Sep 21st, 2023


#组成

no title picture

Pasted image 20220705171720

图源

关键组成:磁盘+主轴+磁头+磁头臂

#存储介质

  1. 刚性磁盘
  2. 存储原理:使用极性方向来存储0/1
  3. 读写方法
    1. 读:磁头经过盘片上方,盘片本身的磁场能导致读取线圈中的电信号发生改变(磁头在移动过程中切割磁感线产生电流)
    2. 写:磁头经过盘片上方,通过电流来产生电磁场,改变盘片上单个存储单元的磁极性方向

#数据在盘片上的组织与操作

##在盘片上的组织

Pasted image 20220705171845

图源

  1. 磁道(track)
  2. 扇区(sector)
  3. 柱面(cylinder)

##磁盘容量

  1. Recording density (bits/in): number of bits that can be squeezed into a 1 inch segment of a track.
  2. Track density (tracks/in): number of tracks that can be squeezed into a 1 inch radial segment.
  3. Areal density (bits/in2): product of recording and track density.

##磁头的操作

磁盘旋转,磁头移动

Pasted image 20220705172228

图源

Pasted image 20220705172241

图源

##一个读操作的延迟 breakdown

Pasted image 20220705172416

图源

Taccess=Tavg seek+Tavg rotation+Tavg transfer

#磁盘访问时间的计算

Tavg seek 一般是 3~9 ms

Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min

Tavg transfer = 1/RPM x 1/(avg # sectors/track) x 60 secs/1 min

一个例子:

Given:

Rotational rate = 7,200 RPM Average seek time = 9 ms Avg # sectors/track = 400 (假设一个磁道有400个扇区)

Derived:

Tavg rotation = 1/2 x (60 secs/7200 RPM) x 1000 ms/sec = 4 ms 就是算转半圈的延迟

Tavg transfer = 60/7200 x 1/400 x 1000 ms/sec = 0.02 ms

Taccess  = 9 ms + 4 ms + 0.02 ms

  1. Access time dominated by seek time and rotational latency.
  2. First bit in a sector is the most expensive, the rest are free.

#磁盘 I/O

通过 Interrupt

Pasted image 20220705173707

Pasted image 20220705173756

Pasted image 20220705173805

#相关技术:

##坏块管理

每个扇区前都会有一个头标,头标中含有一些字段,其中包括对扇区是否能可靠存储数据的标记,还会有一个指示字,可在该扇区错误时指引磁头转到替换扇区或磁道,另外头标末尾还会有循环冗余校验CRC值,可以检查扇区头标的读出情况。

##提高容量密度

目前的磁盘已经难以通过增加磁盘大小与增加磁盘数量来提高容量。磁盘大小已经到达极限,再增大,既会增加体积,还会大幅降低磁盘稳定性,另外对于磁盘数量,目前9碟已经是极限了。

对于磁盘记录技术的发展,目前的主要趋势如下图所示,目前比较常见的有Perpendicular magnetic recordingShingled Magnetic Recording两种。

no title picture

#参考资料

  1. 《大话存储终极版》第三章
  2. wiki
  3. 百度百科
  4. link
  5. link

Instead of authenticating the giscus application, you can also comment directly on GitHub.


Notes mentioning this note