aboutsummaryrefslogtreecommitdiffstats
path: root/chapter10
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2022-08-26 20:11:57 +0800
committerXi Ruoyao <xry111@xry111.site>2022-08-26 20:30:29 +0800
commit5353a1948fa64dac71603a6477f15bfa6390411b (patch)
tree0b96ddea33cf62cce36f724f1997fdc987a14d7b /chapter10
parentd84087141cc4974817183cc5dba2354e3b783e44 (diff)
grub: add a note about filesystem UUID and partition UUID usage
Text only change.
Diffstat (limited to 'chapter10')
-rw-r--r--chapter10/grub.xml32
1 files changed, 32 insertions, 0 deletions
diff --git a/chapter10/grub.xml b/chapter10/grub.xml
index c569525c9..233902633 100644
--- a/chapter10/grub.xml
+++ b/chapter10/grub.xml
@@ -155,6 +155,38 @@ EOF</userinput></screen>
<emphasis>set root</emphasis> line to point to the boot partition.
</para></note>
+ <note>
+ <para>The GRUB designator for a partition may change if you added or
+ removed some disks (including removable disks like USB thumb devices).
+ The change may cause boot failure because
+ <filename>grub.cfg</filename> refers to some <quote>old</quote>
+ designators. If you wish to avoid such a problem, you may use
+ the UUID of partition and filesystem instead of GRUB designator to
+ specify a partition.
+ Run <command>lsblk -o UUID,PARTUUID,PATH,MOUNTPOINT</command> to show
+ the UUID of your filesystems (in <literal>UUID</literal> column) and
+ partitions (in <literal>PARTUUID</literal> column). Then replace
+ <literal>set root=(hdx,y)</literal> with
+ <literal>search --set=root --fs-uuid <replaceable>&lt;UUID of the filesystem where the kernel is installed&gt;</replaceable></literal>, and replace
+ <literal>root=/dev/sda2</literal> with
+ <literal>root=PARTUUID=<replaceable>&lt;UUID of the partition where LFS is built&gt;</replaceable></literal>.</para>
+ <para>Note that the UUID of a partition and the UUID of the filesystem
+ in this partition is completely different. Some online resources may
+ instruct you to use
+ <literal>root=UUID=<replaceable>&lt;filesystem UUID&gt;</replaceable></literal>
+ instead of
+ <literal>root=PARTUUID=<replaceable>&lt;partition UUID&gt;</replaceable></literal>,
+ but doing so will require an initramfs which is beyond the scope of
+ LFS.</para>
+ <para>The name of the device node for a partition in
+ <filename class='directory'>/dev</filename> may also change (more
+ unlikely than GRUB designator change though). You can also replace
+ paths to device nodes like <literal>/dev/sda1</literal> with
+ <literal>PARTUUID=<replaceable>&lt;partition UUID&gt;</replaceable></literal>,
+ in <filename>/etc/fstab</filename>, to avoid a potential boot failure
+ in case the device node name has changed.</para>
+ </note>
+
<para>GRUB is an extremely powerful program and it provides a tremendous
number of options for booting from a wide variety of devices, operating
systems, and partition types. There are also many options for customization