Grub4dos Guide - Device Allocation/Numbering
Drives/devices are numbered using the following syntax in Grub4dos -
Hard Disks
Hard disks are numbered from zero -
- (hd0) - first hard disk
- (hd1) - second hard disk
- (hd2) - third hard disk
- etc.
Hard Disk - Partition Numbering
Primary partitions are numbered from zero to three -
- (hd#,0) - first primary partition (on hard disk #)
- (hd#,1) - second primary partition (on hard disk #)
- (hd#,2) - third primary partition (on hard disk #)
- (hd#,3) - fourth primary partition (on hard disk #)
Examples -
- (hd0,0) - first primary partition on first hard disk
- (hd0,1) - second primary partition on first hard disk
- (hd2,3) - fourth primary partition on third hard disk
Logical partitions are numbered from four -
- (hd#,4) - first logical partition (on hard disk #)
- (hd#,5) - second logical partition (on hard disk #)
- (hd#,6) - third logical partition (on hard disk #)
- (hd#,7) - fourth logical partition (on hard disk #)
- etc.
Examples -
- (hd0,4) - first logical partition on first hard disk
- (hd2,10) - seventh logical partition on third hard disk
- (hd5,9) - sixth logical partition on sixth hard disk
Virtual CD/DVD Drives
Virtual CD/DVD drives are numbered from (hd32) to (0xFF) -
- (hd32) - first virtual CD/DVD drive
- (hd33) - second virtual CD/DVD drive
- (hd34) - third virtual CD/DVD drive
- etc.
- (0xFF) - last virtual CD/DVD drive (try this if mapping as (hd32) doesn't work)
(hd32) is a grub drive number equivalent to (0xA0). If a virtual drive is specified with a drive number greater than or equal to 0xA0, then it will be treated as a cdrom (i.e. - with 2048-byte sectors).
CD/DVD Drives
Physical/real CD/DVD drives are numbered from zero -
- (cd0) - first CD/DVD drive
- (cd1) - second CD/DVD drive
- etc.
Floppy Disk Drives
Floppy disk drives are numbered from zero -
- (fd0) - first floppy drive
- (fd1) - second floppy drive
- etc.
PXE Drive
- (pd) - virtual device used to designate the root directory of a PXE boot server
RAM Disk Drive
To check for available devices, press [c] to enter the command line mode and type root ( [tab]. This will list all devices accessible from grub4dos, e.g. -
grub> root (
Possible disks are: fd0 hd0 hd1 rd cd
grub> root (_
The disk order is determined by the BIOS, however (hd0) would normally be the boot device, even if booting from a slave drive.
(Bootable) External USB flash drives can be booted via Grub4dos if this feature is supported by the BIOS. If the BIOS supports USB devices as HDD type, then the syntax would be in the (hd#) format – e.g. if the system has one local hard disk drive and a USB drive, and the local disk is set to boot before the USB flash drive, then the USB flash drive will be device (hd1), whilst the local disk will be device (hd0).
It is possible to use the find command to search for a (unique) tag file in order to search all available devices and return the allocated device number – see here and here.