如何让传统 BIOS 加载 uefi 引导加载程序?

如何让传统 BIOS 加载 uefi 引导加载程序?

我有一个 liveusb,它目前在 uefi 电脑上运行。我遇到越来越多的电脑只支持 uefi,并且配置为仅从 gpt 启动,并且 BIOS 密码锁定。但与此同时,我有时仍会遇到只能从 mbr 启动的旧版 BIOS 电脑。

因为我有一个 16mb 的驱动器,所以这听起来是理想的解决方案,有一个通用的旧式加载器,它可以从其他 usb 加载 uefi 加载器。

答案1

我建议您遵循此处的混合 MBR 详细手册 -https://www.rodsbooks.com/gdisk/hybrid.html

但作为一个例子,你可以看看(我在这里没有提到任何细节。)

sudo gdisk /dev/sdd
[sudo] password for root: 
GPT fdisk (gdisk) version 1.0.4

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): r

Recovery/transformation command (? for help): p
Disk /dev/sdd: 15130624 sectors, 7.2 GiB
Model: Storage Media   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 4A7748B4-58A5-4521-B555-CAC28D452779
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 15130590
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   0700  
   2          411648         4605951   2.0 GiB     AF00  
   3         4605952         7489535   1.4 GiB     8300  
   4         7489536        10332159   1.4 GiB     0700  
   5        10332160        12089343   858.0 MiB   8300  
   6        12089344        15128575   1.4 GiB     8300  

Recovery/transformation command (? for help): h

WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.

Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 1 3 4
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): n

我选择否,因为我已经有带引导加载程序的 EFI GPT 分区。如果你没有该分区,那么你必须选择是,如下所示 -

Creating entry for partition #1
Enter an MBR hex code (default AF): af
Set the bootable flag? (Y/N): n

来自混合型MBR

GPT fdisk 可以在 MBR 表中的混合分区之前或之后创建 EFI GPT (0xEE) 占位符分区。(请注意,这与此分区保护的磁盘扇区无关。)每种放置方式都有其优点。将 0xEE 分区放在表中的第一个位置最适合 GRUB Legacy 和 GRUB 2,如果 MBR 中的第一个插槽不是 0xEE 分区,它们会将磁盘视为 MBR 磁盘。但是,如果磁盘是可移动磁盘(例如 USB 闪存驱动器),则将 0xEE 放在第一个位置可能会导致 Windows 无法读取后续分区。总体而言,如果磁盘是硬盘,我建议将 0xEE 分区放在第一位;如果它是可移动磁盘,则将其放在表中的后面可能会更好。

Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 07): 
Set the bootable flag? (Y/N): y

Creating entry for GPT partition #3 (MBR partition #2)
Enter an MBR hex code (default 83): 
Set the bootable flag? (Y/N): n

Creating entry for GPT partition #4 (MBR partition #3)
Enter an MBR hex code (default 07): 
Set the bootable flag? (Y/N): n

Recovery/transformation command (? for help): o

Disk size is 15130624 sectors (7.2 GiB)
MBR disk identifier: 0x00000000
MBR partitions:

Number  Boot  Start Sector   End Sector   Status      Code
   1      *           2048       411647   primary     0x07
   2               4605952      7489535   primary     0x83
   3               7489536     10332159   primary     0x07
   4                     1         2047   primary     0xEE

Recovery/transformation command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdd.
The operation has completed successfully.

相关内容