LinuxQuestions.org
Visit Jeremy's Blog.
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 09-08-2007, 12:15 PM   #1
Zaskar
Member
 
Registered: Feb 2004
Location: NY
Distribution: Debian (Testing)
Posts: 219

Rep: Reputation: 30
Dualboot/Grub question. Installing windows AFTER linux?


Heya guys, I currently have 2 HD's in my Linux box. I recently decided that I would take the second HD and make it a windows install and buy a bigger 3rd drive to replace it (was used just as a custom named files directory)

So my questions are, what would I have to do to the Grub config on the first drive to let it have the option of showing the windows install on the second drive? Ive never done an install in this order before. Usually when doing Linux second, it automatically sees the windows install and automatically sets it into the grub config.

(Im really not experienced in working with grub, so any details/guides would be very helpfull)

Thanks guys
 
Old 09-08-2007, 12:39 PM   #2
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
I'd physically disconnect the Linux drive before installing Windows. After the install, you should be able to boot Windows if you edit you /boot/grub/grub.conf or /boot/grub/menu.lst (you may have one or both: if both, one is a soft link to the other) by adding the following lines.

title Windows
root (hd1,0)
chainloader +1

After editing, reboot and you should see a new menu item for "Windows" or whatever you choose to say after the word "title". To learn more about GRUB, this is a good reference.
 
Old 09-08-2007, 12:51 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Previous suggestion good---some clarification: Windows installs its bootloader to the MBR of the drive--no choice. If you install Windows on the "windows drive" with the Linux drive disconnected, then the windows drive will--for the moment--be #1. When you then reconnect the Linux drive, check the BIOS settings to be sure it is now #1 again.

Since Windows will now be #2, you will also need the "map" command in the menu.lst entry.

title Windows
root (hd1,0) (tells Grub that Windows is on the 1st partition of drive 2
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

See also the "booting" link below.
 
Old 09-08-2007, 01:06 PM   #4
Zaskar
Member
 
Registered: Feb 2004
Location: NY
Distribution: Debian (Testing)
Posts: 219

Original Poster
Rep: Reputation: 30
cool did some reading on various sites in the meantime too, some say I need to put the 2 map lines above the "root" line, and most also have a "makeactive" line, whats that needed for?

thanks
 
Old 09-08-2007, 01:45 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I don't think the location of the map commands is critical.

"makeactive"--I think is only required if the boot flag is not on for the Windows partition

EDIT: I have no "makeactive" in my menu.lst and my Windows partition is not marked as bootable. Now suddenly, I don't feel I know ANYTHING...

Last edited by pixellany; 09-08-2007 at 02:00 PM.
 
Old 09-08-2007, 02:13 PM   #6
Zaskar
Member
 
Registered: Feb 2004
Location: NY
Distribution: Debian (Testing)
Posts: 219

Original Poster
Rep: Reputation: 30
another thing I dont get, it says
"root (hd1, 0)"

Which one of those says it is using the first partition? in things like fstab it depicts the partitions as 1 or 2, and never with a 0, or is the 0 counting as the drives master boot record?

If thats the case, I keep a small swap partition on the second drive at the start, so would my windows partition be (hd1, 1) now or (hd, 2) (the partition in fstab was considered 2 i think) or is it still (hd1, 0) cause it just points to the master boot record, and thats unaffected by the small swap partition at the start?

Thanks again
 
Old 09-08-2007, 02:46 PM   #7
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
Good thing pixellany caught my mistake on the map command. Windows needs to think it's on the first drive, so if it isn't, the two 'map' entries are needed. I didn't think that the placement of the 'map' commands was critical, but in my most recent install, it was, maybe because it's an older GRUB. (That machine triple boots Slackware 8.1, Windows 3.1 and Windows 3.11 on a 486/50. I'm still working on getting it to boot Gentoo with nfs-root)

My menu.lst is this:

map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot

Quote:
Originally Posted by Zaskar View Post
another thing I dont get, it says
"root (hd1, 0)"

Which one of those says it is using the first partition? in things like fstab it depicts the partitions as 1 or 2, and never with a 0, or is the 0 counting as the drives master boot record?
That's one of the most confusing things about GRUB. GRUB counts starting from 0, so the first partition on the first drive is (hd0,0). Linux calls drives hda, hdb (or sda, sdb) and so on, but it's important to remember that those are hardwired: hdb is a slave drive on the primary IDE connector, even if you only have one drive. In contrast, GRUB counts what it sees, from where it is, so if you have 2 drives on a machine that can boot to either one, whichever one you boot to, GRUB will see as (hd0).
 
Old 09-08-2007, 02:47 PM   #8
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
root(hd1,0)
i think it means
hardisk1, 1st partition

partition starts from 0
 
Old 09-08-2007, 04:12 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by crash_override_me View Post
root(hd1,0)
i think it means
hardisk1, 1st partition

partition starts from 0
Harddisk 2, 1st partition--grub counts everything from 0.
Assuming only one type of drive
Linux...GRUB
hda1 = hd0,0
sda1 = hd0,0
hdb2 = hd1,1
etc.......

If SATA/SCSI and PATA are mixed, it can get messier.
 
Old 09-09-2007, 03:51 AM   #10
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
Quote:
Originally Posted by pixellany View Post
Harddisk 2, 1st partition--grub counts everything from 0.
thanx for correcting me..!!
 
  


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 dualboot XP and Linux Problem demmylls Linux - General 3 03-03-2007 01:52 PM
grub+dualboot with xp/linux linuxtesting2 Linux - General 5 11-15-2004 11:35 AM
Installing Windows for a dualboot MylesCLin Linux - Newbie 2 11-03-2004 07:40 AM
Fedora Core 2 and windows xp dualboot question (not the hd geometry problem) justintime32 Fedora 3 09-25-2004 07:42 AM
winXP / linux dualboot via GRUB problems r0bman Linux - Software 4 07-20-2004 03:14 PM


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