LinuxQuestions.org
Review your favorite Linux distribution.
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 04-07-2006, 03:00 AM   #1
trawler
Member
 
Registered: Oct 2005
Distribution: Ubuntu 5.10
Posts: 50

Rep: Reputation: 15
Question 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...

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?
 
Old 04-07-2006, 12:02 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
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
 
Old 04-07-2006, 05:02 PM   #3
trawler
Member
 
Registered: Oct 2005
Distribution: Ubuntu 5.10
Posts: 50

Original Poster
Rep: Reputation: 15
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?
 
Old 04-07-2006, 05:47 PM   #4
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
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?
 
Old 04-08-2006, 03:16 AM   #5
trawler
Member
 
Registered: Oct 2005
Distribution: Ubuntu 5.10
Posts: 50

Original Poster
Rep: Reputation: 15
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. (
 
Old 04-08-2006, 04:16 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

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


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
permanent module options: where to set? mehlkelm Debian 2 09-20-2005 02:18 AM
How to set eFax options jgombos Linux - Software 0 06-12-2005 06:43 PM
Debian: How do I set wireless (iwconfig) options at boot? muzicman82 Linux - Wireless Networking 1 06-06-2004 11:57 AM
GRUB options Rizla Fedora - Installation 1 03-23-2004 02:19 PM
how to set security options in Slack 9.1 Nappa Slackware 1 01-15-2004 06:18 AM


All times are GMT -5. The time now is 04:16 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