diff options
-rw-r--r-- | chapter10/grub.xml | 32 |
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><UUID of the filesystem where the kernel is installed></replaceable></literal>, and replace + <literal>root=/dev/sda2</literal> with + <literal>root=PARTUUID=<replaceable><UUID of the partition where LFS is built></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><filesystem UUID></replaceable></literal> + instead of + <literal>root=PARTUUID=<replaceable><partition UUID></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><partition UUID></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 |