この記事を作った動機
単に今までめんどくさくて放置していた、Windows と Linux の デュアルブート環境において、GRUB を利用しているとき、Windows OS の選択肢が出てこないということについて、対応した時にわかったことを記録したいというだけ。
ちなみに今回の作業をするまでは単に BIOS 側で、.efi ファイルを指定することで、Linuxを起動するエントリと、Windowsを起動するエントリを作って、BIOSのブートメニューで選択していた。
なお今回の記事では前提として、GRUB が入っており、以下に示すコマンドはすでに使えることを想定している。
- grub-install
- grub-mkconfig
環境
System Details Report(GNOME settings からのコピペ)
Report details
- Date generated: 2025-08-04 14:45:58
Hardware Information:
- Hardware Model: Dell Inc. XPS 15 9575
- Memory: 16.0 GiB
- Processor: Intel® Core™ i7-8705G × 8
- Graphics: Intel® HD Graphics 630 (KBL GT2)
- Disk Capacity: (null)
Software Information:
- Firmware Version: 1.20.0
- OS Name: Arch Linux
- OS Build: rolling
- OS Type: 64-bit
- GNOME Version: 48
- Windowing System: Wayland
- Kernel Version: Linux 6.15.7-arch1-1
パティーション構成
どんなパーティション構成で、デュアルブートを構成しているかも示す。Windows も Linux もどちら側も UEFI で動作しており、それぞれ個別に起動用の EFI パーティションを持っているという構成である。
この構成には理由が三つほど存在する。
一つ目は、単に後から、Linux をインストールしており、パーティションのサイズを変えたり、位置を移動したりするのは面倒であるということがある。
二つ目は、Windows がデフォルトで生成した EFI パーティションを使うと、サイズがたったの 100MB しかないため、カーネルやらなにやらがそこに配置されると、すぐにディスクの空き容量が足りなくなってしまうことがある。
三つ目は、Windows がデフォルトで生成した EFI パーティションを使うと、Linux 側と Windows 側でファイルがごちゃごちゃになり、いざというときの整備性が低く感じられたことがある。
sudo fdisk -l
# ディスク /dev/nvme0n1: 1.86 TiB, 2048408248320 バイト, 4000797360 セクタ
# ディスク型式: SOLIDIGM SSDPFKNU020TZ
# 単位: セクタ (1 * 512 = 512 バイト)
# セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
# I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
# ディスクラベルのタイプ: gpt
# ディスク識別子: 一応秘匿
# デバイス 開始位置 終了位置 セクタ サイズ タイプ
# /dev/nvme0n1p1 2048 206847 204800 100M EFI システム
# /dev/nvme0n1p2 206848 239615 32768 16M Microsoft 予約領域
# /dev/nvme0n1p3 239616 1997969407 1997729792 952.6G Microsoft 基本データ
# /dev/nvme0n1p4 1997969408 2000402431 2433024 1.2G Windows リカバリ環境
# /dev/nvme0n1p5 2000402432 2002499583 2097152 1G EFI システム
# /dev/nvme0n1p6 2002499584 3952850943 1950351360 930G Linux ファイルシステム
# /dev/nvme0n1p7 3952850944 4000796671 47945728 22.9G Linux ファイルシステム
Windows 環境
# /dev/nvme0n1p1 2048 206847 204800 100M EFI システム
# /dev/nvme0n1p2 206848 239615 32768 16M Microsoft 予約領域
# /dev/nvme0n1p3 239616 1997969407 1997729792 952.6G Microsoft 基本データ
# /dev/nvme0n1p4 1997969408 2000402431 2433024 1.2G Windows リカバリ環境
Linux 環境
# /dev/nvme0n1p5 2000402432 2002499583 2097152 1G EFI システム
# /dev/nvme0n1p6 2002499584 3952850943 1950351360 930G Linux ファイルシステム
# /dev/nvme0n1p7 3952850944 4000796671 47945728 22.9G Linux ファイルシステム
インストールするパッケージ
- fuse3
- ntfs-3g
- os-prober
yay -S fuse3 ntfs-3g os-prober
# sudo pacman -S fuse3 ntfs-3g os-prober
ちなみに、これらが入ってないと、そもそも別の OS を検出しようとしない。
/etc/default/grub の変更
# os-prober を有効化する
GRUB_DISABLE_OS_PROBER=false
os-prober が正しく有効になっているときの例
grub-mkconfig
において正しく OS を検出できている例を一応おいておく。
sudo grub-mkconfig -o /boot/grub/grub.cfg
# Generating grub configuration file ...
# テーマを見つけました: /usr/share/grub/themes/tela/theme.txt
# Linux イメージを見つけました: /boot/vmlinuz-linux
# Found initrd image: /boot/initramfs-linux.img
# Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
# Warning: os-prober will be executed to detect other bootable partitions.
# Its output will be used to detect bootable binaries on them and create new boot entries.
# Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
# Adding boot menu entry for UEFI Firmware Settings ...
# 完了
以下の部分があることから、正しく検出されていることがわかる。何らかの理由で os-prober が機能していない場合、このような出力は出ない。
# Warning: os-prober will be executed to detect other bootable partitions.
# Its output will be used to detect bootable binaries on them and create new boot entries.
# Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
# Adding boot menu entry for UEFI Firmware Settings ...
参考にしたサイトとか
- GRUB - ArchWiki
https://wiki.archlinux.org/title/GRUB#Detecting_other_operating_systems (2025年8月4日) - Grub/os-prober not detecting Windows : r/archlinux
https://www.reddit.com/r/archlinux/comments/ud7dao/grubosprober_not_detecting_windows/ (2025年8月4日) - [Solved] GRUB and os-prober do not see Windows 10 on a different drive / Newbie Corner / Arch Linux Forums
https://bbs.archlinux.org/viewtopic.php?id=240117 (2025年8月4日)