Merge branch 'f36' into 'f36'

F36 Invalid command updated - grub2

See merge request fedora/docs/fedora-linux-documentation/fedora-linux-sysadmin-guide!3
This commit is contained in:
Chris 2022-07-13 13:58:00 +00:00
commit fec0ed5c50

View file

@ -10,7 +10,7 @@ indexterm:[GRUB 2,configuring GRUB 2]indexterm:[GRUB 2,reinstalling GRUB 2]index
[[sec-Introduction_to_GRUB_2]]
== Introduction to GRUB 2
GRUB 2 reads its configuration from the `/boot/grub2/grub.cfg` file on traditional BIOS-based machines and from the `/boot/efi/EFI/fedora/grub.cfg` file on UEFI machines. This file contains menu information.
GRUB 2 reads its configuration from the `/boot/grub2/grub.cfg` file. This file contains menu information.
The GRUB 2 configuration file, `grub.cfg`, is generated during installation, or by invoking the [application]*/usr/sbin/grub2-mkconfig* utility, and is automatically updated by [command]#grubby# each time a new kernel is installed. When regenerated manually using [application]*grub2-mkconfig*, the file is generated according to the template files located in `/etc/grub.d/`, and custom settings in the `/etc/default/grub` file. Edits of `grub.cfg` will be lost any time [application]*grub2-mkconfig* is used to regenerate the file, so care must be taken to reflect any manual changes in `/etc/default/grub` as well.
@ -277,20 +277,13 @@ The file name `/etc/grub2.cfg` is a symlink to the `grub.cfg` file, whose locati
Changes to `/etc/default/grub` require rebuilding the `grub.cfg` file as follows:
* On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
* On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
[[sec-Editing_a_Menu_Entry]]
=== Editing a Menu Entry
@ -304,20 +297,13 @@ Where [option]`console=tty0` is the first virtual terminal and [option]`console=
Changes to `/etc/default/grub` require rebuilding the `grub.cfg` file as follows:
* On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
* On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
[[sec-Adding_a_new_Entry]]
=== Adding a new Entry
@ -361,9 +347,9 @@ Note that modifying the `/etc/default/grub` file does not have any effect on cre
====
. On BIOS-based machines, copy the contents of `/boot/grub2/grub.cfg`, or, on UEFI machines, copy the contents of `/boot/efi/EFI/fedora/grub.cfg`. Put the content of the `grub.cfg` into the `/etc/grub.d/40_custom` file below the existing header lines. The executable part of the `40_custom` script has to be preserved.
. Copy the contents of `/boot/grub2/grub.cfg`. Put the content of the `grub.cfg` into the `/etc/grub.d/40_custom` file below the existing header lines. The executable part of the `40_custom` script has to be preserved.
. From the content put into the `/etc/grub.d/40_custom` file, only the `menuentry` blocks are needed to create the custom menu. The `/boot/grub2/grub.cfg` and `/boot/efi/EFI/fedora/grub.cfg` files might contain function specifications and other content above and below the `menuentry` blocks. If you put these unnecessary lines into the `40_custom` file in the previous step, erase them.
. From the content put into the `/etc/grub.d/40_custom` file, only the `menuentry` blocks are needed to create the custom menu. The `/boot/grub2/grub.cfg` file might contain function specifications and other content above and below the `menuentry` blocks. If you put these unnecessary lines into the `40_custom` file in the previous step, erase them.
This is an example of a custom `40_custom` script:
@ -421,20 +407,13 @@ Alternatively, if you want to keep the files in the `/etc/grub2.d/` directory, m
. Rebuild the `grub.cfg` file by running the [command]#grub2-mkconfig -o# command as follows:
** On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
** On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
[[sec-GRUB_2_Password_Protection]]
== GRUB 2 Password Protection
@ -508,20 +487,13 @@ After you have made changes in the template file the GRUB 2 configuration file m
Rebuild the `grub.cfg` file by running the [command]#grub2-mkconfig -o# command as follows:
* On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
* On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
[[sec-Password_Encryption]]
=== Password Encryption
@ -602,20 +574,13 @@ This method completely removes all GRUB 2 configuration files and system setting
. Rebuild the `grub.cfg` file by running the [command]#grub2-mkconfig -o# command as follows:
** On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
** On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
. Now follow the procedure in xref:#sec-Reinstalling_GRUB_2[Reinstalling GRUB 2] to restore GRUB2 on the `/boot/` partition.
[[sec-GRUB_2_over_a_Serial_Console]]
@ -656,20 +621,13 @@ The first line disables the graphical terminal. Note that specifying the `GRUB_T
Rebuild the `grub.cfg` file by running the [command]#grub2-mkconfig -o# command as follows:
* On BIOS-based machines, issue the following command as `root`:
* On both UEFI-based and BIOS-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/grub2/grub.cfg
----
* On UEFI-based machines, issue the following command as `root`:
[subs="attributes"]
----
~]#{nbsp}grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
----
[NOTE]
====