How do you get a UUID from a a device on the grub2 prompt?

I'm trying to perform some grub2 troubleshooting related to this question, and as part of the troubleshooting I'm trying to figure out what grub can see during the boot. How can I get the UUID of, say (hd0,msdos1) while I'm at the grub2 prompt?


The ls -l command should be revealing.


From GRUB command line, cat (hd0,gpt9)/boot/grub/grub.cfg should reveal the UUID. Remember to use "set pager=1" to scroll page by page


Programmatically, this can be queried with the probe command, e.g.:

probe --fs-uuid (hd0,gpt6)

The result can also be assigned to a variable with --set:

probe --set devuuid --fs-uuid (hd0,gpt6)
echo $devuuid