LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2009, 08:18 PM   #1
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Rep: Reputation: 32
Dual booting with grub


Hello, I recently had to replace my hard drive controller and reinstalled Centos on one hard drive with windows 2000 on a separate drive. All drives are of type IDE. Windows is on the slave and Centos on master drive.

here is what fdisk -l shows;

Quote:

Disk /dev/hda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 12430 99843943+ 83 Linux
/dev/hda2 12431 13067 5116702+ 82 Linux swap / Solaris
/dev/hda3 13068 15617 20482875 83 Linux

Disk /dev/hdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 8924 71681998+ 7 HPFS/NTFS
/dev/hdb2 8925 14945 48363682+ f W95 Ext'd (LBA)
/dev/hdb5 8925 14945 48363651 7 HPFS/NTFS
[root@siawash siawash]#

Here is my menu.lst file

Quote:

[root@siawash siawash]# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hda1
# initrd /boot/initrd-version.img
#boot=/dev/hda

default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu


title CentOS (2.6.18-128.4.1.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-128.4.1.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-128.4.1.el5.img

title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img


[root@siawash siawash]#
Would anyone be kind enough to show me a template to add windows into my menu.list

Would it be something like;

title Windows
root (hd1,1)
kernel (i don't know what to put here ) quiet
initrd (or what image to point it to )



Many thanks in advance

Last edited by siawash; 08-17-2009 at 08:25 PM.
 
Old 08-17-2009, 08:41 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Sure, look at the Grub Booting Tips in my signature. Basically you don't need the kernel or initrd lines, instead replacing it with chainloader +1. But you'll probably also have to use the map function because Windows needs to think it's on the 1st primary hard disk.
 
Old 08-18-2009, 05:55 PM   #3
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Hi, I solved the problem the hard way. I thought you would be interested in how I did it.

I added this to /grub/menu.lst

Quote:

root (hd1,1)
chainloader +1
boot
This did not seem to make any difference. The boot menu only offered Centos. Later I realized you have to hit enter on the menu to get another sub menu. But at the time I decided go by your post to change over the slave drive to one storing Centos and set up windows as the master drive.

This time I did not get Centos instead booting straight into windows. I disconnected the drive storing windows and booted back into centos. I modified menu.lst and changed over the drives root thus;

Quote:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd1,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdb1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
hiddenmenu

title CentOS (2.6.18-128.4.1.el5)
root (hd1,0)
kernel /boot/vmlinuz-2.6.18-128.4.1.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-128.4.1.el5.img

title CentOS (2.6.18-92.el5)
root (hd1,0)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img

title Windows 2000
rootnoverify (hd0,0)
chainloader +1
This works but if I want to boot into windows I have to hit enter on the main centos menu and get a sub-menu. BTW i know how to map lilo but not grub. I thought grub does not need to be remapped manually.

BTW when I was installing Centos I got an option to configure grub which offered an option to add a second OS. Unlike other linux distros such as Debian, it could not see Windows on second drive. There was an option to add. But when i used this option and selected the second drive I would get a error message saying;

Quote:

This device is already being used for another boot entry

Last edited by siawash; 08-18-2009 at 06:14 PM.
 
Old 08-18-2009, 06:15 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
I don't think the map is for grub's benefit, but for Windows.
 
Old 08-19-2009, 06:41 AM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
saiwash, I think you should have made your windows entry with the

rootnoverify (hd1,0)
chainloader +1

You had windows on the second hd and in the first partition.

You would not have to use the map signals seeing windows was in the first partition of the drive.
 
Old 08-19-2009, 08:03 AM   #6
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Hi again, I am experiencing a similar problem on a second machine. This one has vista and OpenSUSE on same hard drive. This is one of those cheap laptops that comes with vista without CD's. The OS is stored on specific partition which if i mess with voids warranty. I kept getting missing bootloader. So i reinstalled OpenSUSE.

This is results of fdisk -l



Quote:

eugene@linux-1mth:~> sudo /sbin/fdisk -l
root's password:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x294599de

Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 12 Compaq diagnostics
/dev/sda2 1403 15918 116592640 7 HPFS/NTFS
/dev/sda3 15919 16403 3895762+ 82 Linux swap / Solaris
/dev/sda4 * 16404 30401 112438935 f W95 Ext'd (LBA)
/dev/sda5 16404 19014 20972826 83 Linux
/dev/sda6 19015 30401 91466046 83 Linux
eugene@linux-1mth:~>
This is menu list

Quote:

# Modified by YaST2. Last modification on Wed Aug 19 12:21:06 IST 2009
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,4)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1
root (hd0,4)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_080401BB6F00WDJ07H1F-part5 resume=/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_080401BB6F00WDJ07H1F-part3 splash=silent showopts vga=0x317
initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: Vendor diagnostic###
title Vendor diagnostic
rootnoverify (hd0,4)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
"/boot/grub/menu.lst" 28L, 1262C 16,23 Top


According to fdisk I think grub is point to the correct partition without any joy. Can anyone help?
 
Old 08-19-2009, 02:29 PM   #7
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
title Windows
rootnoverify (hd0,1)
chainloader +1
 
  


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
dual booting with grub L_Jenkins Linux - Newbie 8 02-04-2007 11:58 AM
GRUB help with dual booting kev19 Linux - Newbie 17 12-21-2005 03:26 AM
Dual-booting using grub damasta55r Linux - Newbie 13 11-20-2005 08:02 AM
Dual booting and GRUB jfrye Linux - Newbie 1 10-09-2003 10:48 AM
GRUB, and dual booting sammyballz Linux - General 9 10-14-2002 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration