How to Disable Grub OS Prober
Guide Overview
The purpose of this guide is to teach you how to how to disable Grub OS Prober.
This tutorial is aimed at Advanced Users. Use at your own risk.
Whenever I upgrade or replace a hard drive, I plug the old drive into my desktop tower.
That makes it available to me, in case I forgot or failed to transfer something to the new drive. Eventually I will remove it, or re-purpose it, but that is normally a low priority. The drive could just sit there until the next time I need that port!
I also use my desktop for a lot testing and I am constantly changing it.
So, I only want Grub to find my Linux OS on Drive 0, and not list all the other odds and ends that it finds there.
CAUTION: This should not be done on Dual Boot Systems, as Grub will then load the first OS on the first Drive, and ignore all the others. Hence, NO ACCESS to the other systems!
Tools Needed
- A working system, with multiple hard drives installed.
Instructions
Step One
Add the following line to your /etc/default/grub file, then run update-grub.
GRUB_DISABLE_OS_PROBER=true
After running update-grub, only your primary operating system will appear in your Grub menu.
*This entry is used to prevent GRUB from adding the results of os-prober to the menu.
A value of "true" disables the os-prober check of other partitions for operating systems, including Windows, Linux, OSX and Hurd, during execution of the update-grub command.
Using this option rather than removing the executable bit from the /etc/grub.d/30_os-prober file has several advantages:
-
The setting can be easily changed while making other changes to the grub file.
-
While both methods prevent os-prober from running and placing items in the menu display, using this setting allows the 30_os-prober script, but not the os-prober command, to run.
This script enables the GRUB_HIDDEN_TIMEOUT setting and/or the ability to display a hidden menu by pressing the ESC key (depending on other settings). This functionality is lost if the 30_os-prober script is disabled by making it unexecutable.
*Source: Ubuntu Community Help Wiki
Cheers!
Naught