UEFI(GPT)でUSBメモリにWindowsとUbuntu18.04をインストールしデュアルブートで使う。

デュアルブートUSBの作成

WindowsUbuntuの順番でインストール

  1. Hasleo WinToUSBをインストールする

    www.easyuefi.com

  2. Hasleo WinToUSBを起動し、インストールする
  3. ディスクの管理にて、パーティションの縮小をする
    Ubuntuの分を縮小しておく。
  4. Gpartedをつかって、3の手順で縮小して空いた領域にパーティションを作成する
    ファイルシステムは[lvm2 pv]とする
  5. ターミナルを起動する
  6. 物理ボリュームを作成
    sudo pvcreate /dev/sda3
  7. ボリュームグループを作成
    sudo vgcreate ubuntu-vg /dev/sda3
  8. 論理ボリュームと論理swapを作成
    sudo lvcreate -L 2G -n lvswap ubuntu-vg
    sudo lvcreate -l 100%FREE -n lvroot ubuntu-vg

  9. ファイルシステムを作成
    sudo mkfs.ext4 /dev/mapper/ubuntu--vg-lvroot
    sudo mkswap -f /dev/mapper/ubuntu--vg-lvswap
  10. Ubuntuインストーラーを起動
    ブートローダーのインストールは/dev/sda2とする

 

次回起動OSを設定し再起動

モニターまで行って、起動OSを選択するのは手間なのでリモートで出来るようにする。
UEFIのNextBootを利用する。

これがやりたくて、USBをGPTにしてインストールした。

UbuntuWindowsは出来るし、Ubuntu,Windows⇒ESXiは出来るけど、ESXi⇒Ubuntu,Windowsは無理そう。

 

  • Ubuntu
    1. 確認
      efibootmgr
      ==========
      BootCurrent: 0000
      Timeout: 2 seconds
      BootCurrent: 0000
      Timeout: 2 seconds
      BootOrder: 0000,0001
      Boot0000* ubuntu
      Boot0001* Windows Boot Manager
      ==========
    2. 次回起動デバイスを設定し再起動
      sudo efibootmgr -n [BootOrder番号]
      sudo reboot
  • Windows
    1. 確認
      bcdedit /enum firmware
      ==========
      Windows ブート マネージャー
      --------------------------------
      identifier {bootmgr}
      device partition=\Device\HarddiskVolume3
      path \EFI\Microsoft\Boot\bootmgfw.efi

      ファームウェア アプリケーション (101fffff
      --------------------------------
      identifier {55d04790-601b-11e8-b625-806e6f6e6963}
      device partition=\Device\HarddiskVolume3
      path \EFI\ubuntu\shimx64.efi
      description ubuntu
      ==========
    2. 次回起動デバイスを設定し再起動
      bcdedit /set {fwbootmgr} bootsequence [identifier]
      shutdown -r -t 0
      ※優先起動をUbuntuにしており、再度Windowsを起動したい場合には、[identifier]に{bootmgr}を指定して再起動