← 返回命令列表

Linux command

grub-probe 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo grub-probe -t fs /boot/grub

Example

sudo grub-probe -t device /boot/grub

Example

sudo grub-probe -t disk /dev/sdX -d

Example

sudo grub-probe -t fs_uuid /boot/grub

Example

sudo grub-probe -t fs_label /boot/grub

Example

sudo grub-probe -t msdos_parttype /dev/sdX

Example

sudo grub-probe -t partmap /boot/grub

Example

sudo grub-probe -t fs /boot/grub -m [path/to/custom_device.map]

说明

grub-probe extracts device and filesystem information in GRUB's naming format. It is primarily used internally by GRUB tools but is useful for debugging boot configuration. Target types include fs (filesystem module), device (system device path), disk (system disk path), drive (GRUB drive name like hd0), fs_uuid (filesystem UUID), fs_label (filesystem label), partmap (partition map type), partuuid (partition UUID), abstraction (abstraction module like lvm), cryptodisk_uuid, msdos_parttype, gpt_parttype, and various boot hint targets. This tool bridges Linux device names to GRUB's naming conventions, which is essential for generating correct boot configurations.

参数

-t, --target _TARGET_
Information to probe: fs, fs_uuid, fs_label, device, disk, drive, partmap, partuuid, abstraction, cryptodisk_uuid, msdos_parttype, gpt_parttype, hints_string, zero_check (default: fs)
-d, --device
Treat argument as a system device, not a path
-m, --device-map _FILE_
Use custom device map file (default: /boot/grub/device.map)
-0
Separate items in output using ASCII NUL characters
-v, --verbose
Enable verbose output (pass twice for debug printing)

FAQ

What is the grub-probe command used for?

grub-probe extracts device and filesystem information in GRUB's naming format. It is primarily used internally by GRUB tools but is useful for debugging boot configuration. Target types include fs (filesystem module), device (system device path), disk (system disk path), drive (GRUB drive name like hd0), fs_uuid (filesystem UUID), fs_label (filesystem label), partmap (partition map type), partuuid (partition UUID), abstraction (abstraction module like lvm), cryptodisk_uuid, msdos_parttype, gpt_parttype, and various boot hint targets. This tool bridges Linux device names to GRUB's naming conventions, which is essential for generating correct boot configurations.

How do I run a basic grub-probe example?

Run `sudo grub-probe -t fs /boot/grub` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --target _TARGET_ do in grub-probe?

Information to probe: fs, fs_uuid, fs_label, device, disk, drive, partmap, partuuid, abstraction, cryptodisk_uuid, msdos_parttype, gpt_parttype, hints_string, zero_check (default: fs)