LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   XP boot partition (https://www.linuxquestions.org/questions/linux-newbie-8/xp-boot-partition-715430/)

bcbotha 03-30-2009 03:52 AM

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?

eco 03-30-2009 03:55 AM

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.

bcbotha 03-30-2009 04:10 AM

thanks i'll try that.

bcbotha 03-30-2009 04:12 AM

the response i get is Cannot open /dev/sda?

eco 03-30-2009 04:15 AM

did you run the command as root?

Code:

$ sudo fdisk -l
or

Code:

$ su -
# fdisk -l


bcbotha 03-30-2009 04:29 AM

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?

eco 03-30-2009 04:33 AM

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.

bcbotha 03-30-2009 04:57 AM

still not working. im getting Error 21: selected disk does not exist

pixellany 03-30-2009 05:24 AM

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)

bcbotha 03-30-2009 05:31 AM

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

do i need to change anything there?

bcbotha 03-30-2009 05:36 AM

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.

pixellany 03-30-2009 05:43 AM

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.


All times are GMT -5. The time now is 03:18 AM.