Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub from existing linux during gentoo instalation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
otaviolb
n00b
n00b


Joined: 28 Nov 2014
Posts: 3

PostPosted: Fri Nov 28, 2014 6:58 pm    Post subject: Grub from existing linux during gentoo instalation Reply with quote

Short description
Problem: After installing gentoo base system, grub2 does not show up gentoo entry during boot.
grub2 shows options for already installed opensuse and windows 7


Long description
There are two HDDs. Let's forget about /dev/sdb, where MSwindows7 is.
/dev/sda is patitioned as shown below
Code:

$parted /dev/sda print
Model: ATA ST1000DM003-1ER1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB                  grub    bios_grub
 2      3146kB  137MB   134MB   ext2            boot                               (ext2)
 3      137MB   2235MB  2097MB  linux-swap(v1)  swap
 4      2235MB  23.2GB  21.0GB  ext4            linux1                            (ext4) --> This for gentoo
 5      23.2GB  44.2GB  21.0GB  ext4            linux2                             (ext4) --> This for opensuse 13.1
 6      44.2GB  149GB   105GB   ext4            homefs                          (ext4) --> This for home
 7      149GB   1000GB  851GB   ext4            datafs                           (ext4) --> This for data, mounted in /mnt/data, supposed to be accessed both from gentoo and opensuse

Gentoo base system is apparently done. I could chroot in and emerge packages.

During installation, I skipped this command:
Code:

$ grub2-install /dev/sda

because I /dev/sda already had a boot loader from opensuse. Please, tell me whether I messed things up here.

The command
Code:

$grub2-mkconfig -o /boot/grub/grub.cfg

recognizes the gentoo kernel

Kernel was compiled by
Code:

$genkernel --disklabel all


I also tried to compile from myself. Thee result is
Code:

$ls -l /boot
total 92385
-rw-r--r-- 1 root root  2682045 Jul 22 12:59 System.map-3.11.10-21-desktop
-rw-r--r-- 1 root root  2697475 Nov  1  2013 System.map-3.11.6-4-desktop
-rw-r--r-- 1 root root  2169242 Nov 24 08:48 System.map-genkernel-x86_64-3.16.5-gentoo
-rw-r--r-- 1 root root  2164155 Nov 25 18:52 System.map-x86_64-3.16.5-otavio
-rw-r--r-- 1 root root      512 Nov  7 15:48 backup_mbr
lrwxrwxrwx 1 root root        1 Nov  7 15:46 boot -> .
-rw-r--r-- 1 root root     1484 Oct 18  2013 boot.readme
-rw-r--r-- 1 root root   141138 Jul 22 12:17 config-3.11.10-21-desktop
-rw-r--r-- 1 root root   140360 Nov  1  2013 config-3.11.6-4-desktop
drwxr-xr-x 2 root root     1024 Nov 26 20:19 grub
drwxr-xr-x 7 root root     1024 Nov 11 17:25 grub2
-rw-r--r-- 1 root root  3547192 Nov 25 09:23 initramfs-genkernel-x86_64-3.16.5-gentoo
-rw-r--r-- 1 root root  3547192 Nov 26 20:17 initramfs-x86_64-3.16.5-otavio
lrwxrwxrwx 1 root root       25 Nov 11 17:25 initrd -> initrd-3.11.10-21-desktop
-rw------- 1 root root 23043626 Nov 11 17:25 initrd-3.11.10-21-desktop
-rw------- 1 root root 23044038 Nov 11 17:25 initrd-3.11.6-4-desktop
-rw-r--r-- 1 root root  3679872 Nov 24 08:48 kernel-genkernel-x86_64-3.16.5-gentoo
-rw-r--r-- 1 root root  3666016 Nov 25 18:50 kernel-x86_64-3.16.5-otavio
drwx------ 2 root root    12288 Nov  7 15:41 lost+found
-rw-r--r-- 1 root root   620544 Nov  6  2013 message
-rw-r--r-- 1 root root   262916 Jul 22 13:08 symvers-3.11.10-21-desktop.gz
-rw-r--r-- 1 root root   261933 Nov  1  2013 symvers-3.11.6-4-desktop.gz
-rw-r--r-- 1 root root      516 Jul 22 13:08 sysctl.conf-3.11.10-21-desktop
-rw-r--r-- 1 root root      516 Nov  1  2013 sysctl.conf-3.11.6-4-desktop
-rw-r--r-- 1 root root  6044086 Jul 22 13:08 vmlinux-3.11.10-21-desktop.gz
-rw-r--r-- 1 root root  6075542 Nov  1  2013 vmlinux-3.11.6-4-desktop.gz
lrwxrwxrwx 1 root root       26 Nov  8 10:42 vmlinuz -> vmlinuz-3.11.10-21-desktop
-rw-r--r-- 1 root root  5183048 Jul 22 14:55 vmlinuz-3.11.10-21-desktop
-rw-r--r-- 1 root root  5210216 Nov  1  2013 vmlinuz-3.11.6-4-desktop

