[Courses][Linux commands] installing GRUB without a floppy disk

Carla Schroder carla at bratgrrl.com
Fri Apr 16 11:55:39 EST 2004

One more GRUB thing: what these things mean in menu.lst:

title		Libranet GNU/Linux, kernel 2.4.21 
root		(hd0,5)
kernel	/boot/vmlinuz-2.4.21 root=/dev/hda6 ro

'title' is anything you want- you must have some kind of title, to identify 
the entry, and to tell GRUB where the start of each entry is.

'root' is a continual source of confusion. Hopefully this will clear it up. In 
GRUB-speak, 'root' points to the 'root device.' This has a dual meaning:

1. it points to the location of the boot images, usually a partition 
containing /boot/grub/stage1
2. it also points to the root filesystem

So, the meaning of 'root' is entirely contextual. In menu.list, the 'root' 
line means 'this is where /boot/grub/stage1 is'
On the 'kernel' line, 'root' means 'the root filesystem'

On a single-Linux system, this is easy. Most likely /boot is a directory on 
your root filesystem:

$ ls /
bin   cdrom   dev  floppy  initrd  mnt  proc  sbin    tmp  var  
boot  cdrom1  etc  home    lib     opt  root  shared  usr  

$ ls /boot
System.map-2.4.21  boot  grub  config-2.4.21  splash.xpm.gz  vmlinuz  

$ ls /boot/grub
device.map     ffs_stage1_5  menu.lst.adminmenu-old  reiserfs_stage1_5  
e2fs_stage1_5  jfs_stage1_5  menu.lst~               stage1             
fat_stage1_5   menu.lst      minix_stage1_5          stage2

So, this is simple- the boot images and kernel, or kernels, and root 
filesystem are all on the same partition. On my Libranet system, this 
is /dev/hda6. So my root device is (hd0,5) and the root filesystem, on the 
kernel line, is root=/dev/hda6

If I install other Linuxes, and I do not have a separate /boot partition, then 
the 'root' device is always on the root filesystem of each Linux. Let's say I 
install another Linux on /dev/hda2. It looks like this:

title		Fedora1
root		(hd0,1)
kernel	/boot/vmlinuz-2.4.24 root=/dev/hda2 ro

Now, if you have a separate /boot partition, the root device is always in 
the /boot partition. I like to put it on /dev/hda1. So the above two entries 
would look like this:

title		Libranet GNU/Linux, kernel 2.4.21 
root		(hd0,0)
kernel	/boot/vmlinuz-2.4.21 root=/dev/hda6 ro

title		Fedora1
root		(hd0,0)
kernel	/boot/vmlinuz-2.4.24 root=/dev/hda2 ro

The kewlest bit is you can test this all out in GRUB's command shell, without 
having to edit menu.lst until you have it all figured out.

Carla Schroder
this message brought to you
by Libranet 2.8 and Kmail

More information about the Courses mailing list