Dynamically Change boot order on Dual boot systems

Latest response

Before I begin, please understand I am new to Linux having been forced into administering the RHEL 6.9 desktops in our organization.
We have approximately 600 dual boot (Windows 10/RHEL 6.9) systems in our environment, and we need to be able to systematically boot to Linux on a schedule so we can patch the machines -- Windows 10 is the default boot partition. We used to use Ext2FSD to mount the Linux partition in Windows 7 and send a new grub.conf file through SCCM, but Ext2FSD does not work in Windows 10 consistently (or at all, mostly).
I wonder if it would be possible to add an "if" type statement to the grub.conf file. For example, would it be possible to set a statement where, if the time and day is Wednesday between 1 a.m. and 4 a.m., then the default is Linux?
I found this option for Ubuntu, but could not seem to find equivilents for CentOS/RHEL: https://askubuntu.com/questions/317352/can-grub-be-scheduled-this-means-changing-default-entry-auto-login-at-defi
I would also be interested in any other suggestions anyone might have. Thanks in advance.

Responses

Are your systems using traditional BIOS or UEFI?

For UEFI, it might be possible to set up an alternate boot variable pointing to an alternate grubx64.efi + grub.cfg which would then boot Linux only. UEFI includes a BootNext boot variable which can be used to override the standard boot order for the next boot only, and it is accessible from Windows too:

https://windows7boot.blogspot.fi/2014/05/exploring-windows-uefi-part-1.html

https://www.boyans.net/bootnext/bootnext.html

If you're using traditional MBR, the main problem could be that RHEL 6.x still uses GRUB Legacy with MBR, not GRUB2. The Ubuntu solution relies on GRUB2 (which is a completely rewritten successor of GRUB Legacy).

You might consider switching your bootloaders around so that Windows bootloader starts GRUB when needed, and not vice versa. Like this: https://pw999.wordpress.com/2013/12/21/windows-7-linux-dualboot-using-bcd-instead-of-grub/

Then, you could use the BootNext utility in the second link above to apply one-time overrides to the Windows bootloader settings to trigger it to automatically boot Linux instead of the default Windows.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.