next up previous contents
Next: CD-ROM Installation Up: Linux Boot Loaders Compared Previous: Making Diskette Images without   Contents

Hard Disk Installation

For a booting Linux on the hard disk there are basically the following choices:

Which option you use, depends on several factors:

One factor that may complicate boot loader installation is that each operating system has its own naming and numbering scheme for hard disks and partitions and so does GRUB. The BIOS assigns a number to each disk. The first disk is 0x80, the second disk is 0x81, etc. When you install LILO, things go without problems most of the time, but there are situations in which it may be necessary to specify the BIOS code of a drive.

The naming convention of hard disks in GRUB can be confusing:

Table 2 shows the disk and partition numbers on a system with two hard disks, connected as master and slave to the primary IDE controller. The first disk contains two primary partitions (DOS and Linux) and two logical partitions (DOS and Linux swap). The second disk contains one primary DOS partition.


Table 2: Disk and partition names (first example)
Disk Linux BIOS code (LILO) GRUB disk name DOS drive
IDE Primary Master /dev/hda 0x80 (hd0) -
Primary DOS /dev/hda1 - (hd0,0) C:
Primary Linux /dev/hda2 - (hd0,1) -
Extended /dev/hda3 - (hd0,2) -
Logical DOS /dev/hda5 - (hd0,4) E:
Linux swap /dev/hda6 - (hd0,5) -
IDE Primary Slave /dev/hdb 0x81 (hd1) -
Primary DOS /dev/hdb1 - (hd1,0) D:


Table 3 shows the disk and partition numbers on a system with three hard disks, one on the primary IDE controller and one on the secondary IDE controller and one SCSI.


Table 3: Disk and partition names (second example)
Disk Linux BIOS code (LILO) GRUB disk name DOS drive
IDE Primary Master /dev/hda 0x80 (hd0) -
Primary DOS /dev/hda1 - (hd0,0) C:
Primary Linux /dev/hda2 - (hd0,1) -
IDE Secondary Master /dev/hdc 0x81 (hd1) -
Primary DOS /dev/hdc1 - (hd1,0) D:
First SCSI /dev/sda 0x82 (hd2) -
Primary DOS /dev/sda1 - (hd2,0) E:


If you use FreeBSD as well, things get even more complicated. BSD divides a normal disk partition into several sub-partitions. Linux can only access them if support for BSD disk labels is compiled into the kernel. Needless to say that Linux, BSD and GRUB all have different names for these sub-partitions.

In GRUB you have to use GRUB partition names for files accessed by GRUB, but Linux partition names for arguments on the kernel command line. The following is a very typical kernel command line in GRUB:

kernel (hd0,1)/vmlinuz root=/dev/hda2

Finally on some (mostly older) systems, disk geometry may cause problems. As long as everything uses LBA, no problems are expected. If your BIOS does not support LBA, boot loaders using the BIOS have no way to reach beyond 1024 cylinders. nuni may be a solution in such a case, but most of the time you will need to create a small partition near the start of the disk and boot the kernel from there.


next up previous contents
Next: CD-ROM Installation Up: Linux Boot Loaders Compared Previous: Making Diskette Images without   Contents
Lennart Benschop 2003-05-29