【FSFA 读书笔记】Ch 2 Computer Foundatinons(2)

Hard Disk Technology

1. 机械硬盘内部构造
几个重要概念:Sector(扇区),Head(读写头),Track(磁道),Cylinder(柱面)。
如果一个文件比较大,磁盘的写入顺序如下,因此有了后面的CHS地址表示:
  写满一个扇区->磁盘旋转,写同磁道的下一个扇区->写满一个磁道
        ->电路切换,写下一盘面(下一个读写头)->写满一个柱面
        ->动臂径向移动,写下一个柱面->写完整个文件
这是根据旋转等待(latency)时间<<寻道(seek)时间设计的,动臂的移动时间比转轴旋转要慢。
(话说这个最初居然是在数据结构综合设计课上了解的,讲外排的时候)
磁盘构造图:
 
2. 机械硬盘的接口
  用于PC的现常见SATA(Serial Advanced Technology Attachment),即串行ATA,它是一种接口规范。以ATA为规范的盘可以成为IDE disk.
  与之相对的是常用于服务器的SCSI(Small Computer Systems Interface)接口规范。
下图为SATA的接口,两组针是独立的~
 
3. 扇区地址的表示
CHS被LBA取代,但引导记录为了向下兼容仍然记录CHS的值,有时遇到只提供CHS的文件系统或数据结构,需要手工用以下公式转换
  LBA = (((CYLINDER * heads_per_cylinder) + HEAD) * sectors_per_track) + SECTOR - 1
(To overcome the 8.1GB limit associated with translation, the CHS addresses were abandoned, and Logical Block Addresses (LBA) became standard. LBA uses a single number, starting at 0, to address each sector and has been supported since the first formal ATA specification.)
原文地址:https://www.cnblogs.com/helenawang/p/5003855.html