Dual boot?

Gene Heskett gene.heskett at verizon.net
Mon Feb 16 02:06:18 UTC 2009


On Sunday 15 February 2009, Norberto Bensa wrote:
>On Sun, Feb 15, 2009 at 8:34 PM, Gene Heskett <gene.heskett at verizon.net> 
wrote:
>> On Sunday 15 February 2009, Norberto Bensa wrote:
>>>The first command sets the "root partition" (the one that has the boot
>>>sector the OS)
>>
>> I presume of the second os?  In which case
>
>There's no such thing as first, second, third, os. hdX,Y refers to the
>harddrive/partition.
>
>>>Keep in mind that (hd0,0) is just an example.
>>
>> Yuppers.  The current grub install is on the first sata drive which udev
>> marks as sdb, sda being a PATA drive,
>
>So your BIOS boots from sdb. Your kernel line should look like this:
>
>kernel (hd1,0)/vmlinuz blahblah...
>
>or
>
>root (hd1,0)
>kernel /vmlinuz blahblah...
>
>> # this device map was generated by anaconda
>> (hd0)     /dev/sdb
>> (hd1)     /dev/sdc
>
>Now you lost me. sda is PATA, sdb is SATA. What's sdc?
>
>Can you post the output of:
>
>$ sudo fdisk -l | grep ^/

[root at coyote ~]# fdisk -l | grep ^/
/dev/sda1   *           1        1340    10763518+  83  Linux
/dev/sda2            1341       19825   148480762+  83  Linux
/dev/sda3           19826       38913   153324360   83  Linux
This is an ASUS mobo, which allows me to reorder disk priorities, the above 
drive is a 320 GB PATA drive that had a few partitions of an F8 install but 
not the whole install.  It is in the machine mainly for config retrievals and 
is not normally mounted.

/dev/sdb1   *           1          25      200781   83  Linux
/dev/sdb2              26         547     4192965   82  Linux swap / Solaris
/dev/sdb3             548       60801   483990255   83  Linux
This is a 500GB Seacrate with my working f8 install on it.

/dev/sdc1               1          64      514048+  83  Linux
/dev/sdc2              65         586     4192965   82  Linux swap / Solaris
/dev/sdc3             587       48641   386001787+  83  Linux
This is a 400GB deathstar I just installed kubuntu-8.10 on disastrously.  More 
below.

/dev/sdd1   *           1      121601   976760001   83  Linux
This is a 1TB drive with all of amanda's virtual tapes on it.

>and:
>
>egrep ^root\|^kernel /boot/grub/menu.lst
[root at coyote ~]# egrep ^root\|^kernel /boot/grub/menu.lst
[root at coyote ~]# egrep ^root\|^kernel /boot/grub/grub.conf
[root at coyote ~]#
Nothing to see here.

IMPORTANT
Now, for grub purposes, skip the above /dev/sda and move the rest up one 
letter.  fdisk apparently scans the PATA bus first, so it enumerates them 
differently than they are seen by the rest of the system.

On the reboot after the install, grub gave an error 15.

I grabbed a centos5.2 disk and went into rescue mode.
Then using fdisk, I canceled the bootable flag for /dev/sdc (old numbers here)
didn't help. rebooted to the rescue mode again, and did a chroot 
on /mnt/sysimage after selecting what it called sda3, which is the F8 
install.

Looking at that /boot/grub, I saw that the kubuntu install had refreshed all 
the files there, instead of on /dev/sdb.  I mounted /dev/sdb1 and noted there 
was a skeleton set of grub files there also and I noted during the install 
preps that it also formatted the swap partition on /dev/sda, which I did not 
give it permission to do, but is NBD.

The device.map installed on /dev/sdb1/grub is nearly bogus, which accounts for 
the error 15 that grub was reporting.

(hd0)	/dev/sda
(hd1)	/dev/sdb
(hd2)	/dev/sdc
(hd3)	/dev/sdd

Anyway, I verified the device.map file on /dev/sda1
(hd0)     /dev/sda
(hd1)     /dev/sdb
as being correct, and did another 'grub-install /dev/sda', and it rebooted to 
F8 normally, which is where I am now.

Confusing ain't it...

And a lesson learned, remove any drives you don't want piddled with by the 
ubuntu installer, it doesn't take orders very well.

And it appears that I may need to add a stanza for each of the modes 
available.  The stanza I put in returns the error that the kernel must be 
loaded before it can be booted.

Now, I recall a couple of years ago that I did a similar setup, and when I 
selected the other install in the grub listing, that rather than directly 
booting, it did another grub menu for the other install, and in fact I had it 
set in that menu.lst so I could revert to the first menu also.

That is how I would like to do it here.  So what would a grub.conf/menu.lst 
entry look like that did this?

Here is the grub.conf/menu.lst as it exists on /dev/sda1grub/now.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sdb3
#          initrd /initrd-version.img
#boot=/dev/sdb
default=6
fallback=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
# 0
title Fedora (2.6.26.8-57.fc8)
        root (hd0,0)
        kernel /vmlinuz-2.6.26.8-57.fc8 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.26.8-57.fc8.img

# 1
title Fedora (2.6.26.6-49.fc8)
	root (hd0,0)
	kernel /vmlinuz-2.6.26.6-49.fc8 ro root=LABEL=/ rhgb quiet
	initrd /initrd-2.6.26.6-49.fc8.img
# 2
title fedora (2.6.28)
        root (hd0,0)
        kernel /vmlinuz-2.6.28 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.28.img

# 3
title fedora (2.6.28.2)
        root (hd0,0)
        kernel /vmlinuz-2.6.28.2 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.28.2.img

# 4
title fedora (2.6.28.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.28.3 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.28.3.img

# 5
title fedora (2.6.28.4)
        root (hd0,0)
        kernel /vmlinuz-2.6.28.4 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.28.4.img

# 6
title fedora (2.6.28.5)
        root (hd0,0)
        kernel /vmlinuz-2.6.28.5 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.28.5.img

# 7
title fedora (2.6.29-rc5)
	root (hd0,0)
	kernel /vmlinuz-2.6.29-rc5 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.29-rc5.img

# 8
title fedora (2.6.29-rc2)
        root (hd0,0)
        kernel /vmlinuz-2.6.29-rc2 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.29-rc2.img
# 9
title fedora (2.6.29-rc3)
        root (hd0,0)
        kernel /vmlinuz-2.6.29-rc3 ro root=LABEL=/ rhgb quiet nomodeset
        initrd /initrd-2.6.29-rc3.img
#10
title Kubuntu-8.10
	root (hd1,0)
	chainloader+1
	boot


Thanks Norberto

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Beware of a tall black man with one blond shoe.




More information about the kubuntu-users mailing list