Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Install grub 'easily' during initial install
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 19 Dec 2012
Posts: 71

PostPosted: Thu Dec 27, 2012 11:06 pm    Post subject: Install grub 'easily' during initial install Reply with quote

Disclaimer: I'm a newbie but I've tried this method and it's worked well for me. I highly recommend you read this guide to decide if this tip is appropriate for your situation:

* Edit - the grub2 install steps have been changed! *

I can vouch for myself that this method works for me when I followed the Gentoo Handbook on an x86 install iso:

Whilst doing your initial install and having reached the step where you're going to install the bootloader:

Instead of installing grub and trying to figure out where you installed the kernel and where all the other kernels are located on your drive, we'll skip past this step and install grub2 and all this will be automagically done for us; no stress. :D

We want grub2 to be able to find multiple OS's so we need to add this line to /etc/portage/make.conf :
GRUB_PLATFORMS="pc multiboot"

We'll add a few useful flags as they are not included by default:
echo "sys-boot/grub mount device-mapper" >> /etc/portage/package.use

Now we can install grub2:
emerge --ask sys-boot/grub:2

In order for grub2 to be able to locate other OS's in your system we need to install os-prober:
emerge --ask sys-boot/os-prober

To install grubby to BOIS we'll need to mount our boot partition:
# mount /boot
# grub2-install /dev/sda

This is where magic happens:
# grub2-mkconfig -o /boot/grub2/grub.cfg

If you are upgrading from Grub Legacy then you can delete the old grub files:
rm -rf /boot/grub/

Continue on with step '10.d. Rebooting the System':

Enjoy! :)

* EDIT - Additional Information *

But I want to add KMS (kernel modes setting), how do I do it?

Edit your grub2 file:
nano /etc/default/grub

.. and simply add your KMS parameters to this line:

My parameters are i915.modeset=1, so mine looks like this:

Now we'll update grubbers so this information sticks:
grub2-mkconfig -o /boot/grub2/grub.cfg

Next reboot your KMS parameters will be executed. No more manually entering them each time you boot up.

I've just changed my kernel. How do I update grub2 so it can find the new kernel?

After you've made the appropriate changes to the kernels, just run this command to update grub:

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

During bootup I have an error concerning 'Device Mapper Support'. What can I do to fix this?

You need to make sure that you've enabled 'device mapper support' in your kernel. Sorry, but you'll need to edit your .config to include these drivers and recompile your kernel:

Device Drivers -->
- Multiple devices driver support (RAID and LVM)
[ x ] Device mapper support
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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