Ted,
Suppose we have two machines, A and B, each dual-boot Linux/Windows. Suppose that Linux is the "default" OS on reboot -- i.e. if you switch the machine on and do nothing, Linux is what you get.
Let's start with both in Linux. Now, sitting at A, I want B to reboot into Windows, but without going to B.
One solution which has occurred to me is that, while at A, I can log in to B, su root, edit the LILO or GRUB config so that the boot order is reversed, and then tell B to reboot.
So far so good. I can even make this into a script, so that when logged into B I can issue something like "boot Windows".
But then, how to restore the original boot order without having to go to B, choose Linux from the boot menu, boot Linux, and re-edit the config file? I somehow doubt that you can do this while B is in Windows ... and I basically want the whole thing to be remote, from A.
If there were some capability in the boot loader itself that could restore a default boot configuration prior to actually booting the OS which is currently "on top", this would make the whole thing scriptable.
To be precise about this:
- A & B running Linux.
- At A, tell B to "boot Windows".
- B reboots.
- LILO/GRUB sees that Windows is "on top" and selects this as the OS to boot into.
- LILO/GRUB *also* restores the original config file with Linux "on top".
- LILO/GRUB then boots into Windows.
The effect would be that the next re-boot would be into Linux.
My instant reaction was to think that grub could do this, but I can't find anything to suggest it does, maybe someone else knows better. Anyway, it appears that lilo has an option which will do exactly what you want:
From man lilo:
-R command line This option sets the default command for the boot loader the next time it executes. The boot loader will then erase this line: this is a once-only command. It is typically used in reboot scripts, just before calling `shutdown -r'. Used without any arguments, it will cancel a lock-ed or fallback command line.
I assume that you could do: lilo -R windows (or whatever); shutdown -r now
and it would boot into windows. Then on next boot it'll go back to Linux, or whatever the default is.
Hope that helps
Dave