update-grubのマルチブート探索を止める
ブートディスクを修正していると、マルチブートにされちゃって困るとがある。
一時的にUSB-HDDから起動してNVMEブートをマウントして修正中に、USB-HDDがブート可能OSとして認識されてしまう。これを止める方法があった。
/etc/default/grub
GRUB_DISABLE_OS_PROBER=true GRUB_DISABLE_OS_PROBER=false
探索は os_probe が担っているので、それをdisabled(=false)にしてやる。
更新
sudo update-grub
GRUB_DISABLE_OS_PROBER がTRUEなら他OSを探索にいかない。そのため再構成も速い。メニューにゴミも出来ない。とても重要。
警告が邪魔だと感じるとき
Warning: os-prober will be executed と出てくる場合
Generating grub configuration file ... Found linux image: /boot/vmlinuz-6.1.0-32-amd64 Found initrd image: /boot/initrd.img-6.1.0-32-amd64 Found linux image: /boot/vmlinuz-6.1.0-28-amd64 Found initrd image: /boot/initrd.img-6.1.0-28-amd64 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. Adding boot menu entry for UEFI Firmware Settings ... done
この場合は、もはや打つ手はなく、os-prober パッケージを持ってるだけで出てくる。つまり、os-prober を消すしか無い。
apt purge os-prober