Grub Manual



There is nothing simple about what Grub does. It is the tiny software that let us boot our Linux or Windows operating systems. At first look at what it takes in the file /grub/grub.conf to boot a Linux system.

Figure 1:
title Fedora (2.6.22.1-41.fc7)
root (hd0,5)
kernel /boot/vmlinuz-2.6.22.1-41.fc7 ro root=LABEL=f7 rhgb quiet
initrd /boot/initrd-2.6.22.1-41.fc7.img

Figure 1 is a typical grub.conf entry from an actual working system. It is 4 lines and each are required and they need to be perfect. Below is taken from the above but actual things are replaced by numbers so we can talk to each.

Figure 2:
title 1
root (2)
kernel 3,4
initrd 5,6

The title can be anything you want. Your computer often wants to use the name of the kernel.

The root(2) must be the location in grub form of where your going to find the kernel and initrd files. A typical one will look like root(hd0,3) which says a partition on the first hard drive and the 4th partition.

Kernel 3 refers to the directory in the root partition you will find the kernel. Typical is to show /boot/. Kernel 4 refers to the root= call that must exist and is the location of the system which may not be the same partition as shown in root(2). The partition is shown in normal terms like /dev/sda5.

For example look at this working grub.conf entry:

Figure 3:
title Fedora (2.6.22.9-91.fc7)
root (hd0,5)
kernel /vmlinuz-2.6.22.9-91.fc7 ro root=/dev/sda5 quiet
initrd /initrd-2.6.22.9-91.fc7.img

From our work above we are not interested in the title but we want to figure out what the root is. It says hd0,5 which means in words hard drive 1, partition 6 which can be also written /dev/sda6.

Notice kernel and initrd and see they are just written as, for example kernel /vmlinuz... This means the two files are in the root directory.

The kernel line has root=/dev/sda5 which means the system to be boot is in the /dev/sda5 partition even though the grub and kernel files are in the /dev/sda6 partition.

So this example is one in which the boot and system partitions are different. Notice that they can be on different hard drives too.





--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: Installing onto a >2TB drive
    ... I boot from a kernel loaded on the USB key and pass control to a root ... Sure, if the kernel knows about the disk controller, the partition ...
    (comp.os.linux.hardware)
  • Re: booting linux using a floppy
    ... which kernel of the list to boot from. ... Note that this will at this point remove your ability to boot into windows. ... I think I recall that you said the grub loader... ... and grub will search for a partition containing grub's stage2 file ...
    (comp.os.linux.misc)
  • Re: Grub Manual
    ... I have digested what you all have said and applied it to the small file I wrote on the Grub Manual. ... Please no more about what is root. ... Many people keep the entire Linux in one partition and in that case both of the root point to the same partition. ... Your computer often wants to use the name of the kernel. ...
    (Fedora)
  • Re: My Machine Wont Boot
    ... The boot order is correct in the bios. ... Decoded into readable language, the,0 is the partition number of the (0 ... Installing Grub And A Kernel ... won't install grub because the kernel hasn't changed. ...
    (Fedora)
  • Re: Grub Manual
    ... And you will hate my definition of a root. ... Many people keep the entire Linux in one partition and in that case both of the root point to the same partition. ... Others like to use more partitions and there is a root directory for each of them and the root calls point to different partitions. ... Your computer often wants to use the name of the kernel. ...
    (Fedora)