[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Retrieve UUID of the partition containing prefix
From: |
A. Wan |
Subject: |
Re: Retrieve UUID of the partition containing prefix |
Date: |
Tue, 16 Jun 2015 09:23:05 -0700 |
User-agent: |
SquirrelMail/1.4.22 |
When I boot a PC with GRUB2 installed I can hit 'c' to get the command
prompt. Then I enter 'set' and I can see the value for prefix, for
example:
prefix=(hd0,msdos1)/boot/grub
Then I type 'set root=(hd0,' and hit TAB. GRUB2 shows the list of
partitions, complete with detected filesystem types and uuid, for example:
Possible partitions are:
Partition hd0,msdos1: Filesystem type ext* ... UUID abcd...
Partition hd0,msdos2: Filesystem type ext* ... UUID 1234...
Presumably GRUB2 can tell the UUID and filesystem type of the partition
containing the prefix (In the above example (hd0,msdos1)/boot/grub). But
I am unable to find a way to share such information with the Linux kernel
I want to boot.
This is the use case: My boot disk wants to mount a big filesystem image
that is always stored in the same partition as the one containing the
--boot-directory parameter when GRUB2 was installed to the boot media, but
I do not want to hard-code the UUID of the partition in the grub
configuration file every time I make another copy of the boot disk.
You may say why not search.fs_label? But why search when GRUB2 already
know where itself is?
I appreciate any responses. Thank you very much.
Sincerely,
Alex
- Re: Retrieve UUID of the partition containing prefix,
A. Wan <=