维修电脑的时候,特别是GHOST系统之后,许多维修员都喜欢到PE里的“磁盘分区软件”重写下“主引导”(MBR), 我也有这个习惯,但我和许多同行一样,对主引导只停留在字面意思的理解。拿起一块新硬盘,也就认识古老的 CHS (Cylinder/Head/Sector)三个参数. 主引导记录到底是什么? 1、很久以前, 硬盘的容量还非常小的时候, 人们采用与软盘类似的结构生产硬盘. 2、也就是硬盘盘片的每一条磁道都具有相同的扇区数. 由此产生了所谓的3D参数 (Disk Geometry). 既磁头数(Heads), 柱面数(Cylinders), 扇区(Sectors),以及相应的寻址方式. a、磁头数(Heads) 表示硬盘总共有几个磁头,也就是有几面盘片, 最大为 255 (用 8 个二进制位存储); 找一个良硬盘,拆开,你可以数下——不会很多,许多都只有两片。 b、柱面数(Cylinders) 表示硬盘每一面盘片上有几条磁道, 最大为 1023(用 10 个二进制位存储); c、扇区数(Sectors) 表示每一条磁道上有几个扇区, 最大为 63 (用 6个二进制位存储).每个扇区一般是 512个字节. 在 CHS 寻址方式中, 磁头, 柱面, 扇区的取值范围分别为 0 到 Heads - 1,0 到 Cylinders - 1, 1 到 Sectors (注意是从 1 开始).假如用32bit表示sector个数,那么分区的最大值为2TB。 二、Boot Sector(启动扇区——我翻译的,不知对否,请指正) 的组成 Boot Sector 也就是硬盘的第一个扇区, 它由: 1、MBR (Master Boot Record) 2、DPT (Disk Partition Table) 3、Boot Record ID 这三人部分组成. MBR 又称作主引导记录,占用 Boot Sector 的前 446 个字节 ( 0 to 0x1BD ),存放系统主引导程序 (它负责从活动分区中装载并运行系统引导程序). DPT 即主分区表占用 64 个字节 (0x1BE to 0x1FD), 记录了磁盘的基本分区信息. 主分区表分为四个分区项, 每项 16 字节, 分别记录了每个主分区的信息(因此最多可以有四个主分区). Boot Record ID 即引导区标记占用两个字节 (0x1FE and 0x1FF), 对于合法引导区, 它等于 0xAA55, 这是判别引导区是否合法的标志. Boot Sector 的具体结构如下图所示
英语解释 开始,“重口W”不喜的跳过-------------------------- MBR包括: A partition table describing the partitions of a storage device. In this context the boot sector may also be called a partition sector.
Bootstrap code: instructions to identify the configured bootable partition then load and execute its volume boot record
Unique 32-bit disk signature, even though it may never be used by the operating system. 英语解释 结束,“重口W”不喜的跳过--------------------------
Structure of a master boot record | | | | | | | | | | | | | | | disk signature (optional) | | | | | | | | | | Table of primary partitions
(Four 16-byte entries, IBM partition table scheme) | | | | | | | | | | | | MBR, total size: 446 + 64 + 2 = | |
|