パーティションの変更で Boot Camp が起動できなくなったら、refit や GPT fdisk (gdisk) でパーティション情報を修正すればいい

Boot  Camp があるハードディスクのパーティションを変更する時、ディスクユーティリティに警告が出る。Boot Camp 使えなくなる可能性がある。実際にやると、起動時黒い画面に白い「No bootable device — Insert boot disk and press a any key」の文字が出て、起動できなくなる。
この場合、Boot Camp は4番目以内のパーティションにあるなら、refit の自動パーティションテーブル編集機能使えば、楽に修復できる。しかし、Boot Camp は5番目以上のパーティションにある場合、refit も修正できない。

理由としては Boot Camp 使う Hyper MBR は 4つのパーティションしか対応しないため、refit はそのように作られたかも知れない。写真のようにBoot Camp パーティションは5番目にあるが、MBR パーティションテーブルには4番目になっている。このため、正しく起動しない。しかし、Yesで新しく編集しても、4番目は現在のMac OS が入り、テーブルにBoot Camp パーティションがなくなるため、当然起動できない。
幸い、次の記事に紹介するGPT fdisk (gdisk) を使えば、紹介する手順で、簡単に修復できる。https://discussions.apple.com/thread/5962126。

具体的に:

Open up a terminal in OSX and assuming you have only one hard drive installed run

sudo gdisk /dev/disk0

type “r” (no quotes) and press enter

type “h” and press enter

You’ll get a warning that hybrid MBR’s are flaky and dangerous. That’s ok.

It will ask for 1 to 3 partition numbers (space separated) so I would suggest you enter

2 4 6 (one space between each) and press enter – that means you’re leaving out the recovery HD’s

It will ask if you want to include the EFI partition first in MBR

answer Y and press enter

you will get default entries for partition 2 – accept them by pressing enter BUT

the last question will ask if you want to make the partition bootable – answer N and press enter.

Do the same for partition 4

For partition 6 accept defaults (checking that type 07 is the default option for partition type) but when it asks you if you want to make partition 6 bootable – answer Y and press enter.

When finished type “w” and press enter – to write changes to the partition table.

Answer Y to continue.

When done type “q” to quit gdisk

Close terminal

Reboot holding Alt key and see if Windows appears in the boot menu – try to boot it.

ここで、パーティションの番号は 2  4  6 と入力したが、自分の場合、Boot Camp は 5 番目にあり、2 4 5 を入力し、ちゃんと修復でき、起動するようになった。
ちなみに、3番目は新しい macOS X をインストール時に勝手に作られたリカバリーパーティションだ。

実際にやってみると:

$ sudo gdisk /dev/disk0

Password:

GPT fdisk (gdisk) version 1.0.5

Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

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): 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: 2 4 5

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y

Creating entry for GPT partition #2 (MBR partition #2)

Enter an MBR hex code (default AF):  リターン

Set the bootable flag? (Y/N): Y

Creating entry for GPT partition #4 (MBR partition #3)

Enter an MBR hex code (default AF): リターン

Set the bootable flag? (Y/N): Y

Creating entry for GPT partition #5 (MBR partition #4)

Enter an MBR hex code (default 07): リターン

Set the bootable flag? (Y/N): Y

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/disk0.

Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Warning: The kernel may continue to use old or deleted partitions.

You should reboot or remove the drive.

The operation has completed successfully.

gptfdisk のダウンロード先:

http://sourceforge.net/projects/gptfdisk/

Read More

Apple Watch Series 2 の液晶画面を交換して見ました。

Apple Watch Series 2 の画面が割れて、タッチも不動になった。動作不良だが、画面が正常の個体から液晶を移行し、正常に動作するようになった。画面割れた液晶は表面を交換すれば、まだ使えるので、それは次の仕事。

DSC_0225

Read More