LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 10-20-2005, 04:42 PM   #1
LUB997
Member
 
Registered: Jul 2003
Distribution: openSUSE Linux, Apple Darwin UNIX
Posts: 66

Rep: Reputation: 15
How do I add Windows XP to Grub boot loader?


My 20 GB Western Digital hard drive got full, so I bought a 120 GB Seagate internal upgrade kit, and removed the old hard drive and replaced it with the Seagate drive, intending to dual boot Windows XP Pro and SuSE 9.1 Pro. I tried to install Windows XP first, as that is what I have always done before and it has worked well in the past. Windows did not like the drive because it uses DDO, and it would not create partitions or format the drive in any way in the Windows installation program, so then I ran Seagate's program and turned off the DDO and also installed a jumper to make the drive appear to only be 32 GB so Windows might not have trouble with it. This worked quite well, and Windows installed and created an NTFS partition 32 GB in size (since that's what the jumper told it the size of the hard drive was) and installed on it with no problems. I booted up and got all the updates from Windows update and got it working excellently. Then I put in my SuSE 9.1 CD and rebooted and went throught the SuSE installer, which appeared to have no problems during installation, and then when the installer finished and rebooted grub would not start because it said it got a dimensional error or physical error or something like that. So, Having already spent 2 days messing with the crappily designed drive, I didn't want to spend another 2 days trying to figure out why GRUB didn't want to cooperate any more than the Windows XP installer did. So, I took out the 120 GB and removed the 32 GB limiter jumper and also removed the jumper that made it be recognized as the primary hard drive. Then I installed a jumper in my old 20 GB hard drive to make it be recognized as the primary drive, and installed my old hard drive (with my still working previous installation of SuSE 9.1 Pro) as the master and the new hard drive (with the good Windows XP installation) as the slave drive. Then I started up the computer and SuSE booted right up with no problems from my original hard drive since it is the master now, though the NTFS partition containing Windows XP is still on the slave drive (the new drive). In SuSE I did <<fdisk -l>> as root to see what drive and partition linux recognized my Windows partition to be. It showed that my Windows NTFS partition is /dev/hdb1. Now what I want to do is add /dev/hdb1 NTFS partition to GRUB so I can boot into Windows through GRUB. How do I do this? Then I can just use my existing SuSE install since it works and always has worked great anyway, and can boot into Windows on /dev/hdb1. Then I can remove the partitions created on the new slave drive by the SuSE install program and create one big partition and give it all to SuSE. Right now though, I just want to be able to boot my Windows XP NTFS partition on /dev/hdb1 through the GRUB bootloader that is installed already. What do I need to do to add it to grub? I don't want to reinstall anything since I have a working SuSE install right now and have a working Windows install that I just need to figure out how to boot into, and the last 2 days have shown me that the new hard drive is not going to be cooperative in any way if I reinstall anything. It has some odd type of technology that makes both Windows and SuSE dislike it as a primary drive. It seems to work great as a slave drive though, if I could only figure out how to boot the Windows partition on /dev/hdb1 through GRUB. Even after I add it, will I need to change the bios to make the slave drive bootable too, since the slave drive contains the Windows XP partition?

Last edited by LUB997; 10-21-2005 at 12:19 AM.
 
Old 10-20-2005, 05:49 PM   #2
Sinaz
LQ Newbie
 
Registered: Sep 2005
Location: Siberia-Gasteiz
Distribution: Debian Sarge
Posts: 13

Rep: Reputation: 0
Edit your /boot/grub/menu.lst and ad the following:

