为什么GPT分区覆盖了引导分区,并使MBR无法编辑

分享于 

5分钟阅读

ubuntu

  繁體

问题

问题和上下文:

在发行版的MBR分区表(例如ubuntu-16.04-desktop-amd64.iso)中,为什么GPT分区似乎与主引导分区重叠?如果我以尝试编辑分区表,都会产生错误。

我的机器是MBR,而不是GPT。

我犯了什么错?

以下是distro分区表(直接从ISO文件)的MBR:


cat ubuntu-16.04-desktop-amd64.iso | xxd | head -32 | tail -5



给出:


00001b0: 28db 2b00 0000 0000 708e 0e0e 0000 8000 (.+.....p.......


00001c0: 0100 0058 e0fa 0000 0000 6048 2c00 00fe ...X......`H,...


00001d0: ffff effe ffff 4411 2c00 8012 0000 0000 ......D.,.......


00001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................


00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.



表从地址01be开始,其中可以看到"80",用于#1主引导分区。

然后注意"ef"位于地址01d2 ,表示#2主分区为type =GPT 。

以下是按分区(小端面)划分的表:


partition#1 (normal MBR):


 80 = 'boot' partition flag


 00 01 00 = starting HSC (head, sector, cylindar)


 00 = partition type ("Empty partition entry")


 58 e0 fa = last HSC (head, sector, cylindar)



 0000 0000 = LBA (logical block address) of first absolute sector in the 


 6048 2c00 = number of sectors in partition



partition #2 (GPT):


 00 = non-boot partition


 fe ff ff = starting HSC (head, sector, cylindar)


 ef = partition type ("EFI system partition")


 fe ff ff = last HSC



 4411 2c00 = LBA (logical block adr) of first abs sector in part.


 8012 0000 = number of sectors in partition



fdisk报告这些分区重叠。


sudo fdisk -l /dev/sdb



给出:


 Disk /dev/sdb: 14.5 GiB, 15527313408 bytes, 30326784 sectors


 Units: sectors of 1 * 512 = 512 bytes


 Sector size (logical/physical): 512 bytes / 512 bytes


 I/O size (minimum/optimal): 512 bytes / 512 bytes


 Disklabel type: dos


 Disk identifier: 0x40a863e7



 Device Boot Start End Sectors Size Id Type


 /dev/sdb1 * 0 2955679 2955680 1.4G 0 Empty


 /dev/sdb2 2927216 2931951 4736 2.3M ef EFI (FAT-12/16/32)




dd if=/dev/zero of=/dev/sdb bs=[something like 512 or 2048; doesn't matter] count=[some large number like 100000^]




Libparted Warning The driver descriptor says the physical block size


is 2048 bytes, but Linux says it is 512 bytes.




gparted -l /dev/sdb: libparted : 2.3 Could not stat device -l -- No


such file or directory. /dev/sdb contains GPT signatures, indicating


that it has a GPT table. However, it does not have a valid fake msdos


partition table, as it should. Perhaps it was corrupted -- possibly


by a program that doesn't understand GPT partition tables. Or perhaps


you deleted the GPT table, and are now using an msdos partition table.


Is this a GPT partition table? Both the primary and backup GPT tables


are corrupt. Try making a fresh table, and using Parted's rescue


feature to recover partitions.



如何编辑发行版的MBR?


答案1

Ubuntu .iso镜像文件使用Frankenstein 's Monster格式,该格式旨在支持多种启动方法和设备:

启动媒体 将镜像写入DVD以使用ISO-9660和El Torito进行引导 将镜像"原始"复制到USB闪存驱动器或类似介质,以使用常规磁盘分区系统进行引导 启动模式 BIOS模式启动 EFI模式启动

为了使用多种格式和启动方法,开发人员玩起了数据结构游戏。这些镜像实际上不应被视为"普通"磁盘镜像,除非您是这种数据结构的高级专家,否则,您应极力避免以任何方式修改镜像。


PAR  BOO  引导  MAKE  Ubuntu  ISO  
相关文章