当前位置:网站首页>Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
2022-06-26 14:09:00 【lengye7】
background
Whether it's MBR Partition or GPT Partition , There is always a free space in front of the first partition ( except MBR Outside space ), This space does not belong to any zone .
The meaning of this space
The partitioning tool corresponding to the early operating system is used for partitioning , Its first partition is always 63 Sector number starts with , This means that there is always a before the first partition 63 Sectors , except MBR A sector , All other sectors are free sectors .
This odd number is an artifact of cylinder-head-sector (CHS) addressing used in INT 13h, the legacy BIOS API used for disk access. On legacy systems and bootloaders that used the INT 13h API, all partitions must begin and end on cylinder boundaries. Even after logical block addressing (LBA) was introduced, fake CHS values (which did not correspond to the actual disk geometry) were used to maintain compatibility with the legacy API. Since CHS addressing originally supported a maximum of 63 sectors per cylinder, the first partition would begin on sector 63. Windows XP (before Service Pack 3) and earlier versions of Windows will not boot if the system volume isn't on a cylinder boundary.
As can be seen from the above quotation , At the beginning BIOS in ,INT13h Disk access interrupt service for ( Early disk access was through this service ) The disk partition must be allocated according to , So in the early days, the partition of the disk must be allocated according to the cylinder , That is, the partition is aligned with the cylinder . For older disks , A disk on a cylinder corresponds to a track , There happens to be... On one track 63 Sectors , If it is distributed according to the cylinder , Because the first sector is MBR, So all sectors on that track cannot be allocated to the first partition , The first partition must be allocated from the second track , This results in a free sector in front of the first partition , These sectors do not belong to any partition .
Later, disk was introduced LBA Addressing , The physical geometric model of the disk has been compared with CHS It doesn't match , But to ensure compatibility , The first partition should still be preserved 63 Sectors ,LBA0 by MBR A sector , The first partition is from LBA63 Start . This is the history of BIOS Impact on disk partitions .
however , As the disk capacity grows , Some disk manufacturers begin to provide physical sectors as 4KiB Size disk , In order to improve the performance of disk access , Partition must be in accordance with 4KiB Size of the physical sector alignment for access , Otherwise, the access performance will be reduced .
Why not follow 4KiB Aligning physical sectors of different sizes for partitioning will result in performance access loss ?
For the physical sector is 4KiB The hard disk of , It still provides external logical sector access (LBA The visit is still based on 512Bytes Size addressing ), The logical sector size is 512bytes. The so-called logical sector access , In fact, it is a 4KiB The size of the physical sector is divided into 8 Share ,8*512Bytes=4096Bytes.
When you need to access one of the logical sectors and write data , You need to read a physical sector first , Then, the data of other logical sectors in the physical sector is integrated with the data of the logical sector written now , Then write the physical sector , This results in a logical sector data write that needs to be read before writing , Therefore, each write involves an additional process of reading and modifying data , This reduces write performance , This is known as RMW(Read-Modify-Write) Performance loss .
Modern operating systems and some underlying disk access software , They have already supported it 4KiB Disk access for , When the physical sector size of the encountered disk is 4KiB When , Each time the data access to the disk will be in accordance with 4KiB To read and write .
Suppose that the partition is not divided according to 4KiB alignment , The first partition is from LBA63 Start , Is the first 8 The last of the physical sectors 1/8 Part is divided into the first partition , When the operating system accesses the first partition , It will be accessed from the first logical sector of the partition , according to 4KiB Read and write data to the disk , This will inevitably lead to RMW Performance loss , So in order to ensure the normal access performance to this kind of disk , The disk partition must be in accordance with 4KiB Size .
that , If you still use the original partition method , The first partition is from LBA63 Start , because 63 No 8 Multiple , So that the partition is not in accordance with 4KiB Align , So it will cause RMW Performance loss problem . Modern operating systems recommend that the first partition be from LBA2048 Start , The front is just reserved 1MiB Of free space ,2048 Is precisely 8 Multiple , So partition 4KiB It's aligned .
Modern operating systems are installed by default , Its first partition is just from LBA2048 Start , Whether it's MBR Partition or GPT Zoning , Is so . for example ,windows and linux, They are installed by default , The first partition is from LBA2048 At the beginning , And if you use its default partitioning tool , The first partition is also from by default LBA2048 At the beginning , Of course, when users use the partitioning tool to partition , You can specify the starting position of the first partition , Of course, it must be ensured that 4KiB alignment .
Personally feel , Just default .
thus , The reason why this space exists has been completely clarified .
- BIOS The impact causes the first partition to start from LBA63 Start .
- 4KiB The alignment effect results in the first partition from LBA2048 Start .
about linux Come on , Its use grub To guide ,grub Will make full use of this free space , It will write a part of its bootstrap program into this space (MBR The partition is like this ,GPT This is not the case under the partition .GPT This part of the contents will be written to another place under the partition .), This is really economical .
Comparison of disk partition methods (MBR And GPT)_lengye7 The blog of -CSDN Blog
边栏推荐
- GC is not used in D
- Gurivat sprint Harbour Exchange listed: created “multiple first”, received 900 million yuan Investment from IDG capital
- VTK 圆柱体的生成与渲染
- 泰山OFFICE技术讲座:使用字体粗体的四种情形
- First k large XOR value problem
- 【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
- Wechat applet SetData dynamic variable value sorting
- Calculate the distance between two points (2D, 3D)
- Niuke challenge 48 e speed instant forwarding (tree over tree)
- 团队管理的最关键因素
猜你喜欢

Select tag - uses the default text as a placeholder prompt but is not considered a valid value

Never use redis expired monitoring to implement scheduled tasks!

Installation and uninstallation of MySQL software for windows

Global variable vs local variable

33. Use rgbd camera for target detection and depth information output

2021-10-09

Hands on data analysis unit 3 model building and evaluation

Teacher Li Hang's new book "machine learning methods" is on the market! Purchase link attached

HW蓝队溯源流程详细整理

Wechat applet magic bug - choose to replace the token instead of clearing the token, wx Getstoragesync will take the old token value instead of the new token value
随机推荐
FreeFileSync 文件夹比较与同步软件
character constants
基于PyTorch的生成对抗网络实战(7)——利用Pytorch搭建SGAN(Semi-Supervised GAN)生成手写数字并分类
CF676C Vasya and String
团队管理的最关键因素
Bug memory management
去某东面试遇到并发编程问题:如何安全地中断一个正在运行的线程
免费的机器学习数据集网站(6300+数据集)
HW蓝队溯源流程详细整理
Traverse the specified directory to obtain the file name with the specified suffix (such as txt and INI) under the current directory
Is expression of D
ThreadLocal giant pit! Memory leaks are just Pediatrics
Go language - pipeline channel
虫子 内存管理 上
DataGrip配置的连接迁移
Wechat applet magic bug - choose to replace the token instead of clearing the token, wx Getstoragesync will take the old token value instead of the new token value
Use of wangeditor rich text editor
hands-on-data-analysis 第三单元 模型搭建和评估
PHP非对称加密算法(RSA)加密机制设计
Network remote access using raspberry pie