LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Set grub options from within windows (http://www.linuxquestions.org/questions/linux-software-2/set-grub-options-from-within-windows-432599/)

trawler 04-07-2006 03:00 AM

Set grub options from within windows
 
I have a dual boot machine with Ubuntu linux (which i mainly use) on one partition and windows XP on the other.
I have some servers running on my ubuntu, so i like to keep it running 99% of the time, and so i pretty much neglected using Windows, unless I really have to.

Recently I realized I might be needing to use Windows more than usual, especially while at work (for testing Windows software purposes, mostly).

The only problem is - my Grub's default OS is ubuntu - so if i boot the machine remotely, it will automatically boot up linux.

If i connect to my ubuntu, i can edit the menu.1st file and switch the default to Windows, so it'll boot up windows - but I can't edit it while on Windows to boot my ubuntu back up... :cry:

I've used LTools before, but it seemed such a messy way for editing linux files over Windows, and also a bit risky...

Isn't there any other program which will allow Windows to interface with the grub menu? :confused:

pljvaldez 04-07-2006 12:02 PM

I think that there is a way to set it to boot windows only one time. Then when it reboots, grub will make linux the default again.

Found it! http://www.gnu.org/software/grub/man...-once_002donly

trawler 04-07-2006 05:02 PM

The "default saved" option doesn't seem to be working for some reason...
At first, i realized i didn't even have the grub-set-default command, so i installed grub from source (and boy, what a mess that was...).

At least now i got grub working the just like before, but it seems like the "default" file under /boot/grub isn't having any affect - it still loads ubuntu as a default.

my menu.1st file looks like this:
Code:

default saved

timeout 5
#hiddenmenu
color cyan/blue white/blue

title                Ubuntu, kernel 2.6.12-10-686-smp
root                (hd0,6)
kernel                /vmlinuz-2.6.12-10-686-smp root=/dev/hda8 ro quiet splash
initrd                /initrd.img-2.6.12-10-686-smp
savedefault
boot

title                Ubuntu, kernel 2.6.12-10-686-smp (recovery mode)
root                (hd0,6)
kernel                /vmlinuz-2.6.12-10-686-smp root=/dev/hda8 ro single
initrd                /initrd.img-2.6.12-10-686-smp
boot

# This is a divider, added to separate the menu items below from the Debian
# ones.
# title                Other operating systems:
# root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title                Microsoft Windows XP Professional
root                (hd0,0)
savedefault 0
makeactive
chainloader        +1


I even tried setting savedefault 2 under the first entry, to get grub to boot windows on second boot, and it still loaded ubuntu up when i rebooted next.

It's a shame, cause it seemed like a cool solution :(

Any idea why it's not working for me?

pljvaldez 04-07-2006 05:47 PM

No idea... (I'm not really a grub expert, it seems more useful than lilo but I haven't taken the plunge to install it).

Did you ever get the grub-set-default command to work?

trawler 04-08-2006 03:16 AM

Yes. grub-set-default did actually create the "default" file - but grub seemed to ignore it - or at least that's what i thought untill i actually tried to boot my windows back a few mins ago...

For some reason, it won't boot up :(.
I guess it has something to do with the re-installation of grub - something must have gotten screwed up. :((

saikee 04-08-2006 04:16 AM

Here is something that should be bomb proof.

Put Grub into a Primary partition. Say if your Ubuntu is in hda3 (only hda1 to hda4 are primaries and one of them can be converted to the extended partition). You can do it while in Ubuntu issuing a root terminal command
Code:

grub-install /dev/hda3
Thereafter Grub can be activated by booting into hda3 using Windows MBR.

If your Ubuntu has been installed in logical partition you can still installed Grub in a data-only primary partition. Just follow Section C of my 2nd link in the signature.

You can then restore Windows MBR overwriting the current Grub so that the PC is booted to Windows on a reboot.

Any time you want to switch back to Ubuntu you can click start/my computer/storage/manage/disk management and ask Windows to make the Grub partition hda3 active (it will not be called hda3 but you should be able to identify it with a label). On a reboot the Windows MBR will boot up Grub.

After you have enough of Ubuntu and want Windows back then just use Grub to make Windows partition active, assuming it is in hda1 and so known to Grub as (hd0,0) because it counts from 0, by the command
Code:

root (hd0,0)
makeactive

You can switch between the two remotely.

------------------------------------

After explaining this bomb proof method, which I have used myself, I could not understand why can't you would just add couple of "0" to the timeout command to give me loads of time to click between Ubuntu and Windows, like
Code:

timeout 500
Anyway I beieve the above two methods should satify your need.


All times are GMT -5. The time now is 02:22 AM.