20

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?

JoBu1324
  • 619
  • 2
  • 7
  • 16

3 Answers3

30

The ls -l command should be revealing.

psusi
  • 37,033
  • 2
  • 68
  • 106
  • 6
    For those wondering why [`ls -l` would do this](https://i.stack.imgur.com/ITURg.png), it's because the GRUB prompt supports [an `ls` command that can list devices](https://www.gnu.org/software/grub/manual/html_node/ls.html). – Eliah Kagan Jan 22 '17 at 05:17
3

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
Remember Monica
  • 207
  • 2
  • 5
1

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

emeralddove
  • 139
  • 4