Changing boot order
Is there a way I can change the boot order in both linux and windows XP.
Basically I like to remote to my machine, and I'd like to have the option to be in one OS, and then reboot into the other. (obviously I have a dual boot) I could write a script to change the config file in Linux, but could I do this for windows too? |
Well you only have one boot loader. If your using the bootloader for Linux like grub or lilo, it would have to be changed there. Of course, if you have Linux as the default, you can pass arguments to have it boot into a different label upon next bootup but if you load up Windows, you can't change this but keeping Linux as the default, if you reboot Windows, it should boot back into Linux the next go round.
|
That would work. :)
I'm using grub....how would I pass this argument to make a one time change? |
In Fedora you can could also use my bootnext script to choose the next boot (one-time-only). bootnext
[Sorry for the geocities crap, it's the only free hosting I have.] If you make linux your default boot in grub, you can always use bootnext when you want to switch to XP. The only catch with bootnext is that it's graphical, so if you're connecting remotely from a host without X, bootnext won't be able to display. There is a similar command-line script out there, search OLD threads in this forum by me to find its name. |
That would be really sweet if it worked from console. ;)
Humm...I searched, but couldn't find anything. Maybe I'm searching wrong. I'll take another look later. I will give your prog a try, I do plan to use VNC a bit. Thanks |
I did some looking around and looked at the GRUB manual.
http://www.gnu.org/software/grub/man...-once_002donly This seems to be exactly what I'm looking for. I guess I could write a script that would change the entry in the grub config file and use it just before I reboot. Or I could have two versions of the grub config...the original and the boot once one. Then copy in the boot once one whan I need to start up windows. I'll do a little expermenting tonight, and let you know how it goes. |
Quote:
That thread has a few versions of my script, and the earliest one is non-graphical. The choice is hard-coded in the variable WINDOWS_TITLE., but you could tweak that to use a command line argument instead. Also somebody mentions later a script called "rebootin", which I think you can still find via google. I haven't tried it. Quote:
Quote:
|
Hummm...I made the changes to the file like the manual said....however I could not run the grub-set-default command cause it's not there.
Instead I opened grub and used the savedefault command (that I noticed in your code). The first time I tried it, it booted straight to XP, but the next reboot it make XP the default instead of Linux...which is not what I intended...and since then, I can't make it boot to XP at all (It always goes to the menu) I'm going to keep fiddling with it.....the manual on the gnu website doesn't seem to match the latest grub... |
Sounds like you maybe left off the "--once" when you were playing with savedefault. That would cause the default to be changed permanently. "savedefault --once" is the key to the whole one-time-only boot thing.
You probably know the easy way to reset the permanent default: edit /boot/grub/grub.conf and change the default=# line to match the menu choice you want. Entries start from 0. Or just use system-config-boot, which is even easier. Quote:
Bootnext never messes with your permanent default. If it does, let me know... |
I stopped trying to reinvent the wheel and used your first script. Works perfectly. :)
I do have another problem though...which I'll post elsewhere.....but I'll give the gist here. When I su to root....I can't use any of the commands in sbin. I have to type the whole path. so /sbin/grub instead of just grub. But if I login as root...it all works fine. |
when you su to root, you MUST say su -
THE DASH IS IMPORTANT!!! |
Is there any reason why this code (bootnext, the early, non-graphical version) wouldn't work in SUSE? I have the same remote reboot issue on a dual-boot machine.
|
Quote:
If that is the only issue, then it should be feasible to download Fedora's grub source package and build it for SUSE, but that's something I haven't tried either and it would take some mucking about. If you find out that SUSE does have the -once patch, then it should be pretty simple to get bootnext working on SUSE. But that's my first bet for any trouble. |
one time reboot script for suse 9.x
In the interest of helping out when I can, here's a shell script for SUSE users that a friend found elsewhere:
#!/bin/sh /usr/sbin/grub --device-map=/boot/grub/device.map --batch <<FOO savedefault --default=1 --once quit FOO /sbin/reboot This has the same effect as boonext in SUSE - will reset the grub config file (which in suse is device.map) to windows for one reboot. Note: script assumes that Windows is option 1 in grub (this is the default if you installed suse on a machine already running Windows). |
All times are GMT -5. The time now is 11:12 AM. |