LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dual Boot Seperate HD wih Win XP (https://www.linuxquestions.org/questions/linux-newbie-8/dual-boot-seperate-hd-wih-win-xp-645399/)

Kiwi944 05-28-2008 02:39 PM

Dual Boot Seperate HD wih Win XP
 
Hello All

I will apologies now for my limited or non existant knowledge of Linux, I have recently (yesterday) installed Ubuntu onto my PC, currently I also have Windows XP installed on a seperate HDD, however when I reboot I see the Grub menu but there is no option for Windows XP.

I have read some of the posts relating to this style of issue but most seem to be on the same hdd, I have Win XP on a SATA and Ubuntu on IDE.

Could someone please assist in how I should resolve this?

Cheers
Alan

bigrigdriver 05-28-2008 02:50 PM

In Ubuntu, add an entry for WinXP to the file /boot/grub/menu.lst (you will need to edit the file as root). You will need to post the output of 'fdisk -l' in order for someone to tell you exactly how to phrasr the entry for winxp.

It will be something like this:
title WinXP
root (hdX,Y) where X and Y indicate the drive and partition of winxp
makeactive
chainloader +1

Kiwi944 05-28-2008 02:54 PM

Thanks for the quick response and information I will post the details shortly.

Larry Webb 05-28-2008 02:57 PM

First do you have any experience with terminal? To make a long story short you will need to modify you /boot/grub/menu.lst. Windows wants to be on the first partition of the first hd to boot. Your ide hd will boot first so we need to change the boot menu where windows thinks it is booting first. This will take three or four steps but we need to have an idea where to start.

Larry Webb 05-28-2008 03:00 PM

Sorry bigrigdriver, your post slipped in while I was typing mine.

Kiwi944 05-28-2008 03:13 PM

Hi Thanks for the great help and suggestions please find below the requested fdisk -l output.

Larry Webb I have a little experience with Terminal but want to expand this knowledge as much as I can. I am sure it will take a while but hey I love a challenge.

Quote:

alan@alan-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8f168f16

Device Boot Start End Blocks Id System
/dev/sda1 * 1 408 3277228+ 7 HPFS/NTFS
/dev/sda2 409 2434 16273845 5 Extended
/dev/sda5 409 2343 15542856 83 Linux
/dev/sda6 2344 2434 730926 82 Linux swap / Solaris

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

Device Boot Start End Blocks Id System
/dev/sdb1 1 9729 78148161 42 SFS

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

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 3824 30716248+ 7 HPFS/NTFS
/dev/sdc2 3825 9728 47423880 f W95 Ext'd (LBA)
/dev/sdc5 3825 9728 47423848+ 7 HPFS/NTFS

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9da92c3b

Device Boot Start End Blocks Id System
/dev/sdd1 2 60801 488376000 f W95 Ext'd (LBA)
/dev/sdd5 2 60801 488375968+ 7 HPFS/NTFS
alan@alan-ubuntu:~$

I am picking that XP is installed on sdc.

thanks in advance AL

Kiwi944 05-28-2008 07:12 PM

Hello All

Just wondered whether the following info would assist with helping me understand what needs to be entered into menu.1st?

IDE 0 Master Ubuntu Installation 20Gb
IDE 0 Slave Data Storage 80Gb
IDE 1 Master DVD Device (optical)
SATA 0 Windows XP Pro 80Gb
SATA 1 Media Storage 500Gb

Am I correct in thinking they would be labeled as follows

IDE 0 Master = hda,x
IDE 0 Slace = hdb,x
IDE 1 = hdc,0
SATA 0 = sda,x
SATA 1 = sdb,x

where x is the partition number?

Larry Webb 05-28-2008 08:15 PM

The hds are listed hda,? is where the 'a' is the first drive and the "?' is the partition number on that drive (such as 1 for the first partition and so forth). hdb would be the second hd to boot and of course the partition is marked the same. sda is the same as the hds except it stands for sata drives and most external. They say the ides will always boot before the sdas in the boot order. Now with windows on your sda we need to trick it into thinking it is the first in the boot. I need you to go to terminal and show us your '/boot/grub/menu.lst' as root. If you have trouble locating it use the command ' find /boot/grub/menu.lst ' All of this without the hash marks.

Larry Webb 05-29-2008 07:37 AM

I am sorry for the prior post, too late at night, your ubuntu will probably list all the hds at sd?. I appears you have one type of windows on sda1 and linux on sda5. Please go to terminal and locate '/boot/grub/menu.lst' by using the command 'find /boot/grub/menu.lst/' without the hash marks.

saikee 05-29-2008 08:01 AM

Under the circumstance with 4 hard disks of sda, sdb, sc and sdd it would be better to find out the disk order first.

This can be done while in Ubuntu, choose a terminal and fire up a Grub shell with the command
Code:

sudo grub
Then ask Grub to tell you the geometry of the 4 disks by commands
Code:

geometry (hd0)
geometry (hd1)
geometry (hd2)
geometry (hd3)
quit

Grub count from 0 and so the 1st partition of the 1st disk will be known as (hd0,0) to Grub. The notations used by Grub is different to Linux. Since your Ubuntu in IDE primary master boots so (hd0,0) will be sda1 with partition Type 7 indicating it is a NTFS partition. (hd0,4) or sda5 should be your Ubuntu partition.

By comparing the geometry of each disk with the sudo fdisk -l in post #6 you can find out the disk orders.

A MS Windows must be booted by a primary partition marked by a "*" in the output of fdisk -l. In your case there are two of them; namely sda1 and sdc1. So your WIndows will boot if you instruct Grub to boot up either sda1 or sdc1.

The commands, installed in /boot/grub/menu.lst, will be as per bigrigdriver's suggestion in Post #2. All you need is the partition referefernce of (hdx,y). For sda1 it would be (hd0,0). If sdc is your 3rd disk then the partition reference should be (hd2,0).

The above assumes you have not altered the disk order before and after Ubuntu installation. If you did then this is the time to tell us because the booting instructions will have to be modified.

The other way you can find out which partition you should boot to is to look at the files inside. The partition that can fire up Xp will have the files like boot.ini and NTLDR inside.

Lastly Ubuntu belongs to the modern group of Linux that has standardised calling all IDE, PATA, Sata, USB external hard disk and USB memory devices by device names sda, adb, sdc, sdd, sde,....etc.

jiml8 05-29-2008 10:16 AM

Drive order will also be listed explicitly in device.map which exists in /boot/grub.

In fact, should it prove necessary, the drive order seen by grub can be changed using device.map.

For instance, here is my device.map:
Code:

(hd0) /dev/sde
(hd1) /dev/sda
(hd2) /dev/sdb
(hd3) /dev/sdc
(hd4) /dev/sdd
(hd5) /dev/sdf


saikee 05-29-2008 11:31 AM

The device map is accurate at the time when the Linux installer install Grub. If the disk order has been altered subsequently then the device.map can be out of date.

The interrogation with a Grub shell is the disk order as seen by Grub at the time the commands are issured.

If the OP has not altered the disk order or added or withdrawed the hard disks then the device.map would be current.

jiml8 05-29-2008 01:04 PM

If the device.map is out of date, the system often won't boot - or a multiboot system that uses different hard drives may fail to boot some of the alternate choices.

saikee 05-29-2008 05:30 PM

I often write my own menu.lst and never bother with the device.map myself. Thus I don't think it matters. Grub only cares about the instructions in menu.lst (or grub.conf if it is a Red Hat).

Whenever I put Grub into a data-only partition or a USB drive I use only two files; stage1 and stage2. That is all one needs to boot "any" PC system manually. The menu.lst is just a script file.

Kiwi944 05-30-2008 04:46 PM

Hello all


Thank you all for your help this far I have been able to confirm the list of devices and also what the grub line should read. However I have one last issue.
This will sound stupid but can someone please advise on how to enter the information? I seem to be limited by permissions when opening the menu.lst with a notepad?

thanks again to everyone for your help and assistance on this.

Larry Webb 05-30-2008 05:13 PM

I am jumping in because saikee and jiml8 are probably asleep. As far as I know all linux distros come with command line text editor vi and most come with at least one GUI which I do not know which one ubuntu uses. But in terminal as root when you get to the file you want to open

# vi /mnt/hd??/boot/grub/menu.lst

In other words just name your text editor and put the path behind and when you hit enter it should open the text editor and give you two options to either 'open a new session' or 'open default' which will open your path if your path is correct. If everything works out on your first try do not forget to write and save before ending the session.

Kiwi944 05-30-2008 05:33 PM

Hello All please ignore my last post, I have find out how to correctly enter information into menu.lst and have one last questions on this. Looking at the list below from "geometry (hdx)" I thought that (hd2,0) was the windows particition however when I entered the information into menu.lst I see the listed on reboot and when I select it I get a the words "starting up" but nothing happens.

could someone please help on advising what I have done wrong?

Code:

grub> geometry (hd0)
drive 0x80: C/H/S = 2434/255/63, The number of sectors = 39102336, /dev/sda
  Partition num: 0,  Filesystem type unknown, partition type 0x7
  Partition num: 4,  Filesystem type is ext2fs, partition type 0x83
  Partition num: 5,  Filesystem type unknown, partition type 0x82

grub> geometry (hd1)
drive 0x81: C/H/S = 9729/255/63, The number of sectors = 156301488, /dev/sdb
  Partition num: 0,  Filesystem type unknown, partition type 0x42

grub> geometry (hd2)
drive 0x82: C/H/S = 9729/255/63, The number of sectors = 156301488, /dev/sdc
  Partition num: 0,  Filesystem type unknown, partition type 0x7
  Partition num: 4,  Filesystem type unknown, partition type 0x7

grub> geometry (hd3)
drive 0x83: C/H/S = 60801/255/63, The number of sectors = 976773168, /dev/sdd
  Partition num: 4,  Filesystem type unknown, partition type 0x7

grub>


saikee 05-31-2008 07:46 AM

Your Grub has reported the same partition layout as Ubuntu Linix. As I predicted (hd0,0) and (hd2,0) are the most likely partitions with XP or its boot loader NTLDR because these two partitions have been marked "active" and bootable by any MS MBR, which is the first sector of a boot loader from Dos to Vista.

When a MS Windows is installed its installer tends to install the boot loader into the first partition, that it recognises (or supports) in the detection queue. Thus if (hd0,0) existed when you installed XP then its boot loader would be in (hd0,0) and the XP proper in the next free unallocated space likely to be (hd2,0).

Unless you have altered the disk booting sequence therefore your XP should boot by these commands
Code:

title XP installed in (hd2,0) with boot loader in (hd0,0)
root (hd0,0)
chainloader +1

I have omitted the command "makeactive" here because (hd0,0) is already active and there is no other system compteing with the bootable flag with it.

If you still have a problem then post here the file /boot/grub/menu.lst

You can edit /boot/grub/menu.lst as an ordinary user by command
Code:

sudo gedit /boot/grub/menu.lst

Kiwi944 05-31-2008 05:40 PM

Saikee & Larry Webb Thank you for your help here I will make these changes to the Grub as suggested.

Regards
Al

james2b 05-31-2008 08:58 PM

sudo gedit /boot/grub/menu.lst (typed in a terminal window) You need to have root edit privillages, so this will allow you to edit it in Ubuntu. And be sure to click the save button too before exit the file.


All times are GMT -5. The time now is 10:21 PM.