HomePage > Components and HowTos > Booting > Boot Loaders

Grub 2 Made Easy


Grub2 is a Boot Loader. Most people in our freenode channel #puppylinux think that Grub 2 is confusing, and it can be. I tried for some time then gave up and continued booting from cd.

The information below was done using linux mint 10 and is a general guide. Most steps will be similar for other linux.

The first thing about grub 2 is that it can detect and auto generate menus for all os it detects. this can be good, it does have some drawbacks. For some os and os configurations it may use a generic name. My vista os was detected as "windows recovery environment". And it will not detect a puppy frugal install.

First you need to set up your puppy frugal install. Don't forget to save the extra files to make it boot faster when prompted to.

(As mint is built on ubuntu base here is a tutoral on grub 2 for ubuntu. **Click Here**)

If you want edit grub2 (the proper grub 2 way) then go to /etc/grub.d and editing the config files there. each file changes a different part of the boot loader. The main file you need to edit to add your custom files is 40_custom. To edit the default auto detected entries edit 10_linux.

You can also turn off the OS-Prober (OS-prober is the auto detect feature in grub 2). I have found this works and gives a more Grub feel but everything has to be done manually. (when you stop OS-Prober it is ok to change or remove unwanted auto detected entries from grub.cfg under #BEGIN /etc/grub.d/10_linux Remember to leave your os that the grub 2 is on). I also copied the original auto detected entries to 40_custom file so I could edit them there. saving time worrying how to format them.

In ubuntu based os go to the file /etc/default/grub.
uncomment (remove the # before the line) #GRUB_DISABLE_OS_PROBER=true (Enables/disables the os-prober check of other partitions for operating systems, including Windows, Linux, OSX and Hurd).

Now you need to go to /etc/grub.d/ (this is where you manually edit all your grub entries each filel edits a different part of /boot/grub/grub.cfg).

open 40_custom you will see Similar to this.

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

here are my custom entries. (note that the main entry for Mint 10 I left in grub.cfg this is needed encase you update the os changes). also after you have configured grub you need to run sudo sudo update-grub.

#windows Vista Partition /dev/sda1
menuentry "Vista" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set dcdc98a0dc98768c
drivemap -s (hd0) ${root}
chainloader +1
}

#linux mint 9 own grub on /dev/sda3
menuentry "Load Linux Mint 9's grub.cfg" {
search --set --fs-uuid a3ae7b78-414e-429c-89e0-8ba82c952877
configfile /boot/grub/grub.cfg
}

#linux mint Debian own grub on dev/sda5
menuentry "Load Linux Mint Debian's grub.cfg" {
search --set --fs-uuid 77419c15-6c3c-4e67-95f2-3d8588bb3613
configfile /boot/grub/grub.cfg
}



menuentry "Cloud Bible 3 (frugal on sda8)" {
set root='(hd0,7)'
linux /qrky-130/vmlinuz
initrd /qrky-130/initrd.gz
}

menuentry "quirky-130 (on /dev/sdc3)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set c87ab663-e503-4833-8b7c-f52a114f8ad0
linux /qrky-130/vmlinuz pdev1=sdc3 psubdir=quirky130
initrd /qrky-130/initrd.gz
}

Notice any entries beginning with # are ignored. its useful for infomation about each section or unused entries. to boot my other os i set up a link to there own grub menus for Mint 9 and Mint Debian. my puppy entries for quirky are booting frugal install on hdd and are there for an example you will have to tweak them for your own particular needs.

after you have edited 40_custom you will need to run update-grub in mint or so with grub 2.

you can also create a file called /boot/grub/custom.cfg and add your grub menu there. this file will be read by grub when booting and display that in the menu. (there is no need to edit 40_custom any more and you can edit this file from your puppy os and no need to boot into the main so with grub and run update-grub). i prefer this if i have puppy on hdd.

here are some other posts in forums that may be of interest.
Frugal Install and Grub 2
Frugal Install & GRUB 2 on Linux Mint (Ubuntu?)
grub.cfg is for grub2 (remember not to edit Grub.cfg manually).
How to set up grub 2 to boot Puppy frugal install

I hope this takes some confusion out of grub 2 for you all who have os that use it adn also puppy. have fun with grub 2
if only I had something ,like this when i started out trying to learn grub 2.

Important to Note

Also another thing you can do, you will not need to use 40-custom and run "sudo update-grub" (remember to still need to stop os prober), is create the file. /boot/grub/custom.cfg this file will be loaded on bootup of computer and used over and above the mentioned 40_custom file. you do not need to run the command "sudo update-grub" from within the main os that grub 2 is using. you just add the info to the custom.config file and boot computer. great for when setting up puppy you can just go to the file add entries and your done. all from within puppy.

Also see
BootLoaders
What puppy Linux is best for you
Puppy Linux 431
Puppy Linux 5 Series
Lighthouse Puppy
Quirky Puppy
what are .sfs files



Categories
CategoryInstallation
CategoryCommandLine
Comments [Hide comments]
Comment by CrustyLobster
2012-01-30 09:09:44
good to see you on the wiki "its me again"
we need more wiki editors :)
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki