grub-probe
Detect GRUB information about a device or file
SYNOPSIS
grub-probe [OPTION...] [PATH|DEVICE]
PARAMETERS
--target=NAME
Specify the type of information to print. NAME can be one of many options like fs_uuid, fs_type, drive, part_uuid, bios_device, etc.
--device
Treat the input PATH as a device path. This is the default behavior.
--file
Treat the input PATH as a regular file path, not a device.
--skip-fs-probe
Do not attempt to probe for filesystem-related information.
--skip-dev-probe
Do not attempt to probe for device-related information (e.g., BIOS, EFI device names).
--allow-floppy
Allow probing of floppy drives (often deprecated in modern systems).
--unrestricted-device-names
Permit the use of non-standard or unusual device names in the input.
--root-dir=DIR
Specify an alternative root directory (DIR) for probing, useful in chroot or rescue environments.
-h, --help
Display a help message and exit.
-v, --version
Output version information and exit.
DESCRIPTION
grub-probe is a utility from the GRUB bootloader suite designed to inspect a given device or path and output various pieces of information relevant to GRUB. This information can include the GRUB device name, filesystem type, UUIDs, partition types, and other boot-related details. It's often used by GRUB installation scripts or administrators to gather necessary data for configuring GRUB, identifying bootable partitions, or debugging boot issues. It helps GRUB understand the underlying storage layout without needing to parse complex low-level structures manually.
CAVEATS
grub-probe often requires root privileges to access raw device information. The output format and available targets can vary slightly between GRUB versions. While powerful for GRUB's needs, it's not a general-purpose disk utility and its primary use is for bootloader configuration and debugging. Using --allow-floppy is generally deprecated.
INTEGRATION WITH GRUB CONFIGURATION
grub-probe is extensively used by other GRUB utilities like grub-install and grub-mkconfig. It provides the necessary UUIDs, labels, and device mappings that are crucial for generating the grub.cfg file, ensuring that GRUB can correctly locate and boot operating systems even if device names change.
OUTPUT AND ERROR HANDLING
By default, grub-probe prints the requested information to standard output. If it cannot find the specified information or encounters an error, it typically exits with a non-zero status code and may print an error message to standard error, making it suitable for scripting.
HISTORY
grub-probe is a core utility introduced with GRUB 2, the successor to GRUB Legacy. Its development was driven by the need for a more robust and automated way to identify devices, filesystems, and partitions for bootloader configuration. Unlike its predecessor, GRUB 2 aimed for greater flexibility and broader hardware support, and grub-probe plays a crucial role in enabling GRUB to adapt to diverse system layouts without manual intervention. It helps abstract the underlying storage details, making GRUB configuration more resilient to system changes.
SEE ALSO
grub-install(8), grub-mkconfig(8), update-grub(8), blkid(8), findfs(8)