LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-30-2009, 03:52 AM   #1
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Rep: Reputation: 16
XP boot partition


how do i check what partition my XP boots off. my ubuntu boots from hd0,1 but how do i check that for XP?
 
Old 03-30-2009, 03:55 AM   #2
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
I believe XP uses the MBR (can someone confirm this?).

If you want to know what partition it's using do an
Code:
# fdisk -l
... and you should see an NTFS partition somewhere.

Hope this helps.
 
Old 03-30-2009, 04:10 AM   #3
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
thanks i'll try that.
 
Old 03-30-2009, 04:12 AM   #4
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
the response i get is Cannot open /dev/sda?
 
Old 03-30-2009, 04:15 AM   #5
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
did you run the command as root?

Code:
$ sudo fdisk -l
or

Code:
$ su -
# fdisk -l
 
Old 03-30-2009, 04:29 AM   #6
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
sudo fdisk -l worked and showed me its in /dev/sda2. now how do i add that to my grub menu so i can boot XP from grub? any ideas?
 
Old 03-30-2009, 04:33 AM   #7
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
A quick search on the net or in the grub man pages should show how to boot a windows box.
link1
link2


As for sda2...

Grub sees sda as hd0 and starts counting partitions starting with 0 so:
sda2 should be hd0,1.

Last edited by eco; 03-30-2009 at 04:36 AM.
 
Old 03-30-2009, 04:57 AM   #8
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
still not working. im getting Error 21: selected disk does not exist
 
Old 03-30-2009, 05:24 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Please post the relevant sections of /boot/grub/menu.lst

With Windows on the 2nd partition of drive 1, it might look something like this:

title Windows
root (hd0,1)
map (hd0,0) (hd0,1)
map (hd0,1) (hd0,0)
chainloader +1
makeactive
boot

The "map" tricks Windows into thinking that it is on the first partition on the first drive. Typical Google searches only discuss mapping whole drives.

The "booting" link below in my sig might help--at the end there is a link to a post by Saikee (the world expert)

Last edited by pixellany; 03-30-2009 at 05:28 AM.
 
Old 03-30-2009, 05:31 AM   #10
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
title Windows XP
root (hd0,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
boot

do i need to change anything there?
 
Old 03-30-2009, 05:36 AM   #11
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
i just tried editing the /boot/grub/menu.lst with
title Windows XP
root (hd0,1)
chainloader +1
makeactive
boot

and it works. thanks for your help guys.
 
Old 03-30-2009, 05:43 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You are mapping drive 1 to drive 2, but you said that you had Windows on drive 1, partition #2.

Look at my example, and the links

The map command is admittedly a bit confusing. Here is a link I found with an example:
http://forum.freespire.org/showthread.php?p=13980
They put the "root" statement after the "map", so the syntax is a bit different.
 
  


Reply



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: How to boot WinXP (NTLDR, NTDETECT.COM & BOOT.INI) from boot partition (EXT2) ? Rayen16 Linux - Software 1 05-25-2006 12:09 PM
Messed up partition table and Windows' partition boot sector pyromithrandir Linux - General 32 04-08-2006 12:26 PM
Deleted linux partition, how to boot Windows partition? mysak Linux - General 3 12-14-2005 04:22 PM
Did partition with partition magic now can't boot windows deancicca Programming 1 12-08-2005 10:27 PM
strange partition table - boot partition empty etanter Linux - General 0 12-23-2003 09:46 AM

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

All times are GMT -5. The time now is 01:42 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
Open Source Consulting | Domain Registration