How to enable or disable other operating systems (like windows) from grub2
Sometimes you may have to remove the windows option from your grub menu. It was very easy in grub, the legacy one. But its quite complicated to do in new grub2.
If you are using Ubuntu, you have to face this problem in Ubuntu 9.10 and newer versions.
I was in the same situation few hours ago. I tried to edit the /etc/gurb.d/ entries. Then tried to edit /boot/grub/grub.cfg files. I knew which lines to comment and uncomment.
But I was looking for an automated way. After some searching I came up this solution. All you have to do is to toogle the executable bit of /etc/grub.d/30_os-prober file.
This file is responsible for probing other os’s existence in the system. And it must be executable. So if you make it non-executable, update-grub command wont be able to execute it and wont probe any other os.
here is the code for disable other operating systems. Carefully see the “-x” option for chmod.
cd /etc/grub.d/ sudo chmod -x 30_os-prober sudo update-grub
To enable just make it executable. Use “+x” option for chmod
cd /etc/grub.d/ sudo chmod +x 30_os-prober sudo update-grubTagged bash, grub, Linux, ubuntu, Unix
