LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2010, 02:33 PM   #1
mahfuz05
LQ Newbie
 
Registered: Aug 2009
Posts: 12

Rep: Reputation: 0
ubuntu 10.04 Grub does not load Xp


i got a silly problem . after installing ubuntu 10.04 my grub 2 loader
shows my Xp at sda3 but when i click it it return to grub menu again.

here is my /boot/grub/grub.cfg file

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda3)" {
insmod fat
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d417-e7a0
drivemap -s (hd0) ${root}
chainloader +1
}

Please help me.
 
Old 06-19-2010, 03:41 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I don't know if this will help you solve your problem, but here goes:

I've seen friends, on their first attempts at installing Linux, run into problems with their Windows partitions when they had C and D drives set up (one for the OS and the other for data). The older version of grub identified both at Windows partitions and wrote a config for both to show on the grub menu. When selected, one would boot and the other would not.

So, please show the output of 'fdisk -l' and any other grub.cfg entries which also relate to Windows.

Comparing fdisk to grub.cfg should make it possible to determine if you grub.cfg needs edit.
 
Old 06-19-2010, 04:05 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
If you only have one disk then press "c" key when you see the Grub screen to get a Grub prompt and try firing up Xp manually by
Code:
set root='(hd0,3)'
chainloader +1
boot
If this works remove the line beginning with "drivemap"
 
Old 06-20-2010, 08:47 AM   #4
mahfuz05
LQ Newbie
 
Registered: Aug 2009
Posts: 12

Original Poster
Rep: Reputation: 0
@bigrigdriver
yea my problem occur for same reason. my xp is in C drive but my System Volume info in D Drive. how can i solve this problem.
Here is my fdisk -l info


Device Boot Start End Blocks Id System
/dev/sda1 1 146 1172713+ 82 Linux swap / Solaris
/dev/sda2 147 1971 14659312+ 83 Linux
/dev/sda3 * 1972 3187 9767520 c W95 FAT32 (LBA)
/dev/sda4 3188 19456 130680712 f W95 Ext'd (LBA)

/dev/sda5 3188 7011 30716248+ b W95 FAT32
/dev/sda6 7012 10835 30716248+ b W95 FAT32
/dev/sda7 10836 14659 30716248+ b W95 FAT32
/dev/sda8 14660 19456 38531871 7 HPFS/NTFS
 
Old 06-20-2010, 11:50 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
mahfuz05,

Do you need to be taken by the hand?

If you see a Grub screen pressing the "c" key instead of selecting system to boot will drop you into a Grub prompt where you communicate with Grub directly.

If you type as I suggest in Post #3 by
Code:
set root='(hd0,3)'
you tell Grub that you want to boot the 3rd partition of the first disk. In Linux term that is sda3 which should have XP's NTLDR inside. All MS Windows place their boot loaders in the first partition they recognise and themselves can reside elsewhere.

By the command
Code:
chainloader +1
you tell to boot up the boot loader inside the specified partition.

The statement
Code:
boot
is the green light for Grub to hand over its control to the boot loader inside sda3 and you should see Xp boots up.

sda3 is likely to be the location of the Xp boot loader because all MS Windows must be booted from a "active" primary partition. The "*" means sda3 is active and in LInux only sda1 to sda4 can the primary or extended partition.

If you prove your Xp bootable then you amend the /bootgrub/grub.cfg to the manual commands you have used.
 
Old 06-20-2010, 02:06 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by mahfuz05 View Post
after installing ubuntu 10.04 my grub 2 loader
grub2 has a slightly different command set than grub. Also grub2 numbers disks differently.

The advice in this thread seems to be ignoring the fact that you said grub2.

Most of the examples I've seen online have fewer and slightly simpler commands than what you showed. For example (plus detailed instructions) see
http://blogs.koolwal.net/2008/12/28/...b2-or-grub-pc/

The key commands there match yours, except for those extra quotes I haven't seen before.

Based on such online examples, I'd expect just
Code:
set root=(hd0,3)
chainloader +1
instead of your
Code:
insmod fat
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d417-e7a0
drivemap -s (hd0) ${root}
chainloader +1
Notice also the advice there (and in every similar page) not to directly edit /boot/grub/grub.cfg when making such changes.

Last edited by johnsfine; 06-20-2010 at 02:20 PM.
 
Old 06-20-2010, 02:23 PM   #7
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
For a start GRUb2 starts counting by one .
So if windows is on sda 4 than it is (hd0,4)
Although you can edit grub.cfg it is not recommended .
On the terminal try the command sudo update-grub
If it does not work see http://ubuntuforums.org/showthread.php?t=1195275

Last edited by ronlau9; 06-20-2010 at 02:57 PM.
 
Old 06-20-2010, 06:00 PM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by ronlau9 View Post
For a start GRUb2 starts counting by one .
So if windows is on sda 4 than it is (hd0,4)
Sorry if my post threw confusion into that aspect of the problem. The (hd0,3) was correct for grub2. Windows seems to be on sda3. Certainly not on sda4.
 
Old 06-20-2010, 07:46 PM   #9
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Are you sure its not /dev/sda8 ?
 
Old 06-21-2010, 02:15 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
For those nervous about editing grub.cfg the worst that could happen if grub.cfg doesn't work is Grub will default to a Grub prompt which in my view is the most powerful booting tool.

I always edit the Grub configuration and even generate it myself or remove it to suit my requirement.
 
Old 06-21-2010, 02:33 PM   #11
mahfuz05
LQ Newbie
 
Registered: Aug 2009
Posts: 12

Original Poster
Rep: Reputation: 0
@saikee i have tried your command using pressing c and e and edit
as you say but still no change.

i have also tried with this
apt-get update
#apt-get install grub2
then
sudo gedit /etc/grub.d/11_Windows.save
then write it
#! /bin/sh -e
echo "Adding Windows" >&2
cat << EOF
menuentry "Windows XP" {
set root=(hd0,3)
chainloader +1
}
EOF

then chmod a+x /etc/grub.d/11_Windows
then update-grub2

but also no change.
i am hopeless...........
 
Old 07-06-2010, 09:23 PM   #12
Aras
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Were you able to solve this issue? I am having the same problem. I'v tried all the suggestions here but no luck so far. I just installed Ubuntu 10.04 on a computer in the lab that had XP on it. I dont use the XP but some of the other fellows in the lab need it. There was only one partition before installing Ubuntu and that was 500gb. I resized that and took 50gb for root and 3gb for swap. Any suggestions?
 
  


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 doesn't let me load without Ubuntu external hard drive plugged in. Eitaro Linux - Newbie 5 06-27-2009 02:14 AM
After installing Fedora 10 I cannot get Ubuntu 8.10 to load from grub kmacphail Linux - Newbie 18 02-14-2009 07:25 PM
Windows wipes out GRUB - can't load Ubuntu! vincebs Linux - General 3 07-17-2006 03:09 PM
GRUB can't load Windows XP... Ubuntu for AMD K8 can't boot up Navyblue Linux - Newbie 20 07-31-2005 10:19 AM
Grub will not load Windows XP with Ubuntu dual boot Alex4R Linux - Software 1 03-26-2005 11:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 PM.

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
Open Source Consulting | Domain Registration