Code:
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader +1
you need to do this because windows doesn`t boot from the secondary IDE,
the entry to boot my windows partition is
Code:
title Windows
root (hd0,1)
chainloader +1
But I have both Debian and Windows in the same drive.
Grub counts as hd0 the HD conected to the 1st IDE, with the map option you change the order so you can boot windows, or something like that, so I think you shouldn`t make the second HD bootable too, but if this doesn`t work try it!

Hope you found this usefull!
 
Old 10-20-2005, 09:41 PM   #3
LUB997
Member
 
Registered: Jul 2003
Distribution: openSUSE Linux, Apple Darwin UNIX
Posts: 66

Original Poster
Rep: Reputation: 15
Sinaz, thank you for the excellent help. I used your instructions exactly like you said and did not have to change them at all from how you typed it, and it worked the very first try. I am writing this from my XP partition, and I wouldn't be if it hadn't worked. Everything on the XP partition is exactly as I left it, and it all looks to be working great now. I didn't even want to put Windows back on this computer. I have not used anything but Linux on my home computers in nearly 4 years now, and have not regretted it, but I had to put Windows back on at least temporarily because I am majoring in computer science, and my Programming II class makes me use Visual Studio .NET and the C# programming language. For a long time I was getting away with using the Mono C# compiler to do all my assignments and Mono worked really well, but now we are getting into things that use System.Windows.Forms, and Mono does not support Windows.Forms yet so I had to put Visual Studio .NET on my computer to be able to keep up with my assignments, and that meant Windows XP. Once I am through with Programming II I will nuke Windows and go back to strictly linux (the way I prefer it), but I really appreciate your help in getting this working because it was turning into a complete nightmare making the 2 operating systems cooperate with one another, and the fact that the new hard drive uses weird technology that neither operating system likes, sure didn't help. Your information was extremely helpful and did exactly what I needed the very first try.

Last edited by LUB997; 10-21-2005 at 12:11 AM.
 
Old 08-21-2006, 06:11 PM   #4
nzgreenie
LQ Newbie
 
Registered: Jul 2006
Posts: 3

Rep: Reputation: 0
I tried this too and it worked a treat!

I am running Fedora Core 5 on my primary master drive with windows xp on the primary slave.

In FC5, the /boot/grub/menu.lst file is a symbolic link to ./grub.conf fo I just edited grub.conf with the code shown for menu.lst....

[snip]
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader +1
[snip]

....rebooted, and both now boot perfectly! Thanks!!!

(I found VERY interesting that M$ refuses to boot from a secondary drive! The M$ arrogant assumption that everyone will install Windows only lives on.....)
 
Old 08-07-2007, 06:17 AM   #5
Belisarius
LQ Newbie
 
Registered: Aug 2007
Location: Newcastle upon Tyne, UK
Distribution: Ubuntu, DSL
Posts: 7

Rep: Reputation: 0
Thanks`

