grub-probe
Probe device information for a particular path or device. tldr-pages
On Linux
Linux
Get GRUB filesystem module for a path
sudo grub-probe --target fs /boot/grubIdentifyGet the system device containing a path
sudo grub-probe --target device /boot/grubIdentifyGet GRUB disk name for a system device
sudo grub-probe --target drive /dev/sdX --deviceIdentifyGet filesystem UUID
sudo grub-probe --target fs_uuid /boot/grubIdentifyGet filesystem label
sudo grub-probe --target fs_label /boot/grubIdentifyGet MBR partition type code(two hexadecimal digits)
sudo grub-probe --target msdos_parttype /dev/sdXIdentifyProbe using a custom device map
sudo grub-probe --target drive /boot/grub --device-map path/to/custom_device.mapIdentify