I do not know how to generate a initamfs apart from using $genkernel --disklabel iniramfs
So I copied
Code:

$cp /boot/initramfs-genkernel-x86_64-3.16.5-gentoo /boot/System.map-x86_64-3.16.5-otavio

I exited from rooted terminal, umounted file systems and rebooted.

During boot, my options are opensuse and windows. No gentoo :-(

Where do I fail?

Thank you.
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1358

PostPosted: Fri Nov 28, 2014 8:21 pm    Post subject: Reply with quote

otaviolb wrote:
The command
Código:

$grub2-mkconfig -o /boot/grub/grub.cfg

recognizes the gentoo kernel
When you are doing this has your partiton mounted?
Code:
mount | grep boot
Back to top
View user's profile Send private message
otaviolb
n00b
n00b


Joined: 28 Nov 2014
Posts: 3

PostPosted: Fri Nov 28, 2014 8:29 pm    Post subject: Reply with quote

Yes, it was mounted.

The proof is that the gentoo kernel, initramfs and[/code] system.map are seen even from opensuse terminal. /boot is to be shared by both systems.
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1358

PostPosted: Fri Nov 28, 2014 9:31 pm    Post subject: Reply with quote

Maybe grub installed from opensuse is looking grub.cfg in grub2/ directory. Try that:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
Back to top
View user's profile Send private message
otaviolb
n00b
n00b


Joined: 28 Nov 2014
Posts: 3

PostPosted: Mon Dec 01, 2014 2:03 pm    Post subject: Reply with quote

Thank you quilosaq for the advice. You find where the problem is.

I configured grub both from opensuse and from chrroted gentoo as you proposed:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
Here are the results:


1) From opensuse
Grub lists all entries: windows, opensuse and gentoo
Windows 7 loads normally
Both opensuse and gentoo do not load

Error: Panic kernel: VFS Unable to moount root fs or unknown block(0,0)

After boot with a live CD I restored /boot/grub2/grun.cfg from a backup so that I could boot as earlier.


2) From gentoo
By "from gentoo" I mean I run opensuse and chrooted in gentoo as described in gentoo documentation.

Grub lists entries for windows and gentoo
No entry for opensuse is listed.
Windows 7 loads normally
Gentoo does not load
Same error: Panic kernel: VFS Unable to moount root fs or unknown block(0,0)

Back to live CD to restore /boot/grub2/grun.cfg.
Back to top
View user's profile Send private message
Kidov
n00b
n00b


Joined: 20 Jul 2006
Posts: 56
Location: Finland

PostPosted: Tue Dec 02, 2014 2:34 pm    Post subject: Reply with quote

otaviolb wrote:


Error: Panic kernel: VFS Unable to moount root fs or unknown block(0,0)

That kernel panic message tells that you may have misconfigured your grub. Grub might be loading gentoo root partition from a wrong location. Other thing that comes to my mind is wrong kernel settings. Correct sata drivers needs to be compiled in to the kernel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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