トラブル解決 その3 1/2

  • HybridMBR の再作成でWindowsを起動できるようにさせる

最初はProtectiveMBRの状態でWindows7をブートできるようにするべくWin7(x64)をEFIブートしようとトライしたけれども、うまくいかなかったため、HybridMBRを再作成します。
下に書いた領域と順番で、GPTで配置されたパーティションの内4つをMBRへ取り入れます。

GPT 1 EFIパーティション ・・・MBR 1
GPT 2 MacOS領域 ・・・MBR 2
GPT 3 Mac Recovery
GPT 4 Windows NTFS Dドライブ ・・・MBR 3
GPT 5 Windows NTFS Cドライブ ・・・MBR 4

操作前のfdiskによるMBR情報。ProtectiveMBRにより1つのGPTパーティションと認識されています。

sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 91201/255/63 [1465149168 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]

                                                                                                                                              • -

1: EE 0 0 2 - 1023 255 63 [ 1 - 1465149167]
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

gdisk実行

sudo gdisk /dev/disk0

Command (? for help): r (リカバリ、変換モードへ)
Recovery/transformation command (? for help): h (Hybrid MBR作成モード)
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: 2 4 5 (GPTパーティションの内、MBR2〜4に入れるパーティションNoをスペース区切りで入力)
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y (GPT先頭のEFIパーティションMBR 1パーティション目に入れる)
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF): (デフォルト状態で問題なので、ENTER)
Set the bootable flag? (Y/N): n (bootフラグはつけません。)

Creating entry for GPT partition #4 (MBR partition #3)
Enter an MBR hex code (default 07): (デフォルト状態で問題なので、ENTER)
Set the bootable flag? (Y/N): n (bootフラグはつけません。)

Creating entry for GPT partition #5 (MBR partition #4)
Enter an MBR hex code (default 07): (デフォルト状態で問題なので、ENTER)
Set the bootable flag? (Y/N): y (Win7 OS区画 ブートフラグをつける。)

Recovery/transformation command (? for help): o (パーティション情報表示)

Disk size is 1465149168 sectors (698.6 GiB)
MBR disk identifier: 0x00000000
MBR partitions:

Number Boot Start Sector End Sector Status Code
1 1 409639 primary 0xEE
2 409640 137128383 primary 0xAF
3 138397920 1324186319 primary 0x07
4 * 1327851520 1465147391 primary 0x07

Recovery/transformation command (? for help): w (希望通りに作成できたので、HDDを更新)

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).
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.

操作後のfdisk。見事にHybridMBRが希望通りにできました。

sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 91201/255/63 [1465149168 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]

                                                                                                                                              • -

1: EE 0 0 2 - 25 127 14 [ 1 - 409639]
2: AF 25 127 15 - 1023 254 63 [ 409640 - 136718744] HFS+
3: 07 1023 254 63 - 1023 254 63 [ 138397920 - 1185788400] HPFS/QNX/AUX
*4: 07 1023 254 63 - 1023 254 63 [1327851520 - 137295872] HPFS/QNX/AUX


HybridMBRへは入れていませんが、リカバリHDからの起動はブートメニューに表示されてちゃんとできます。
Windowsブート回復については次のエントリで トラブル解決 その3 2/2 - My Memo & News Bookmark