目录

磁盘组织与管理

磁盘的结构

磁盘、磁道、扇区的概念

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151351.png

磁道可以有成千上万个

如何在磁盘中读写数据

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151457.png

盘面、柱面的概念

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151647.png

磁盘的物理地址

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151814.png

磁盘的分类

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151851.png

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151913.png

小结

https://gitee.com/lienhui68/picStore/raw/master/null/20200714151940.png

磁盘调度算法

一次磁盘读/写操作需要的时间

https://gitee.com/lienhui68/picStore/raw/master/null/20200714155746.png

现在的硬盘移动一个磁道大约需要0.2ms,磁盘启动时间约为2ms

延迟时间:1/r就是转一圈需要的时间,找到目标扇区平均需要转半圈,因此再乘以1/2

硬盘的典型转速为5400转/分钟,或7200转/分钟

传输时间:每个磁道要可存N字节的数据,因此b字节的数据需要b/N个磁道才能存储。而读/写一个磁道所需的时间刚好又是转一圈所需要的时间1/r。

磁盘调度算法

先来先服务(FCFS)

https://gitee.com/lienhui68/picStore/raw/master/null/20200714155813.png

最短寻找时间优先(SSTF)

https://gitee.com/lienhui68/picStore/raw/master/null/20200714155830.png

扫描算法(SCAN)

https://gitee.com/lienhui68/picStore/raw/master/null/20200714155856.png

LOOK调度算法

https://gitee.com/lienhui68/picStore/raw/master/null/20200714155930.png

循环扫描算法(C-SCAN)

https://gitee.com/lienhui68/picStore/raw/master/null/image-20200714155959832.png

C-LOOK调度算法

https://gitee.com/lienhui68/picStore/raw/master/null/20200714160031.png

小结

https://gitee.com/lienhui68/picStore/raw/master/null/20200714160130.png

减少延迟时间的方法

https://gitee.com/lienhui68/picStore/raw/master/null/20200714161715.png

交替编号

https://gitee.com/lienhui68/picStore/raw/master/null/image-20200714161911055.png

磁盘地址结构的设计

https://gitee.com/lienhui68/picStore/raw/master/null/20200714161944.png

https://gitee.com/lienhui68/picStore/raw/master/null/20200714162043.png

错位命名

https://gitee.com/lienhui68/picStore/raw/master/null/20200714162119.png

https://gitee.com/lienhui68/picStore/raw/master/null/20200714162347.png

小结

https://gitee.com/lienhui68/picStore/raw/master/null/20200714162411.png

磁盘管理

磁盘初始化

https://gitee.com/lienhui68/picStore/raw/master/null/20200714163704.png

引导块

https://gitee.com/lienhui68/picStore/raw/master/null/20200714163758.png

坏块的管理

https://gitee.com/lienhui68/picStore/raw/master/null/20200714163908.png

小结

https://gitee.com/lienhui68/picStore/raw/master/null/20200714163947.png