LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 08-28-2005, 09:09 AM   #1
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Rep: Reputation: 0
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?
 
Old 08-28-2005, 11:31 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 08-28-2005, 11:57 AM   #3
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Original Poster
Rep: Reputation: 0
That would work.

I'm using grub....how would I pass this argument to make a one time change?
 
Old 08-29-2005, 01:52 AM   #4
jspaar
Member
 
Registered: Feb 2004
Location: California
Posts: 99

Rep: Reputation: 15
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.
 
Old 08-29-2005, 07:04 AM   #5
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 08-29-2005, 12:00 PM   #6
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
Old 08-29-2005, 01:52 PM   #7
jspaar
Member
 
Registered: Feb 2004
Location: California
Posts: 99

Rep: Reputation: 15
Quote:
Originally posted by CornMaster
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.
Ok, here's the old thread: http://www.linuxquestions.org/questi...181#post755181
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:

I will give your prog a try, I do plan to use VNC a bit.

Thanks
Cool, let me know if you have any probs with it. ssh -X would work too, if you're remoting in from another linux box.

Quote:

I did some looking around and looked at the GRUB manual.
http://www.gnu.org/software/grub/ma...g-once_002donly

This seems to be exactly what I'm looking for.
Yeah that's exactly how bootnext works. You can see the guts of it in that link above.
 
Old 08-29-2005, 08:24 PM   #8
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Original Poster
Rep: Reputation: 0
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...
 
Old 08-29-2005, 09:40 PM   #9
jspaar
Member
 
Registered: Feb 2004
Location: California
Posts: 99

Rep: Reputation: 15
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:
I'm going to keep fiddling with it.....the manual on the gnu website doesn't seem to match the latest grub...
Yeah I remember scanning through the grub docs and thinking "no wonder I have to write this myself". Seemed like the --once hack is an optional patch that RedHat includes, but not all distros do. So it's not well documented.

Bootnext never messes with your permanent default. If it does, let me know...
 
Old 08-30-2005, 05:53 AM   #10
CornMaster
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
Old 09-14-2005, 04:20 PM   #11
joshfields
LQ Newbie
 
Registered: May 2004
Posts: 16

Rep: Reputation: 0
when you su to root, you MUST say su -

THE DASH IS IMPORTANT!!!
 
Old 10-01-2005, 04:58 PM   #12
dm215
LQ Newbie
 
Registered: Oct 2005
Location: Georgia
Distribution: SUSE 9.2
Posts: 10

Rep: Reputation: 0
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.
 
Old 10-02-2005, 04:06 PM   #13
jspaar
Member
 
Registered: Feb 2004
Location: California
Posts: 99

Rep: Reputation: 15
Quote:
Originally posted by dm215
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.
I haven't tried it on SUSE, but if doesn't work, I'd guess that maybe SUSE doesn't include the patch for "--once" in their GRUB code. I know that Fedora's grub source packages has a separate patch for -once which gets applied to the upstream tarball.

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.
 
Old 10-04-2005, 11:13 AM   #14
dm215
LQ Newbie
 
Registered: Oct 2005
Location: Georgia
Distribution: SUSE 9.2
Posts: 10

Rep: Reputation: 0
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grub question changing boot order making windows boot first nfsutim Linux - Newbie 29 10-27-2012 01:53 PM
changing the boot order coopns Linux - Newbie 11 09-14-2004 08:20 AM
Changing start order of tasks at boot..? stellarmarine1 Linux - Enterprise 4 08-25-2004 08:20 AM
changing boot order vasu Mandriva 4 08-25-2003 03:24 PM
changing redhat 7.3 boot order CyberSteve Linux - Software 1 04-20-2003 09:14 PM


All times are GMT -5. The time now is 05:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration