• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Send remote commands to GRUB on boot?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

pik4chu

Senior Yellow Forum Rat
Joined
Jan 17, 2003
Location
Centennial, Colorado
Someone mentioned this when I mentioned I had a problem with machines that multibooted linux and some windows OS'es. Thje problem is that I need to remotely reboot the computers and need it to come back up in Windows 2K (the default windows OS) except that GRUB is the main boot loader, with two options. Linux RH 7.1 as default and "Windows" which then passes control to the windows bootloader to give choices on which OS to boot. Anyways, the guy said there was a way to send remote commands to GRUB so I could change the OS it boots to........so um, how can I do this? :) Thanks!
 
Hmm, I don't see how that would work with a network card. Taking a quick Google, it looks like you can compile Grub to be accessible through the serial port. So one possibility would be to connect another PC to it through the serial port. Then you remote access this 2nd PC, and use the serial port connection to access Grub on the 1st PC. Here's a link I found Googling for "Grub serial port":

http://www.rajeevnet.com/linux/grub_serial_console.html

The only other solution I can think of is to use the Win2k bootloader. Then you have to modify the boot.ini to set the appropriate default depending on what you want to boot next (maybe write scripts that just copies the one you want, or renames existing ones). From Linux, you'll have to mount the Windows partition to do this, so you may have to use FAT32 unless you are ok with risking dataloss by modifying NTFS from Linux.

Anyways, hope this gives some ideas. I'd be interested to know if you have any success (especially that serial port thing).
 
I'd just modify grub's config file to change default OS to use before rebooting. The only problem is that you wouldn't be able to get into Linux if you didn't have access to it while it was booting.
The bootloader by definition is too simple to do anything as complex as getting data from a network, so your best option is probably to use the serial port or change the config file.
 
Back