Gentoo Wiki ArchivesGentoo Wiki

HOWTO_Quick_GRUB


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Step 1: Install GRUB

Install grub:

# emerge -n grub
Note: Sometimes grub halts to "Booting grub, please wait.."
In this case, or to prevent it from possibly happening, remove the CFLAGS for the emerge.
# CFLAGS="" emerge grub

Step 2: The GRUB Prompt

A user may decided to use grub-install or they can set up grub manually.

After it finishes installing then run the GRUB prompt:

 # grub

Once you're in the prompt type the following in order:

 root (hdx,y)
 setup (hdx)
 quit

Of course don't actually put in (hdx,y). Replace x with the hard drive type and location.

grub's IDnormal
0hda
1hdb
2hdc
3hdd
grub's IDnormal partition
0hda1
1hda2
2hda3

hda is the common device for an IDE disk, a subsequent drive will be hdb, or sda if you have no IDE hard disk. ID numbering starts at 0 for the "first" hard-disk.

The mapping of device against grub number is listed in /boot/grub/device.map, so /dev/sda1 can very well end up in (hd2,0).

You can use grubs auto-complete feature to discover what partitions/drives it sees. When you type in the root command, hit the tab key twice

root (hd<TAB><TAB>

If the drive does not show up in the map file and you deal with dynamically attached devices such as USB memory, do the following: delete /boot/grub/device.map and invoke grub like this grub --device-map=/boot/grub/device.map. This will re-generate the map file considering all dynamic drives.

Step 3: The GRUB Configuration File

After this you need to edit the grub.conf file which is located in /boot/grub and you can get to it by using your favorite editor.

 nano /boot/grub/grub.conf

If this comes up blank, your boot partion is probably not mounted. Try:

mount /dev/hda1 /boot
nano /boot/grub/grub.conf 

note: You must be root to edit this file (obviously).

This is a sample configuration:

File: /boot/grub/grub.conf
timeout 30
default 0
fallback 1
splashimage=/boot/grub/splash.xpm.gz

title Gentoo Linux
kernel (hd0,0)/boot/vmlinuz-2.6.10-gentoo-r1 root=/dev/hda2

title Windows
rootnoverify (hd1,0)
chainloader +1

Gentoo also permits run level to be set using text names, not the standard numbers (although the names to map to numbers). To do this, use the softlevel variable. e.g. to boot to runlevel user;

title Gentoo Linux
kernel (hd0,0)/boot/vmlinuz-2.6.10-gentoo-r1 root=/dev/hda2 softlevel=user

To see the services that will be started for each level, enter;

# rc-update show

at the console.

See Also

External links


Last modified: Mon, 01 Sep 2008 20:59:00 +1000 Hits: 64,112

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.