LinuxCommandLibrary

grub-mkdevicemap

Create device map file for GRUB

SYNOPSIS

grub-mkdevicemap [OPTION…]

PARAMETERS

--device-map=FILE
    Use FILE as device map instead of default (/boot/grub/device.map)

--probe
    Probe disks to generate map (default)

--no-probe
    Skip disk probing; map read from kernel device list

--force-probe
    Force probing all disks, even if potentially dangerous

-h, --help
    Display help message and exit

-V, --version
    Print version information

DESCRIPTION

The grub-mkdevicemap command creates a device map file for GRUB Legacy (GRUB 0.9x), mapping BIOS drive designations like (hd0) to Linux device names such as /dev/sda. This file, typically /boot/grub/device.map, is essential for GRUB to locate the correct disks during boot.

By default, it probes system disks to build the map. Probing reads partition tables and identifies devices. Use it before running grub-install or manually configuring GRUB.

Important: This is a Legacy GRUB tool. GRUB 2 (default on modern systems) embeds device mapping and does not require or use device.map. Running on GRUB 2 systems is unnecessary and risky, as probing can interfere with mounted filesystems or cause kernel panics if devices are in use.

CAVEATS

Deprecated in GRUB 2; avoid on modern systems. Probing active disks can cause data corruption or crashes. Run from live CD or unmounted /boot.

DEFAULT OUTPUT

Generates /boot/grub/device.map with lines like (hd0) /dev/sda

EXAMPLE USAGE

grub-mkdevicemap --device-map=/tmp/map --probe
Creates map in /tmp/map after probing.

HISTORY

Introduced in GRUB 0.90 (2001); core to Legacy GRUB until GRUB 2.02 (2009) replaced it with embedded probing via grub-probe and grub-install.

SEE ALSO

Copied to clipboard