Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 and multiple kernels - how? MISSING OPERATING SYSTEM
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
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 460
Location: Switzerland

PostPosted: Fri Apr 18, 2014 12:20 pm    Post subject: GRUB2 and multiple kernels - how? MISSING OPERATING SYSTEM Reply with quote

Hi

I have a running version of gentoo-3.10.7 on sda:
sda1: boot
sda2: swap
sda3: root

For this kernel i modified the GRUB_CMD_LINUX entry in /etc/default/grub:
GRUB_CMDLINE_LINUX="resume=/dev/sda3 root=/dev/sda4"
[/code]
This kernel i can boot with grub2.[code]

Now I have built a second kernel (3.12.13) with genkernel, and saved kernel, intramfs and System.map on sda1.
But the root for this kernel is on sdc4.

Now the 3.12.13 kernel will have different kernel options ( e.g. root ) than the 3.10.7 kernel.

In /etc/default/grub i don't see how i can specify a different set of kernel options
since there is only one "GRUB_CMDLINE_LINUX"

Can anybody tell me how i can install my second kernel?

Thank You
Jody


Last edited by jody on Fri Apr 18, 2014 10:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 768
Location: Germany

PostPosted: Fri Apr 18, 2014 12:32 pm    Post subject: Reply with quote

Did you have a look here? http://wiki.gentoo.org/wiki/GRUB2
Paragraph about chainloading has stuff you can probably use.
Or read this part of the manual: http://www.gnu.org/software/grub/manual/grub.html#Multi_002dboot-manual-config
I don't use Grub, so I can only point you to the information.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 460
Location: Switzerland

PostPosted: Fri Apr 18, 2014 1:51 pm    Post subject: Reply with quote

@Clad in Sky:
Thank you for your suggestions.
I had looked at the first you sent, but i have no idea if "chainloading an ISO" really is what i want to do...

So i think i'll have to go the manual way, though i don't know what is required to make everything boot correctly.
The GRUB manual section on manual configuration basically consists of an example with no explanation.
For example, the generated grub.cfg the entry for my current kernel contains lines ilke
Code:
   load_videoc
   set gfxpayload=keep
   insmod gzio
   insmod part_msdos
   insmod ext2

- are they vital? No such lines are shown in the example...

I tried to copy the current menuentry (from the generated grub.cfg) and reduce it unil it resembles the ones in the example.
and added a second copy adapted to my new kernel.
Code:
menuentry 'gentoo 3.10.7' {
   echo   'Loading Linux x86_64-3.10.7-gentoo-r1 ...'
   linux   /kernel-genkernel-x86_64-3.10.7-gentoo-r1 root=UUID=f829ffbf-767b-4a1e-ab9c-1a64625580fb ro splash resume=/dev/sda2
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-3.10.7-gentoo-r1
}

menuentry 'gentoo 3.12.13' {
   echo   'Loading Linux x86_64-3.12.13-gentoo ...'
   linux   /kernel-genkernel-x86_64-3.12.13-gentoo root=UUID=33727a03-4f3e-40b0-8c24-5dd0ff5fe565 ro splash resume=/dev/sdc3
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-3.12.13-gentoo
}

I checked the UUIDs with 'ls -l /dev/disk/by-uuid', and the kernels and initramfs are situated in /boot (=/dev/sda1)

Can anybody tell me if they look good or if they require some additions?
Thank You
Jody
Back to top
View user's profile Send private message
jfp
Apprentice
Apprentice


Joined: 08 Jul 2007
Posts: 275
Location: Virginia, USA

PostPosted: Fri Apr 18, 2014 2:44 pm    Post subject: Reply with quote

I am not sure if this will help or not...
It is possible to compile the kernel command line options into the kernel itself. Look under the "Processor type and features".
You can also look in "Power management and ACPI options", where there a means of specifying the default resume partition.
I don't use suspend/resume myself, so I don't know if these ideas will work for you. What I do know is that directly modifying /boot/grub/grub.cfg is not good because it will get regenerated every time you run grub2-mkconfig.
_________________
jfp
Back to top
View user's profile Send private message
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 460
Location: Switzerland

PostPosted: Fri Apr 18, 2014 10:43 pm    Post subject: Missing operating system Reply with quote

I really messed up something!

After making a backup copy of the currently working grub.cfg,
I manually created a grub.cfg as shown in the previous post and rebooted.
Nothing happened except for the line:
Code:
Missing operating system


I booted with a livecd and copied my backup of the original to grub.cfg and reboooted:
Code:
Missing operating system


I booted with a livecd, removed kernel, intramfs and System.map of gentoo-12-13,
did a
grub2-mkconfig -o /boot/grub/grub.cfg
and rebooted:
Code:
Missing operating system


I booted with a livecd, chrooted on /dev/sda3 (with all necessary mounts)
rebuilt the kernel 3.10.7, reemerged grub2, installed it on /dev/sda,
and ran grub2-mkconfig again, unmounted everything and rebooted:
Code:
Missing operating system

I don't know what to do anymore...

Any suggestions on how to repair this?
I would be very thankful for any help in getting back a working system!
Jody
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