This worked fine for me too. Just had to put XP on my machine due to work commitments :-(

Thanks

Andy
 
Old 09-24-2007, 03:04 PM   #6
watersoup
LQ Newbie
 
Registered: Jul 2005
Posts: 2

Rep: Reputation: 0
Hi Sinaz!!!

Would you able to guide me I have two hard-drives: and one has Fedora 7 and other ans Windows XP

Now Grub has been installed on fedora 7. BTW I can boot either of the OS by changing the order of boot in BIOS. would you be able to guide me how to make them dual boot with menu at the begining ??

Fedora core 7 is on SATA harddrive which is THIRD primary IDE.
Windows XP is on primary IDE with hard-drive having slave cap.

Mother boards: ASUS p4c800 deluxe

Many Thanks
watersoup
 
Old 01-13-2008, 02:12 PM   #7
BlackWidower
LQ Newbie
 
Registered: Apr 2007
Location: Canada
Distribution: Fedora 7
Posts: 12

Rep: Reputation: 0
Question Confusion

On my system I have 2 Windows Partitions, sda3 and sda4. How do I add each of those to grub?

You might be asking why I have 2 Partitions, because neither of them worked when they were on other mediums and I need to find a way to run at least one of them on my hard drive.

I guess the best way to word this question is thus: How do you specify which partition to boot from?

And why doesn't grub have a GUI?
 
Old 01-13-2008, 03:12 PM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
In the same way as described above, using (hd0,2) or (hd0,3) instead though (assuming you've only got one hard drive). The first number refers to the disk and the second refers to the partition, with 0 referring to the first disk/partition, 1 to the second, etc. Also, what do you mean by, "why doesn't GRUB have a GUI?" A GUI for what exactly?
 
Old 01-13-2008, 06:42 PM   #9
BlackWidower
LQ Newbie
 
Registered: Apr 2007
Location: Canada
Distribution: Fedora 7
Posts: 12

Rep: Reputation: 0
Thanks a bunch.

I was thinking a GUI to alter settings, add items, etc. In a safe, secure and user friendly way. True most Linux users can successfully manage without, but if you ask me this is the reason why most people still use Windows, because it's not as easy to use.

I'm pretty sure..no, I'm certain, Linus Torvalds himself came out against stuff like this, he said you can't say a feature exists if there is no GUI to support it.

But also seriously, thanks for the information.
 
Old 01-13-2008, 10:17 PM   #10
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Fedora 8, Centos 5.1
Posts: 480

Rep: Reputation: 30
The reason a GUI may not exist is because no one saw fit to create one.

Some parts of Linux definitely should not have GUI's, mainly the bits that can allow you to break your system in some. Grub and Lilo are good examples. If you need to change things like the bootloader then you need to learn how (using the man pages and a serach engine), because these are the settings that can leave you with no bootable OS.

But i am definitely of the camp that thinks all users should try and break their installations for the first couple of years. After those two years, you will be hardened users with a good knowledge of what you are doing.
 
Old 03-24-2008, 08:03 AM   #11
swisschock
LQ Newbie
 
Registered: Mar 2008
Posts: 12

Rep: Reputation: 0
HI
I M A NOOB IN LINUX
I HAV XP ON MY IDE & I TRIED TO INSTAL RHEL4.0 ON MY SATA HDD
I CHOSE 1ST SECTOR OF MY SATA AS LOCATION OF GRUB
BUT I HAV PROB IN BOOTING XP
TRIED SUPERGRUB CD & ALSO FIXBOOT, FIXMBR COMMANDS
BUT COULD NOT GET MY XP TO BOOT. EARLIER I USED TO GET A GRUB PROMPT.
XP REPAIR FAILED
These r the results with Supergrub CD-->

Menu
GRUB=>MBR & !LINUX! (1) AUTO ))
GRUB=>MBR & !LINUX! (>=2) MANUAL )))
!LINUX! (1) AUTO
!LINUX! (>=2) MANUAL
!WIN! (
WIN=>MBR & !WIN! (((((

when i select the Win option to boot, IT STARTS THE Win XP SETUP!!!!
IT DOESN NOT TAKE ME TO MY ORIGINAL WINXP!!!!!
IN gRUB HELP it was written that it might fix the MBR
WHAT I THOUGHT
THAT MY XP WAS BEING FORMATTED/FRESHLY INSTALLD (INSTEAD OF BEING REPAIRED) SO I QUIT THE PROCESS (3 times)

NOW I AM GETTING A BLANK SCREEN; NO XP; NO REDHAT 4.0

THIS IS A SAMPLE FILE DOWNLOADED FRM NET AS I SEARCHD FOR SOLUTIONS.( ITS NOT MINE)
{

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda2
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.7-10)
root (hd0,1)
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi
initrd /initrd-2.4.7-10.img
title Windows 2000
rootnoverify (hd0,0)
chainloader +1
}
SHUD I ALSO EDIT MY GRUB ACCORDINGLY? SO THAT I RECOVER MY OLD XP?
PLS HELP
THANKS
 
Old 03-24-2008, 08:11 AM   #12
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Firstly, please don't write entire posts in capital letters as it makes it look like you're shouting.

Do you actually have Linux installed? Run "fdisk -l" (that's a lowercase L) as root and post the output here. If you have Linux installed, you can use it to do that, or get a live CD and use that.
 
Old 03-24-2008, 11:06 PM   #13
seabass07
LQ Newbie
 
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
I have a similar problem. I am running kubuntu dapper. I installed xp afterwards. When windows tried to reboot the system after install, the system did not know which os to boot. It just stayed at the black screen and grub did not load. I fixed grub from the kubuntu live cd with this:

sudo grub
find /boot/grub/stage1
root (hd0,1)
setup (hd0,1)

This fixed grub and allowed kubuntu to run. The problem is when I go the the grub menu and try to load windows, it is not there. There are 2 sets of kubuntu there...that is 2 sets of kubuntu and kubuntu restore.

I tried adding it in the menu 1st file since it was not there.

Currently the entry reads:
title Windows xp
rootnoverify. (hd0,0)
chainloader. +1
boot

I have tried replacing rootnoverify with root. I am fairly certain that windows is on (hd0,0). It is on the 1st partition. My second partition is the swap and my 3rd is Kubuntu. I have also tried changing the root directory to hd0,1 and hd0,2. Still nothing.

The current setting comes up with a syntax error. With the rootnoverify changed to root, I get an error saying must load kernel before booting...or something to that effect. Every other setting gives me a syntax error. I am extremely new to linux, so I am still figuring things out.
The fdisk -l shows:


Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 6919 55576836 b W95 FAT32
/dev/hda2 * 7168 9729 20579265 83 Linux
/dev/hda3 6920 7167 1992060 c W95 FAT32 (LBA)

Partition table entries are not in disk order


I'm not sure what I'm doing wrong...I installed windows xp from a system restore disk and it automatically started the install once opened. It did not format anything because when I installed kubuntu, I had already formatted the windows partition as fat32.

Last edited by seabass07; 03-24-2008 at 11:08 PM.
 
Old 08-19-2008, 09:31 AM   #14
Robbinski12
LQ Newbie
 
Registered: Aug 2008
Posts: 7

Rep: Reputation: 0
Unhappy RE: How do I add Windows XP to Grub boot loader?

OK with that (first) post of Sinaz I came further than I came before. When I try to boot Windows now it says "Starting...", however it's never gonna start in a million years if I let it keep trying.

This is the 'crucial' part of my /boot/grub/menu.lst:
Code:
title		Ubuntu
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.24-19-generic root=UUID=1be478d5-4b2a-4773-8ec2-34df68df1d19 ro quiet splash
initrd		/boot/initrd.img-2.6.24-19-generic
quiet

title Windows
root (hd0,1)
chainloader +1

title		Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.24-19-generic root=UUID=1be478d5-4b2a-4773-8ec2-34df68df1d19 ro single
initrd		/boot/initrd.img-2.6.24-19-generic

title		Ubuntu 8.04.1, memtest86+
root		(hd0,0)
kernel		/boot/memtest86+.bin
quiet
As you see I just called 'Windows XP Home Edition' 'Windows' and 'Ubuntu ~' 'Ubuntu'.

I don't know what I do wrong or how I can fix it so please can someone help??

Robin Kanters
 
Old 08-19-2008, 01:52 PM   #15
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Not really sure about this one. Perhaps you need to have "rootnoverify" in there, rather than "root".
 
  


Reply

Tags
grub, hd, slave, xp


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 boot loader blocking windows boot julienroger Linux - Newbie 3 10-12-2004 01:11 PM
GRUB boot loader problem with Windows 2000 bukich Linux - General 1 06-11-2004 06:42 AM
GRUB boot loader on TurboLinux doesn't detect Windows shantanun Linux - Newbie 2 02-18-2004 07:49 AM
how can i add windows xp in Linux boot loader mobassir Linux - Software 33 09-11-2003 12:56 AM
How to add a boot record which used to startup windows under my Grub boot loader? yunxiang Linux - Newbie 6 02-01-2003 02:22 AM


All times are GMT -5. The time now is 10:16 AM.

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