Linux mbr grub install

Bootloading with GRUB2

This page has been converted from the Fedora Project Wiki and cleaned up for publishing here on the Fedora Docs Portal, but it has not yet been reviewed for technical accuracy. This means any information on this page may be outdated or inaccurate. Reviews for technical accuracy are greatly appreciated. If you want to help, see the README file in the source repository for instructions.

GRUB2 is the latest version of GNU GRUB, the GRand Unified Bootloader. A bootloader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel. In Fedora, the kernel is Linux. The kernel then initializes the rest of the operating system.

GRUB2 is the follower of the previous version GRUB (version 0.9x). The original version is available under the name GRUB Legacy.

Since Fedora 16, GRUB2 has been the default bootloader on x86 BIOS systems. For upgrades of BIOS systems, the default is also to install GRUB2, but you can opt to skip bootloader configuration entirely.

Discovering the firmware type

To discover what firmware your machine uses, run the following command:

$ [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

The output returns only UEFI or BIOS, depending on the firmware your machine runs.

Installing GRUB2 on a BIOS system

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.

Читайте также:  Linux отключить гашение экрана

This procedure shows the steps to install GRUB2 on your Master Boot Record (MBR) of your primary hard disk.

  • Make sure you have the the GRUB2 packages and the os-prober package installed in your system.
$ dnf list installed | grep grub

Источник

Linux mbr grub install

For information on where GRUB should be installed on PC BIOS platforms, see BIOS installation.

In order to install GRUB under a UNIX-like OS (such as GNU), invoke the program grub-install (see Invoking grub-install) as the superuser (root).

The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like ‘ /dev/hda ’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk:

Likewise, under GNU/Hurd, this has the same effect:

But all the above examples assume that GRUB should put images under the /boot directory. If you want GRUB to put images under a directory other than /boot , you need to specify the option —boot-directory . The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example:

# mke2fs /dev/fd0 # mount -t ext2 /dev/fd0 /mnt # mkdir /mnt/boot # grub-install --boot-directory=/mnt/boot /dev/fd0 # umount /mnt 

Some BIOSes have a bug of exposing the first partition of a USB drive as a floppy instead of exposing the USB drive as a hard disk (they call it “USB-FDD” boot). In such cases, you need to install like this:

# losetup /dev/loop0 /dev/sdb1 # mount /dev/loop0 /mnt/usb # grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0 

This install doesn’t conflict with standard install as long as they are in separate directories.

Читайте также:  Usb модем линукс минт

On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at /boot/efi then you don’t need any special arguments:

Otherwise you need to specify where your EFI System partition is mounted:

# grub-install --efi-directory=/mnt/efi 

For removable installs you have to use —removable and specify both —boot-directory and —efi-directory :

# grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable 

Источник

Оцените статью
Adblock
detector