Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ubuntu Grub dual boot problems with Windows 1

Status
Not open for further replies.

smeyer56

IS-IT--Management
Oct 16, 2002
206
US
I have Windows 2000 installed on a sata drive. I unplugged that drive and install Ubuntu 7.04 on an IDE drive(hd0). I want to dual boot from grub if possible and boot.ini if necessary.

I have tried suggestions from many sites and it is currently set at:
Title windows2000
rootnoverify (hd1,0)
map(hd1)(hd0)
map(hd0)(hd1)
makeactive
chainloader +1

no matter what I try I get errors.

Is there something I am missing?
I am wondering if the IDE/SATA combo is causing problems.
 
SATA takes precedence over IDE in the boot order. Try to set the SATA to where it will not boot.


"We must fall back upon the old axiom that when all other contingencies fail, whatever remains, however improbable, must be the truth." - Sherlock Holmes

 
When you unplug and reconnect drives like this, their
GRUB-drivenumber changes.
With only the IDE-drive connected, it would be named (hd0),
(this is where you installed Ubuntu and GRUB)
when you reconnected the SATA-drive, that would become (hd0),
and the IDE would change to (hd1).
This is though deppended on BIOS settings I think...
TRy this:
1- Install GRUB on the SATA-drive: grub-install '(hd0)'
2- Point the "Title Windows" to the (hd0)-drive.
rootnoverify (hd0) , use (hd0,0) if you have partitions on the drive. (drop the MAP-commands)
3- Point the "Title Ubuntu" to the (hd1)-drive.
4- Fould your hands, pray.... Reboot.

 
I think it makes sense that the SATA takes precedence and that would sort of make sense except for one thing. If I unplug the W2K drive and boot to Linux(hd0?) through Grub it works fine. Then plugging in the W2K(SATA) drive and boot also brings up Grub and boot fine to Linux(hd1 now?) with no changes.

It is only after disconnecting the Linux drive on boot that it will boot to W2K, and it will keep booting there until I disconnect the drive again.

This maybe a simple question but I am fairly new to Linux, is there a way to show what the hard drives are listed as in linux and how they are partitioned besides during the initial setup?
 
cat /boot/grub/device.map will show the mapping
between GRUB device-numbering and Linux device names.

sudo fdisk -l should show partitions on all drives connected.
 
BTW, what do you meen with "disconnecting the Linux drive on boot"???
Do you have hotswap drives?

 
Sorry, I just reread that and it didn't make sense.
I am using Linux a majority of the time, booting to it through Grub. Occasionally, I need to use W2K and I will unplug the Linux drive in order to boot directly to W2K.

In order to boot to Linux again, I unplug the W2K drive and reconnect the power to the Linux drive. Then, if I need to access the Windows drive in Linux, I will power the computer down, plug in the Windows drive and turn on the computer. The system boots to Linux through grub and I can now access the Windows drive in Linux. This is what I am trying to avoid by dual booting in grub but am having major problems getting it to work.

Hope this helps.
 
Can you show us the output of:
cat /boot/grub/device.map

sudo fdisk -l
and
grep -v '^#' /boot/grub/menu.lst

when both drives are connected and booted into Linux?
 
cat /boot/grub/device.map
(hd0) /dev/hda

sudo fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3187 25599546 7 HPFS/NTFS
/dev/sda2 3188 30400 218588422+ f W95 Ext'd (LBA)
/dev/sda5 3188 26134 184321746 7 HPFS/NTFS

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 23967 192514896 83 Linux
/dev/hda2 23968 24321 2843505 5 Extended
/dev/hda5 23968 24321 2843473+ 82 Linux swap / Solaris

grep -v '^#' /boot/grub/menu.lst
title Ubuntu, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=145cbc70-3a15-4509-91f3-cce6cbdcee54 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=145cbc70-3a15-4509-91f3-cce6cbdcee54 ro single
initrd /boot/initrd.img-2.6.20-16-generic


title Windows 2000 Professional
rootnoverify (hd1,0)
map(hd1)(hd0)
map(hd0)(hd1)
makeactive
chainloader +1
 
Edit your device.map file with:
gksudo gedit /boot/grub/device.map
and add this line:
(hd1) /dev/sda

Then reinstall GRUB like this:
sudo grub-install '(hd0)'

Now GRUB should be able to find /dev/sda (and Windows) on bootup.

 
geirendre,
adding the line to the device map worked! I can now dual boot to both systems like I wanted to.

Thanks a million!
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top