# Newbie Gentoo + Ubuntu

## piranha60565

I am very new to linux so please be easy on me.  I have searched everywhere for my answer but I haven't been able to find what I am looking for.  I just got done with gentoo/samba server installation.  When partitioning the HD I saved about half of the disk for an ubuntu partition (mostly for media), when I installed ubuntu all of a sudden I cannot boot into gentoo.  I have been playing around with the grub configurations and cannot figure out what is wrong.  It tells me "You need to load the kernel first" but still doesn't work after I correct all of the information in the grub file.

I was hoping some of you veterans have come across this before or someone can direct me to some elusive thread/web page that can tell me the info I am looking for.

Ubuntu 10.4

Gentoo kernel 2.6.35

----------

## cwr

I've booted Ubuntu from Gentoo, and Gentoo from Ubuntu, so it's possible.   Ubuntu seems

to have developed a nasty habit of overwriting stuff it doesn't understand, but I doubt that's

the problem with a simple install.

Which version of Grub is Gentoo using, and is it the same version as Ubuntu?   If you are booting

first into Ubuntu's Grub2 menu, and then try booting a Gentoo which expects Grub 0.97, that

would probably cause problems.

I'd try and get one system working, then tinker - as a last resort, boot a System Rescue CD

and re-install Grub the same way you originally did for Gentoo, and work from there.

Good luck - Will

----------

## idella4

This shouldn't take long.

 *Quote:*   

> 
> 
> "You need to load the kernel first" 
> 
> 

 

says your line in grub is simply not pointing at the kernel.  It's pointing at something, not the kernel.  A simple . or such will make a syntax error.

Post your grub entry, the whole entry, for gentoo, from {menuentry  to }

cwr

seems to think you can't boot into either, I think you can still boot into ubuntu lucid.  Please make clear.

This will be fixed in a flash.

----------

## piranha60565

 *idella4 wrote:*   

> This shouldn't take long.
> 
>  *Quote:*   
> 
> "You need to load the kernel first" 
> ...

 

It was working fine before trying to install ubuntu.  Yes I can boot into ubuntu, just not gentoo anymore.  Will post grub info in a quick min.

----------

## piranha60565

I had tried to temporarily fix it and boot earlier so I will just post what it has by default.

insmod ext2

set root=(hd0,3)

search --no-floppy --fs-uuid --set 5a61c4ae-37a3-452c-9f54-76f35c17c549

linux /boot/boot/kernel-genkernel-x86-2.6.35-gentoo-r12 root=/dev/ram0 real_root=/dev/sda3

initrd /boot/boot/initramfs-genkernel-x86-2.6.35-gentoo-r12

Thanks again for the help, I usually try to bother people at work about this stuff (because I know my n00bness) but I am working alone tonight

----------

## idella4

piranha60565

Note

```

menuentry "Gentoo Base System release 1.12.13 kernel-2.6.36 (on /dev/sda6)" {

        insmod ext2

        set root=(hd0,5)

        search --no-floppy --fs-uuid --set f1081c4d-cabb-44ce-9717-a09ad11315f9

        linux /boot/kernel-2.6.36 root=/dev/sda6 ro crashkernel=8M@16M console=tty0 resume=swap:/dev/sda7 fbcon=font:VGA10x18 fbcon=scrollback:16[2]

}

```

 set root=(hd0,5)

root=/dev/sda6

make your line read

set root=(hd0,2) 

and boot.  Supposedly your grub is reading whatever is in /boot in partition 4.  I must admit this puzzles me. I thought grub 2 changed convention to stating the partition in that line as the same number as the the partition  read by parted, but ...

 My grub is karmic's or lucid's, grub2.

As an adjunct, change your gentoo kernel name to vmlinuz-2.6.35-gentoo-r12, and run the grub updater script, whatever it's called.  In fact, going from mine, kernel-2.6.35-gentoo-r12 will suffice.  genkernel-x86- just confuses it.

If it finds the kernel name matching the pattern that is set, it should write a correct boot entry in grub.cfg

----------

## piranha60565

 *idella4 wrote:*   

> piranha60565
> 
> Note
> 
> ```
> ...

 

Not having much luck here.  Set the set root to (hd0,2) to no avail.  Still getting the same kernel error.  When you say change the name of my kernel do you mean in the ubuntu grub.cfg file?  I tried that and then ran the update script and still no luck, it just updated to the same wrong information...

When I do an cfdisk it isn't showing my 4th partition, which I find weird.  It shows 2 swap partitions 2 root and 1 boot (sda1).

----------

## idella4

Hmmm, odd,  cwr  must have a point with  *Quote:*   

> Ubuntu seems
> 
> to have developed a nasty habit of overwriting stuff it doesn't understand,

 

My ubutntus do the right thing.

ok, chroot into your gentoo and show me it's there and hasn't been obliterated or just mount it within ubuntu.  I want to see like

```

genny linux-2.6.34-hardened-r6 # ls /mnt/gentoo64/boot

System.map-2.6.30-gentoo-r8-amd64       initrd.img-2.6.30-gentoo-r8-amd64

System.map-2.6.31-r6-gentoo             initrd.img-2.6.31-gentoo-r6-amd64

System.map-2.6.31-xen-gentoo-r10-AMD64  initrd.img-2.6.31.13-xen-amd64

System.map-2.6.31.13-xen                initrd.img-2.6.31.13-xen-amd64-domU

System.map-2.6.31.13-xen-domU           initrd.img-2.6.31.13-xenU-amd64

System.map-2.6.31.6-xenU                initrd.img-2.6.31.14-xen-amd64

System.map-2.6.32-xen-gentoo-r1-AMD64   initrd.img-2.6.31.6-xenU

```

Also,

```
 

genny linux-2.6.34-hardened-r6 # fdisk /dev/sda 

Command (m for help): p

```

Let's see just what the partition state is.    What should partition 4 be?

This info makes it appear the has been some interference with your drive state and you have developed a legitimate problem, but let's see.

----------

## piranha60565

Immediately when mounting /dev/sda1 /mnt/gentoo/boot I get  a warning that says EXT2-fs (sda1): unchecked FS, running e2fsck is recommended. And sure enough when I try to list the contents it says "no file or directory found".  Partition 4 is showing as extended and starts at the same place as partition 5....  So time to start over?  :Sad: 

----------

## idella4

piranha60565,

sorry to hear, but it adds up.  post again to tell it's resumed in a healthy state.

----------

## Jaglover

Extended partition is the place for logical partitions, nothing wrong with that. I'd recommend you keep it simple and put your Gentoo kernel on same /boot where Ubuntu kernel is.

----------

