Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dual boot Gentoo with Kubuntu
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 2:08 pm    Post subject: [SOLVED] dual boot Gentoo with Kubuntu Reply with quote

I partitioned my laptop hard drive into 3 primary partitions, sda1 for boot, sda2 for swap, sda3 for Gentoo root, and successfully installed Gentoo. Then I made an extended partition (sda4) and a logical partition (sda5), on which I installed Kubuntu, and logical partitions sda6 and sda7, on one of which I installed Ubuntu. The Kubuntu and Ubuntu installations were for testing Desktop color management in KDE and Gnome.

The Gentoo installation is just fine and the Kubuntu installation was and also probably still is just fine. However, when installing Ubuntu, I thought I was choosing a bog-standard Gnome Desktop, but what I got was Unity. I used Synaptic to get rid of Unity/Ubuntu One/etc, the net result was that the Ubuntu installation wouldn't boot (pretend there are some very bad words here that express my feelings about Unity).

To completely get rid of Ubuntu/Unity, I booted into Gentoo and used fdisk to remove sda6 and sda7. Still using Gentoo, I re-emerged Grub, which only finds the Gentoo installation, and restarted Gentoo. Then I mounted /dev/sda5 (the Kubuntu installation partition) on /mnt/sda5tmp and cd'ed to /mnt/sda5tmp/boot, where there is a text file called "grub.cfg". Reading through the Kubuntu grub.cfg, the first "menuentry" has several lines. Probably the relevant lines are:

linux /boot/vmlinuz-3.5.0-26-generic root=UUID=[long number] ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-26-generic

I *think* that to be able to boot into Kubuntu, I should copy "some file" from the Kubuntu /boot folder (on /dev/sda5) to the Gentoo /boot folder (on /dev/sda1). Probably that "some file" is either "vmlinuz-3.5.0-26-generic" or "initrd.img-3.5.0-26-generic". I *think* I also need to modify Gentoo's /boot/grub/grub.conf. But I'm leery of proceeding without a little hand-holding and advice, for fear I might not be able to boot into Gentoo when I'm done. Is it possible to/how do I convince the Gentoo boot loader (correct terminology?) to show and allow booting into the Kubuntu installation?

Elle


Last edited by ElleStone on Fri Mar 29, 2013 3:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Mar 28, 2013 3:18 pm    Post subject: Reply with quote

1. emerge os-prober
2. mount Kubuntu partition
3. run grub-install and grub-mkconfig

all these steps should be done from Gentoo (not from Kubuntu).
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 4:24 pm    Post subject: Reply with quote

Hi creaker, thank you very much for replying. I did steps 1 and 2. However, I wasn't able to figure out step 3. I typed "grub-install" at the command line but it wants at least a device and possible some options. So I typed "grub-install /dev/sda" as per the Gentoo installation guide. Then I typed "grub-mkconfig". The only thing that happened is there was a ">" on the screen that looked like it was waiting for input, along with some remarks about tabbing to complete input.

I tried editing grub.conf manually and the new entry did show up when I rebooted the laptop, but I don't know what to type in grub.conf, and my random guesses didn't work. So of course Gentoo booted but Kubuntu didn't.

I commented out the new lines in grub.conf, restarted the laptop, and tried to follow your three steps again (after some internet research to see if I could find more information about grub-install). Alas, no luck. And for some reason, now when I type grub-mkconfig, the terminal responds "-bash: grub-mkconfig: command not found". More internet research, but I still couldn't find an answer.

Sorry!

Elle
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Mar 28, 2013 4:48 pm    Post subject: Reply with quote

What Grub have you installed? Is it Grub-legacy (Grub v.1) or Grub2?
Since you have Grub installed but you got 'command not found' error I assuming that you have Grub2 installed.
This case it should be:

grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg

What Grub version you have installed exactly?
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 5:14 pm    Post subject: Reply with quote

I just installed Gentoo a couple of weeks ago, following the x86 Installation guide very closely, so whatever it says to install, that's what I installed. "emerge -pv grub" lists sys-boot/grub-0.97-r12. "emerge -pv grub2" says "no ebuilds" etc.

"Is /sbin" lists grub, grub-install, grub-md5-crypt, grub-set-default, grub-terminfo" but no grub-mkconfig.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Mar 28, 2013 5:19 pm    Post subject: Reply with quote

Sorry, all I've wrote above - for Grub2 only.
If you have grub-legacy (grub-1) check out this page: http://en.gentoo-wiki.com/wiki/Quick_GRUB
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 5:55 pm    Post subject: Reply with quote

Is there a way I can install grub2? Will it cause problems? Would it solve the problem?

I've read the documentation that you linked to already, several times over, and tried diligently to apply it. It gives Windows as an example of booting into another operating system, using chainloader. I vaguely recall doing this around 8 years ago. But I don't have any Windows on any of my machines anymore.

I found this page: https://bbs.archlinux.org/viewtopic.php?id=43134, which seems like a good example of what I'm trying to do.

