LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-30-2006, 06:18 AM   #1
zimon
Member
 
Registered: Sep 2004
Posts: 38

Rep: Reputation: 16
Howto tell GRUB what OS to boot next?


When I am already booted to Linux and have console/xterm access from the keyboard, how to I tell grub the next operating system I want to boot is Windows XP, which is the last in the grub.conf file?

I do not want to change grub.conf to have "default=N", where the N is the order of the Windows XP section in the grub.conf

Also the order N may change, as Fedora yum automatic update may add more recent kernel versions on the top of the grub.conf file.

I cannot see the grub menu when the machine is booting up, because the strange way the laptop is situated 10m away and the external TDMS-panel comes active only when X (or Windows XP) is started.

So is there some method to say on the command prompt something like:
$ grub-next-operating-system-booted-should-be "windowsXP"

I know there is a "savedefault" option in grub commands, but it does not help here unless I can somehow change the saved default for the next boot manually without touching the grub.conf

Then after Windows XP session is quit, and the machine reboots, it should again boot the default Linux entry which is the first one in the grub.conf

Can this be done with Grub at all?
 
Old 12-30-2006, 06:45 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Can this be done with Grub at all?
No.
Quote:
I cannot see the grub menu when the machine is booting up, because the strange way the laptop is situated 10m away and the external TDMS-panel comes active only when X (or Windows XP) is started.
How do you boot the laptop from 10m away? How do you use it from 10m away?

When you first boot the laptop, you are probably close to it. You can get grub to redirect output to an external screen with Fn+F8 (varies with BIOS). But you have to do this before any OS boots.

When the system is cold-booted again, this setting is changed. However, it may be preserved when you just do a soft reboot so the grub menu will show on an external monitor. (Or there may be a BIOS option to make the external monitor the default.)

But this is all "assuming" quite a bit. I hope you can see why the specifics of this unusual setup are important?
 
Old 12-30-2006, 08:45 AM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,728

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
This article provides some information about how to boot once into another OS, then the next time in the original one again.

The article applies to a new Linux kernel and not Windows, but essentially it is not different. You have booted into Linux when you want to change the next boot option so that is fine.

BTW, if this doesn't work for you, you don't have any other choice but changing grub.conf or menu.lst. That is how the boot process is being controlled, and if you want to change it, you have to change whatever the process controls.

jlinkels
 
Old 12-30-2006, 09:09 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Going from Linux to Linux, it would be pretty easy to have a script that sets the next OS to boot---it would do this by simply changing the default character in menu.lst.
Possible to write a similar script for Windows, but would be more involved since Windows would have to access the Linux /boot directory. Perhaps a fix would be to have a small FAT32 partition with just the grub stage files and menu.lst

You could make the script "smart" and have it read menu.lst and show you all your choices--this gets around the updating issue.
 
Old 12-30-2006, 03:21 PM   #5
zimon
Member
 
Registered: Sep 2004
Posts: 38

Original Poster
Rep: Reputation: 16
grub-set-default

Quote:
Originally Posted by jlinkels
This article provides some information about how to boot once into another OS, then the next time in the original one again.
Thanks. I also found this "grub-set-default" in the grub (info *yuck*) manual, but seems like Fedora rpm packages do not have it . Can be found from the source tree of the grub.

However, it requires one knows the order numbers of the OSs in the grub.conf file. It would be soooo much easier to just refer the next OS to be booted by its title in the grub.conf
A wrapper script over grub-set-default would work ofcourse.

http://www.gnu.org/software/grub/man...2ddefault.html

I am not at home right now, so cannot test this. I think it could work for booting from Linux to Windows XP, but then when Windows XP is rebooted, it will boot to the Windows again because there still is that number in /boot/grub/default
Should indeed have /boot partition in VFAT filesystem and some script in the Windows XP which would change the next default Grub boot choice to "0".

Or, I wonder if Windows XP is seen from Grub point of view as a failed OS boot, so the next boot it would make from the "fallback"-entry when Windows XP is quit/rebooted?

Simon wrote:
How do you boot the laptop from 10m away? How do you use it from 10m away?

I actually cannot "boot", but I can ofcourse re-boot. I have 10M dvi-cable, and an active USB-hub with 10m USB-cable, keyboard, mouse, audio-cables + other stuff which is 100% noiseless. The laptop (and a desktop) is behind the wall and the setup is 100% silent where I work (and also sleep).

My laptop doesn't obey the Fn+F3 (F8) setting when it is booting Linux and especially over re-boots. The older laptop did this but the new one doesn't.

Last edited by zimon; 12-30-2006 at 03:24 PM.
 
Old 12-30-2006, 03:44 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,988

Rep: Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217
Maybe look at grub4dos - at least it allows you to get at menu.lst from both sides.
Don't know if Tinybit has this specific feature - been a while since I looked at it.
Maybe it will fit the bill, or you could ask this be added.
 
Old 12-30-2006, 11:40 PM   #7
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Hmmm... then an exit script will be what will work for you.

The setup would be to make a seperate grub.conf (menue.lst) for each OS (simplest, you'll see why). For dual boot you may have, say, grub-fedora and grub-windows ... if the next OS to boot is windows, then from fedora one executes:
Code:
cp grub.conf grub-fedora
cp grub-windows grub.conf
shutdown -r now
... get the idea?

If all these are in a windows accessable partition, then there would be an equivalent in a batch file to change the grub.conf to the fedora version.

If fedora updates, it will add the latest kernel to the fedora-only conf file, since that is the one called "grub.conf" at the time.

I seem to recall there was a thread a while back talking about a way to switch OSs without a reboot... but cannot seem to find it.
 
  


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
gentoo : grub: The file /boot/boot/grub/stage1 not read correctly Boudewijn Linux - Software 3 05-21-2008 04:13 AM
LXer: Howto: Recovering grub boot loader password LXer Syndicated Linux News 0 02-22-2006 05:16 AM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 12:45 PM
Blank Screen after Suse Boot - HowTo boot from grub to command line benco420 Linux - Newbie 3 02-13-2005 06:50 AM
Howto: Existing Win98 + Linux, dual boot using GRUB TheSwine Linux - Newbie 3 01-03-2004 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration