Disks and Partitions

Grub handles disks and partitions differently in its configuration files. Here, we go though each from basic to specific usage.

Basic Convention

Grub uses the common convention for basic use, via this pattern:

(<storage_type><storage_number>[,<partition_type><partition_position>,<partition_slice_id>][,...])
  1. The specification must be enclosed in a parenthesis, as in ( ... )
  2. The square parenthesis means optional [ ... ]
  3. storage_type describes the type of storage:
    • hd stands for hard disk
    • fd stands for floppy disk
    • cd stands for compact disc
    • usb stands for universal serial bus storage devices
    • md stands for RAID. It uses mduuid/<uuid> format
    • ieee1275 and nand stands for ofdisk. If the values has comma, it requires escaping
    • lvm stands for logical volume manager. Uses lvmid/<volume-group-uuid>/<volume-uuid> format
    • cryptouuid stands for LUKS / encrypted partition. It uses cryptouuid/<uuid> format
  4. storage_number describes the identified storage ID. It is random and cater for multiple same storage_type devices, like multiple hard disks at a time. This number starts from 0.
  5. partition_type describes the partition scheme used by that partition
  6. partition_position describes the partition position in the storage device. This number starts from 1, no longer from 0.
  7. partition_slice_id describes the partition slice conventions. It is optional, made available just in case for specifying BSD slice convention.


Examples

These are the some examples:

# first hard disk, 2nd partition with msdos scheme
(hd0,msdos2)

# first floppy disk
(fd0)

# first hard disk, 5th partition with msdos scheme
(hd0,msdos5)

# second hard disk, 1st partition with msdos scheme, use BSD 1st PC Slice number
(hd1,msdos1,bsd1)

# compact disc
(cd)

# hard disk
(ahci0)
(ata0)

# USB
(usb0)

# LUKS
(crypto0)
(cryptouuid/123456789abcdef0123456789abcdef0)

# RAID
(mduuid/123456789abcdef0123456789abcdef0)
(md/myraid)
(md/0)

# LVM
(lvm/system-root)
(lvmid/F1ikgD-2RES-306G-il9M-7iwa-4NKW-EbV1NV/eLGuCQ-L4Ka-XUgR-sjtJ-ffch-bajr-fCNfz5)

# ofdisk
(ieee1275/disk2)
(ieee1275//pci@1f\,0/ide@d/disk@2)
(nand)

# others
(memdisk)
(host)
(myloop)
(hostdisk//dev/sda)


To Access Files

To access the file inside that partition, you use the unix convention:

(...)/<file OR directory>

Example, accessing the Linux kernel in 1st hard disk, 1st partition with msdos scheme:

(hd0,msdos1)/vmlinuz

Auto Search Partitions

Coming Soon.

UUID Convention

Coming Soon.

That's all about Grub's disks and partition conventions.