I could reinstall Kubuntu, and that would give Kubuntu the task of displaying which installation to boot into. But I'd rather not do that as the Kubuntu installation is just a test installation and subject to being removed at whim. Gentoo is the installation that will remain on the laptop. There simply has to be a way to use Gentoo to boot into the Kubuntu installation. I could install Debian or Mint as my test Gnome installation, and that would pick up Gentoo and Kubuntu, but again, that would be a temporary installation. I'd rather learn how to let Gentoo handle all the booting.

I modified the Gentoo grub.conf to read as follows:

(first the gentoo entries, then)

title Kubuntu
root (hd0,4)
kernel /boot/vmlinuz-3.5.0-26-generic root=dev/sda5 ro
initrd /boot/initrd.img-3.5.0-26-generic

and upon restarting and choosing "Kubuntu" it does try to boot into Kubuntu, but then there is a kernel panic:
kernel panic - not syncing: attempted to kill init! exitcode=0x00000200
Pid: 1, comm: init Not tainted 3.5.0-26-generic #42-Ubuntu

Was directly modifying the grub.conf not a good idea? Are the lines not written correctly? Is there a way to use the chainloader?

Elle
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 7:20 pm    Post subject: Reply with quote

I found a way to log into the Kubuntu installation without having to reinstall Kubuntu, which was download and burn to a CD SuperGRUB2Disk (http://www.supergrubdisk.org/), boot from the CD, and choose Kubuntu. Oddly enough SuperGRUB2Disk doesn't even see the Gentoo installation. So I can boot to Gentoo by taking the CD out, and boot to Kubuntu by putting the CD back in. It's a workaround for the moment, but there has to be a Gentoo way to multi-boot various Linuxes on one machine. Perhaps I should try to figure out how to install grub2.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Mar 28, 2013 7:46 pm    Post subject: Reply with quote

You error message looks like something wrong with initrd. May be because you deleted sda6 and sda7 partitions, not sure.
If your Gentoo and Kubuntu are the same architecture (both x86 or both amd64), you can boot into Gentoo, mount Kubuntu partition and jump into Kubuntu environment (via chroot) and reinstall kubuntu's grub.

Also you can try to install Grub2 in Gentoo. In order to get ability to install Grub2, you should add this string into /etc/portage/package.accept_keywords file:
Code:
sys-boot/grub:2

and run emerge -av grub
It should install Grub2. After that you can run commands that I've written above.
May be you need to reinstall os-prober (not sure).
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Thu Mar 28, 2013 8:31 pm    Post subject: Reply with quote

creaker, thanks! I will try to install grub2 on Gentoo. As I'm currently logged into kubuntu via the SuperGRUB2Disk (which actually does detect Gentoo, it turns out, by detecting "legacy"), it looks like the kubuntu grub functions, but I'll try reinstalling grub while I have kubuntu up and running.
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Fri Mar 29, 2013 3:38 pm    Post subject: Reply with quote

Dual-booting/multi-booting - with Gentoo in charge of booting the system - turned out to be straightforward. I decided to not install grub2. Instead I kept the default Gentoo grub version 1 and rewrote the Kubuntu entry in /boot/grub/grub.conf to read as follows:

title Kubuntu
root (hd0,4)
chainloader +1

Then I reinstalled Ubuntu 12.10 to sda5, this time doing a minimal install (just the base system, in case I needed to start over again), and this time telling the net install CD ('expert mode' if anyone is trying to do the same - not sure what options are available using the other installation methods) to install grub2 to sda5 rather than sda. I wondered whether I should have made sda5 bootable , but it turns out that the boot flag doesn't need to be set on the installation partition. Once I booted into the minimal Ubuntu install, I installed Icewm (my preferred desktop) and Kubuntu from the command line.

The problem with my original attempt at rewriting Gentoo's grub.conf is that Ubuntu now uses grub2, plus I had told Ubuntu to write grub to sda (MBR?) rather than sda5. However, grub version 1 can't "start" (what's the right terminology?) grub2 directly. But it can "chainload" to just about anything. Which makes adding new *nixes to my laptop easy: just don't install the new *nix's grub? bootloader? (they are not quite the same thing?) to the MBR. Instead, install it to the installation partition, then add the appropriate new entry to Gentoo's grub.conf.

I used these references for using chainloader with grub.conf and grub version 1:
http://www.dedoimedo.com/computers/grub.html
http://forums.justlinux.com/showthread.php?143973-A-grub-menu-booting-100-systems-of-Dos-Windows-Linux-BSD-and-Solaris

This reference mentions using chainloader with grub2:
http://praveen.kumar.in/2010/02/20/chainloading-opensolaris-from-grub-2/

If creaker hadn't asked me which version of grub I was using, I probably never would have figured out how to, or even that I could, use chainloader. Linux keeps changing, but older documentation by definition doesn't mention newer stuff, and newer documentation often doesn't mention older stuff.

Elle
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum