quick-docs/modules/ROOT/pages/_partials/proc_installing-grub2-on-bios-system.adoc

49 lines
2.2 KiB
Text
Raw Normal View History

2017-12-12 16:56:25 +00:00
[[installing-grub-2-on-a-bios-system]]
2018-01-20 17:59:12 +00:00
= Installing GRUB2 on a BIOS system
2017-12-12 16:56:25 +00:00
Normally, *GRUB2* will be installed and set up by the installer, *Anaconda*, during the installation process. You will probably never have to deal with manual installation of *GRUB2*. However, in certain situations , you will want to install *GRUB2* manually, especially if you need to repair the existing *GRUB2* installation or you want to change its configuration.
This procedure shows the steps to install *GRUB2* on your _Master Boot Record_ (MBR) of your primary hard disk.
.Before you start
2018-01-20 17:59:12 +00:00
* Make sure you have the the *GRUB2* packages and the _os-prober_ package installed in your system:
2017-12-12 16:56:25 +00:00
+
----
$ dnf list installed | grep grub
----
* To automatically collect information about your disks and operating systems installed on them, the `os-prober` package needs to be installed on your system.
.Procedure
. List block devices available on the system.
+
----
$ lsblk
----
. Identify the primary hard disk. Usually, it is the `sda` device.
. Install *GRUB2* in the MBR of the primary hard disk.
+
----
2018-01-20 17:59:12 +00:00
# grub2-install /dev/sda
2017-12-12 16:56:25 +00:00
----
. Create a configuration file for *GRUB2*.
+
----
# grub2-mkconfig -o /boot/grub2/grub.cfg
----
2017-12-12 16:56:25 +00:00
. Reboot your computer to boot with the newly installed bootloader.
.More information
2018-01-20 17:59:12 +00:00
* The `grub2-mkconfig` command creates a new configuration based on the currently running system. It collects information from the `/boot` partition (or directory), from the `/etc/default/grub` file, and the customizable scripts in `/etc/grub.d/`.
* The configuration format is changing with time, and a new configuration file can become slightly incompatible with the older versions of the bootloader. Always run `grub2-install` before you create the configuration file with `grub2-mkconfig`.
2017-12-12 16:56:25 +00:00
2018-01-20 17:59:12 +00:00
* In Fedora, it is generally safe to edit `/boot/grub2/grub.cfg` manually. *Grubby* in Fedora patches the configuration when a kernel update is performed and will try to not make any other changes than what is necessary. Manual changes can be overwritten with `grub2-mkconfig` when the system gets upgraded with *Anaconda*. Customizations placed in `/etc/grub.d/40_custom` or `/boot/grub2/custom.cfg` files will survive running the `grub2-mkconfig` command.