w8-dualboot
update 2012-10-26

Win7環境にてインストールする領域を作成してWin8をインストールすると,自動的にデュアル環境で起動するようになる。

Win8は終了時に dirty bit(汚れたビット:不良ビット)を付けるので,他のOS起動時に chkdsk が動作することがある。
無用な chkdsk が動作すると,起動に時間がかかってしまうので避けたいものだ。(後述 dirty bit 参照)

※画面の見かけだけは新しいが,ユーザーにとっては使いにくい。
ユーザーはOSをすばやく切り替えたいのだが,切り替えると再起動から始まるというおそまつなものになっている。
タッチパネルを意識し過ぎたインターフェイスになっているが「スタートアップ設定」画面での「再起動」は,ただのボタンのままである。

※OS選択だけでなくオプション対応も行なえるようになっているが使いにくい。
コマンドプロンプトを使いたいだけなのに,再起動してパスワード入力を要求される。

※オプション対応は bcdedit や修復ディスクなど,他のツールで対応するほうが使いやすい。

1.OS選択メニュー
dual1.png

2.起動メニューでオプションが選択できる
dual2.png

3.起動メニューのタイムアウト時間の選択
dual3.png

4.デフォルト メニューの選択
dual4.png

5.オプションの選択
dual5.png

6.トラブルシューティング
dual6.png

7.詳細オプションの選択
dual7.png

8.再起動してスタートアップ設定を行なう
dual8.png



複数のOSやブートローダーを追加した起動メニュー
dual9.png



ブートOSの切り替え
SystemPropertiesAdvanced.exe (システム詳細設定タブ)を実行して「起動と回復」->「設定」にてデフォルトのOSを設定できる。
boot-sw.png



BCDEdit(ブート構成データ(BCD)の編集ツール)

Win7インストール環境の状況
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=C:   bootmgrはpartition=C: にある
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
default                 {current}
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

Win7環境にWin8をインストールしたデュアルboot の状況
※Win8起動時のbcdedit
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=D:   bootmgrはpartition=D: にある
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
default                 {current}
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
displayorder            {current}
                        {9cdc5fed-2a59-11e2-8b88-8ef75fb37455}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 8
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5ff2-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn
bootmenupolicy          Standard

Windows ブート ローダー
--------------------------------
identifier              {9cdc5fed-2a59-11e2-8b88-8ef75fb37455}
device                  partition=D:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=D:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

「起動と回復」にてWin7をデフォルトに設定した場合の状況
※Win7のエントリの identifier が {default}になっている。
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=D:
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
integrityservices       Enable
default                 {default}
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
displayorder            {current}
                        {default}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 8
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5ff2-2a59-11e2-8b88-8ef75fb37455}
integrityservices       Enable
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn
bootmenupolicy          Standard

Windows ブート ローダー
--------------------------------
identifier              {default}
device                  partition=D:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=D:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

「起動と回復」にてWin8に戻した状況
Win7のエントリの identifier が {default}ではなくなっている。
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=D:
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
displayorder            {current}
                        {9cdc5fed-2a59-11e2-8b88-8ef75fb37455}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 8
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5ff2-2a59-11e2-8b88-8ef75fb37455}
integrityservices       Enable
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn
bootmenupolicy          Standard

Windows ブート ローダー
--------------------------------
identifier              {9cdc5fed-2a59-11e2-8b88-8ef75fb37455}
device                  partition=D:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=D:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

「起動と回復」でWin8起動に切り替えた状況
※Win8のidentifierが{default}になっている。
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=C:
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
integrityservices       Enable
default                 {default}
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
displayorder            {default}
                        {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {default}
device                  partition=D:
path                    \Windows\system32\winload.exe
description             Windows 8
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5ff2-2a59-11e2-8b88-8ef75fb37455}
integrityservices       Enable
recoveryenabled         Yes
custom:17000077         352321653
osdevice                partition=D:
systemroot              \Windows
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn
custom:250000c2         1

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

Win7起動に戻して起動し直した状況
Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
device                  partition=C:
description             Windows Boot Manager
locale                  ja-JP
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
displayorder            {9cdc5ff1-2a59-11e2-8b88-8ef75fb37455}
                        {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {9cdc5ff1-2a59-11e2-8b88-8ef75fb37455}
device                  partition=D:
path                    \Windows\system32\winload.exe
description             Windows 8
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5ff2-2a59-11e2-8b88-8ef75fb37455}
integrityservices       Enable
recoveryenabled         Yes
custom:17000077         352321653
osdevice                partition=D:
systemroot              \Windows
resumeobject            {9cdc5ff0-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn
custom:250000c2         1

Windows ブート ローダー
--------------------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  ja-JP
inherit                 {bootloadersettings}
recoverysequence        {9cdc5fee-2a59-11e2-8b88-8ef75fb37455}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {9cdc5fec-2a59-11e2-8b88-8ef75fb37455}
nx                      OptIn

dirty bit

Win8は起動を速くするために,終了時に ディスクの中に dirty bit(汚れたビット:不良ビット)を付けるようになっている。
Win8起動の場合はこの dirty bitを判定して処理するので問題ないが,他のOSでは dirty bit として扱うために chkdsk が動作することになる。
これを回避するには「電源オプション」にて「電源ボタンの動作の選択」 -> 「現在利用可能ではない設定を変更します」をクリックして
「シャットダウン設定」の「高速スタートアップを有効にする(推奨)」をオフにして dirty bit が付かないようにする。

dirtybit.png

dirty bit のチェック

fsutil コマンドでdirty bit をチェックする。
各ドライブ(X:)についてdirtyかどうか調べる。
fsutil dirty query X:

dirtyを解消するには chkdsk X: /f を行なう。( X: はドライブ,/f パラメータ  はディスクのエラー修復を行なう。)
dirty bit を設定するには fsutil dirty set X:
end of list