GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command find.

How to specify devices

The device syntax is like this:

The syntax (hd0) represents using the entire disk (or the MBR when installing GRUB), while the syntax (hd0,0) represents using the first partition of the disk (or the boot sector of the partition when installing GRUB).

If you enabled the network support, the special drive, `(nd)', is also available. Before using the network drive, you must initialize the network.

If you boot GRUB from a CD-ROM, `(cd)' is available.

How to specify files

There are two ways to specify files, by absolute file name and by block list.

An absolute file name resembles a Unix absolute file name, using / for the directory separator (not \ as in DOS).

One example is `(hd0,0)/boot/grub/menu.lst'. This means the file /boot/grub/menu.lst in the first partition of the first hard disk.

If you omit the device name in an absolute file name, GRUB uses GRUB's root device implicitly. So if you set the root device to, say, `(hd1,0)' by the command root, then /boot/kernel is the same as (hd1,0)/boot/kernel.

How to specify block lists

A block list is used for specifying a file that doesn't appear in the filesystem, like a chainloader. The syntax is [offset]+length[,[offset]+length].... Here is an example:

This represents that GRUB should read blocks 0 through 99, block 200, and blocks 300 through 599. If you omit an offset, then GRUB assumes the offset is zero.

Like the file name syntax (see File name syntax), if a blocklist does not contain a device name, then GRUB uses GRUB's RootDevice. So (hd0,1)+1 is the same as +1 when the root device is (hd0,1).


CategoryDocumentation

GrubWiki: FileSystem (last edited 2008-05-16 19:26:50 by VesaJääskeläinen)