Clover Bootloader currently no longer supports UEFI 32-bit. AIO Boot supports all of these bootloaders, including Enoch Chameleon, Syslinux and rEFInd. In Legacy mode, just run AIOCreator.exe, then click on Bootloaders to install them. Add Clover to Grub2. Open the Grub2 configuration file (grub.cfg) and add the following code. For this reason, I'm going to write this tutorial since installing Grub on a UEFI bios during a new Arch Linux installation it's not too easy. Locating the EFI partition. The first important thing to do for installing Grub on Arch Linux is to locate the EFI partition. Let's run the following command in order to locate this partition.
It's never a comforting scenario when you go to boot up your system and you get the following screen:
'Where's the OS?' one might demand. But don't fret, this may not be the end. There are a number of reasons you could be getting this prompt, but it usually all boils down to the fact that GRUB is unable to see any information on how it should load your kernel and operating system.
What is booting?
In computing, booting (also known as a boot-up) is the initial set of operations that a computer system performs after being turned on. When the machine finishes it's Power-On Self-Test (POST), it will look for instructions on how to actually load your Operating System. In the case of a hard disk (which is most common), it will load the code found in the Master Boot Record (MBR), which will generally locate and load the operating system's 'Boot Loader' into memory. In the case here, the boot loader is GRUB. The boot loader is then responsible for preping and starting the Operating System.
How does it work?
The GRand Unified Bootloader (GRUB) was initially developed as a boot loader for the GNU/Hurd project. There are two versions of GRUB in common use, though GRUB version 2 is now used by most distributions (and will be the focus here). GRUB will check it's configs for the location of the requested kernel and attempt to load (or strap) that image into memory. Once loaded, GRUB will pass parameters (if any) and transfer control to the kernel. The kernel will then load both the default configuration file and any other modules needed.
So how do we fix it when things go wrong?
Manually booting your operating system from GRUB is actually pretty easy once you know what you need to do. Before trying to actually do anything with GRUB, you should examine what GRUB can actually see in your system. For starters, if you can see the GRUB prompt you know that the MBR is intact, and that GRUB has been properly loaded into memory. Great! Now let's poke around and see which disks may be visible to GRUB. You can start by using the ls command:grub> ls
(hd0) (hd0,msdos2) (hd0,msdos1)
All of our partitions are showing up here (yours may look slightly different, depending on how things are partitioned). Since it can see our boot volume, let's actually tell it to use that:grub> root=(hd0,msdos1)
Now we can tell it to load or kernel image. (Just note that you must put in the full filename of the image. You can use TAB completion here to help you, especially if you don't remember the name of the file.)grub> linux /vmlinuz root=/dev/sda2
Next, we need to tell the kernel where it can find it's initialization RAM disk (initrd). Remember to use TAB completion to help you:grub> initrd /initrd.img
Finally, you can go ahead and boot your system!grub> boot
For the most part, you should be done. That wasn't so bad, right? LVM gets a little trickier though, as you will need to activate volume groups and specify logical volumes for root partitions (I may cover this in an update to this article).
This document explains how to install or re-install the Grub boot loader under CentOS 5 and 6. You may have to re-install Grub if the boot loader was damaged or destroyed, for example by installing an incompatible operating system.
Contents
- Notes and warnings
Installing Grub consists of three steps:
Creating the configuration file /boot/grub/grub.conf.
Installing the Grub files in /boot/grub.
Installing the Grub boot loader.
The 2nd and 3rd steps can be done using a single command, grub-install. Alternatively, the 3rd step can be done using the grub command.
1. Grub naming conventions
Grub designates disks and partitions as follows:
All disks are designated as hd, whether they are IDE (PATA), SATA or SCSI disks, and whether they would usually be designated using hd or sd.
- All disks and partitions are numbered starting with 0 rather than 1.
- Extended partitions are counted from 4, regardless of the actual number of primary partitions on the hard disk.
- The first number indicates the disk; the second number (if present) indicates the partition.
Examples:
Grub designation | Meaning | Usual designation |
(hd0) | First hard disk | /dev/sda (or /dev/hda) |
(hd1) | Second hard disk | /dev/sdb (or /dev/hdb) |
(hd0,0) | First hard disk, first partition | /dev/sda1 (or /dev/hda1) |
(hd1,0) | Second hard drive, first partition | /dev/sdb1 (or /dev/hdb1) |
(hd1,1) | Second hard drive, second partition | /dev/sdb2 (or /dev/hdb2) |
2. Create or edit the configuration file /boot/grub/grub.conf
First, you should create or edit the configuration file, /boot/grub/grub.conf. If the Grub boot loader hasn't been installed on your hard disk, you should create the configuration file before installing the boot loader.
In some distributions, the configuration file is /boot/grub/menu.lst. In CentOS, /boot/grub/menu.lst is a link to /boot/grub/grub.conf, which is the real configuration file.
This file contains the following information:
The default boot partition.
How long to wait before automatically booting the default partition.
Optionally, a nice splash image to show while waiting for the user's input.
The various boot partitions which the user can choose.
Example:
(The numbers before each line should not be written. They refer to the explanations after the sample file.)
If you have a separate partition for /boot, see the note below. |
Explanations:
1. By default, boot the 1st partition listed below. Remember that Grub starts counting with 0, not 1.
2. Wait 10 seconds for user input before booting default.
3. Show splash image while waiting for user input (optional).
4. Name of 1st possible boot partition. In this case, it's the default boot partition (see line 1).
5. Indicate root partition, using Grub naming conventions.
6. This line consists of 5 parts, as follows:
Location of kernel (vmlinuz), using conventional naming system.
Mount partition 'ro' (read-only) at first, to run fsck if necessary.
Location of root partition, using conventional naming system. The root partition can also be identified using the file system's UUID (universally unique identifier) as follows: root=UUID=134d2a24-2699-4b0c-823b-1e13633f3b07. CentOS now uses UUIDs by default. You can find a file system's UUID with the following command: tune2fs -l /dev/sda6.
Use graphical boot (Red Hat Graphical Boot). Omit if you want text-only boot.
Be more verbose. Omit for less verbose booting.
7. Location of initial ramdisk (initrd or initramfs), using conventional naming system.
8. Name of 2nd possible boot partition.
9. Indicate root partition, using Grub naming conventions.
10. This line consists of 3 parts, as follows:
Location of kernel (vmlinuz), using conventional naming system.
Mount partition 'ro' (read-only) at first, to run fsck if necessary.
Location of root partition, using conventional naming system. See also the comment about UUIDs in line 6.
Grub Bootloader Uefi
11. Location of initial ramdisk (initrd or initramfs), using conventional naming system.
3. Installing Grub using grub-install
The easiest way to install Grub, if possible, is using the command grub-install.
This command will:
Install the necessary files in /boot/grub of the current partition.
Install the boot loader in the location indicated, using the traditional naming system.
Examples:
Command | Meaning |
grub-install /dev/sda | Install Grub files in directory /boot/grub of current partition. Install boot loader in master boot record of first hard disk. This is the recommended way to install Grub. |
grub-install /dev/sda1 | Install Grub files in directory /boot/grub of current partition. Install boot loader in first partition of first hard disk. |
grub-install /dev/sda2 | Install Grub files in directory /boot/grub of current partition. Install boot loader in second partition of first hard disk. |
4. Alternative: Installing boot loader only using grub
It is also possible to use the grub command to install the boot loader, but not the Grub files in /boot/grub. This can be useful to repair a Grub installation if the boot loader was overwritten or damaged.
Do grub.
Optionally, do find /boot/grub/stage1 to find which partitions have the required Grub files in /boot/grub. If you have a separate partition for /boot, do find /grub/stage1 instead.
Do root [partition using Grub convention] to indicate the partition which has the Grub files in /boot/grub and the /boot/grub/grub.conf configuration file.
Install the boot loader using setup [location of boot loader using Grub convention].
Do quit to leave the Grub programme.
Example:
5. Notes and warnings
5.1. Using a separate partition for /boot
If you have a separate partition for /boot, the lines starting with root, kernel and initrd in /boot/grub/grub.conf must be modified as follows:
The line starting with root must indicate the partition for /boot, not the partition for /.
The line starting with kernel must assume that the kernel (vmlinuz) is in /, not in /boot. However, the command root in that line must indicate the partition for /, not the partition for /boot.
The line starting with initrd must assume that the initial ramdisk (initrd or initramfs) is in /, not in /boot.
Example:
6. This line consists of 5 parts, as follows:
Location of kernel (vmlinuz), using conventional naming system.
Mount partition 'ro' (read-only) at first, to run fsck if necessary.
Location of root partition, using conventional naming system. The root partition can also be identified using the file system's UUID (universally unique identifier) as follows: root=UUID=134d2a24-2699-4b0c-823b-1e13633f3b07. CentOS now uses UUIDs by default. You can find a file system's UUID with the following command: tune2fs -l /dev/sda6.
Use graphical boot (Red Hat Graphical Boot). Omit if you want text-only boot.
Be more verbose. Omit for less verbose booting.
7. Location of initial ramdisk (initrd or initramfs), using conventional naming system.
8. Name of 2nd possible boot partition.
9. Indicate root partition, using Grub naming conventions.
10. This line consists of 3 parts, as follows:
Location of kernel (vmlinuz), using conventional naming system.
Mount partition 'ro' (read-only) at first, to run fsck if necessary.
Location of root partition, using conventional naming system. See also the comment about UUIDs in line 6.
Grub Bootloader Uefi
11. Location of initial ramdisk (initrd or initramfs), using conventional naming system.
3. Installing Grub using grub-install
The easiest way to install Grub, if possible, is using the command grub-install.
This command will:
Install the necessary files in /boot/grub of the current partition.
Install the boot loader in the location indicated, using the traditional naming system.
Examples:
Command | Meaning |
grub-install /dev/sda | Install Grub files in directory /boot/grub of current partition. Install boot loader in master boot record of first hard disk. This is the recommended way to install Grub. |
grub-install /dev/sda1 | Install Grub files in directory /boot/grub of current partition. Install boot loader in first partition of first hard disk. |
grub-install /dev/sda2 | Install Grub files in directory /boot/grub of current partition. Install boot loader in second partition of first hard disk. |
4. Alternative: Installing boot loader only using grub
It is also possible to use the grub command to install the boot loader, but not the Grub files in /boot/grub. This can be useful to repair a Grub installation if the boot loader was overwritten or damaged.
Do grub.
Optionally, do find /boot/grub/stage1 to find which partitions have the required Grub files in /boot/grub. If you have a separate partition for /boot, do find /grub/stage1 instead.
Do root [partition using Grub convention] to indicate the partition which has the Grub files in /boot/grub and the /boot/grub/grub.conf configuration file.
Install the boot loader using setup [location of boot loader using Grub convention].
Do quit to leave the Grub programme.
Example:
5. Notes and warnings
5.1. Using a separate partition for /boot
If you have a separate partition for /boot, the lines starting with root, kernel and initrd in /boot/grub/grub.conf must be modified as follows:
The line starting with root must indicate the partition for /boot, not the partition for /.
The line starting with kernel must assume that the kernel (vmlinuz) is in /, not in /boot. However, the command root in that line must indicate the partition for /, not the partition for /boot.
The line starting with initrd must assume that the initial ramdisk (initrd or initramfs) is in /, not in /boot.
Example:
The /boot partition is /dev/sda1, or hd(0,0). The / partition is /dev/sda2, or hd(0,1). The file /boot/grub/grub.conf must indicate the following:
5.2. Grub and ext4fs
Grub from CentOS 5 doesn't work with ext4fs. More precisely, it can't read the 256-byte inodes that ext4fs uses by default.
There are two possible solutions:
- Use Grub from CentOS 6, which works properly with ext4fs.
Create an ext4 file system with 128-byte inodes, by using the command mkfs.ext4 -I 128. This will mean that some capabilities of ext4fs won't be available.
5.3. Using the Grub command line from the boot loader
Commands can be given to Grub from the boot loader itself. Type c at the boot menu, and then give Grub the same commands that would be in the /boot/grub/grub.conf configuration file.
This can be useful if there are mistakes in the configuration file.
Linux Install Grub Bootloader
Example:
You can also edit a line in /boot/grub/grub.conf from the Grub boot loader with the e command. For example, to boot Linux in single-user mode (runlevel 1), edit the line with the kernel command by adding 1 at the end. Then type b to boot.
5.4. Using Grub to boot a Windows partition
To boot a Windows partition using Grub, add a 'stanza' similar to this one in /boot/grub/grub.conf:
Example:
6. More information
For complete information on Grub, do info grub.
How to re-install bootstrap code (GRUB)
Troubleshooting GRUB Issues
Information on Grub from RHEL's Installation Guide
Created by YvesBellefeuille