Difference between revisions of "GRUB/Restore the GRUB Bootloader"

Marked this version for translation
m (added languages and translate tags)
(Marked this version for translation)
Line 2: Line 2:
__TOC__
__TOC__
<translate>
<translate>
==Overview==
==Overview== <!--T:1-->
In order to load the operating system, a Linux-capable boot loader such as GRUB, rEFInd or Syslinux needs to be installed to the Master Boot Record (MBR) or the GUID Partition Table (GPT) of the media containing the Operating System. Installations created using Manjaro ISO defaults to GRUB.
In order to load the operating system, a Linux-capable boot loader such as GRUB, rEFInd or Syslinux needs to be installed to the Master Boot Record (MBR) or the GUID Partition Table (GPT) of the media containing the Operating System. Installations created using Manjaro ISO defaults to GRUB.


<!--T:2-->
For various reasons - it happens the bootloader get's corrupted, erased or misconfigured resulting to a black screen with a failure message during boot, like '''No boot loaders found in /dev/...'''. To restore system operation without re-installing your OS or losing your data you will need to use your Manjaro installation media, such as, a CD/DVD or USB Flashdrive.
For various reasons - it happens the bootloader get's corrupted, erased or misconfigured resulting to a black screen with a failure message during boot, like '''No boot loaders found in /dev/...'''. To restore system operation without re-installing your OS or losing your data you will need to use your Manjaro installation media, such as, a CD/DVD or USB Flashdrive.
{{BoxSecondary|Archlinux Boot Process|More information about the boot process on Archlinux based distributions is available at [https://wiki.archlinux.org/index.php/Arch_boot_process Archwiki]}}
{{BoxSecondary|Archlinux Boot Process|More information about the boot process on Archlinux based distributions is available at [https://wiki.archlinux.org/index.php/Arch_boot_process Archwiki]}}


==Preparation==
==Preparation== <!--T:3-->
Identify the type of system you are attempted to resque as the commands involved are slightly different.
Identify the type of system you are attempted to resque as the commands involved are slightly different.
* BIOS/MBR/GPT system
* BIOS/MBR/GPT system
* EFI/GPT system
* EFI/GPT system


==Load Manjaro Installation Media==
==Load Manjaro Installation Media== <!--T:4-->
{{BoxSecondary|System Boot Override|To override system boot order the vendor has a dedicated key. Most laptop keyboard has multiple use for the function keys and the primary function may be reversed. In such case a <kbd>Fn</kbd> key must be used with the function key. If you don't know consult your system documentation. Manjaro ISO default usernames and passwords
{{BoxSecondary|System Boot Override|To override system boot order the vendor has a dedicated key. Most laptop keyboard has multiple use for the function keys and the primary function may be reversed. In such case a <kbd>Fn</kbd> key must be used with the function key. If you don't know consult your system documentation. Manjaro ISO default usernames and passwords
<table>
<table>
Line 22: Line 23:
}}
}}


==Identify partitions==
==Identify partitions== <!--T:5-->
To identify your partitions and their designated use you need to run a partition manager. Depending on environment there is various tools. GTK based ISO offers GpartEd, QT based ISO offers KParted and common to all is the CLI tools.
To identify your partitions and their designated use you need to run a partition manager. Depending on environment there is various tools. GTK based ISO offers GpartEd, QT based ISO offers KParted and common to all is the CLI tools.
{{UserCmd|command=lsblk -o PATH,PTTYPE,PARTTYPE,FSTYPE,PARTTYPENAME}}
{{UserCmd|command=lsblk -o PATH,PTTYPE,PARTTYPE,FSTYPE,PARTTYPENAME}}
Line 29: Line 30:
The clues to look for is ''mbr'' vs. ''gpt'' and the presence of a small partition - usually the first - formatted with the ''vfat'' filesystem followed by a larger partition formatted as ''ext4''.
The clues to look for is ''mbr'' vs. ''gpt'' and the presence of a small partition - usually the first - formatted with the ''vfat'' filesystem followed by a larger partition formatted as ''ext4''.


<!--T:6-->
{{Important|This document and the content should '''never''' be used as a copy/paste resource. The remainder of this document will use pseudo names and partition numbering. Devices will be referred as '''/dev/sdy''' and partitions referred as '''/dev/sdyA''' and you will have to subtitute those with the real values from your system.}}
{{Important|This document and the content should '''never''' be used as a copy/paste resource. The remainder of this document will use pseudo names and partition numbering. Devices will be referred as '''/dev/sdy''' and partitions referred as '''/dev/sdyA''' and you will have to subtitute those with the real values from your system.}}


==Use root context==
==Use root context== <!--T:7-->
When you have loaded the live ISO - depending on environment - open a terminal and switch to ''root'' context. Use above mentioned root:password combination.
When you have loaded the live ISO - depending on environment - open a terminal and switch to ''root'' context. Use above mentioned root:password combination.
{{UserCmd|command=su}}
{{UserCmd|command=su}}


==Chroot environment==
==Chroot environment== <!--T:8-->
Chroot is a method to restrict various tasks to a restricted area e.g. package installation and other system maintenance tasks. Follow the [https://wiki.archlinux.org/index.php/Change_Root link] to read more about chroot on the Arch wiki.
Chroot is a method to restrict various tasks to a restricted area e.g. package installation and other system maintenance tasks. Follow the [https://wiki.archlinux.org/index.php/Change_Root link] to read more about chroot on the Arch wiki.
===Identify system partitions===
===Identify system partitions===
Line 51: Line 53:
{{Important|If your system is a BIOS/MBR system there is no efi partition. If your system is a BIOS/GPT system you will find an unformatted partion size 1-32MB of the bios boot partition type.}}
{{Important|If your system is a BIOS/MBR system there is no efi partition. If your system is a BIOS/GPT system you will find an unformatted partion size 1-32MB of the bios boot partition type.}}


===Manual chroot===
===Manual chroot=== <!--T:9-->
Mount the partitions using the designated temporary mountpoint and '''always''' start with ''root''
Mount the partitions using the designated temporary mountpoint and '''always''' start with ''root''
{{RootCmd|command=mount /dev/sdyC /mnt}}
{{RootCmd|command=mount /dev/sdyC /mnt}}
Line 61: Line 63:
{{RootCmd|command=manjaro-chroot /mnt /bin/bash}}
{{RootCmd|command=manjaro-chroot /mnt /bin/bash}}


===Use manjaro-chroot===
===Use manjaro-chroot=== <!--T:10-->
Manjaro deploys a script called {{ic|manjaro-chroot}} takes an optional argument which will search the visible devices - scan the partitions for signs of an operating system. If more than one Linux operating system is found you will get a choice of which system to chroot otherwise the file ''/etc/fstab'' from the system is used to mount the partitions and chroot into this system.
Manjaro deploys a script called {{ic|manjaro-chroot}} takes an optional argument which will search the visible devices - scan the partitions for signs of an operating system. If more than one Linux operating system is found you will get a choice of which system to chroot otherwise the file ''/etc/fstab'' from the system is used to mount the partitions and chroot into this system.
{{RootCmd|command=manjaro-chroot -a}}
{{RootCmd|command=manjaro-chroot -a}}


==Reinstall GRUB==
==Reinstall GRUB== <!--T:11-->
One possible cause why you are reading this document - is an unfinished update - which in turn can be caused by several situations - situation we will not dive into. To fix what ever caused this you should run a full system update including grub to ensure everything is in place.
One possible cause why you are reading this document - is an unfinished update - which in turn can be caused by several situations - situation we will not dive into. To fix what ever caused this you should run a full system update including grub to ensure everything is in place.
{{RootCmd|command=pacman -Syu grub}}
{{RootCmd|command=pacman -Syu grub}}
Line 72: Line 74:
On a BIOS/GPT system there is no MBR and therefore no place to store the loader. The GPT partition specification allows for an unformatted partition of the BIOS boot partition type (0xEF02). The size of this partition can be as small as 1 mebibyte. The Calamares installer uses a fixed size of 32 mebibyte. On a BIOS/MBR system a part of the bootloader is written to the Master Boot Record for the primary disk.
On a BIOS/GPT system there is no MBR and therefore no place to store the loader. The GPT partition specification allows for an unformatted partition of the BIOS boot partition type (0xEF02). The size of this partition can be as small as 1 mebibyte. The Calamares installer uses a fixed size of 32 mebibyte. On a BIOS/MBR system a part of the bootloader is written to the Master Boot Record for the primary disk.


<!--T:12-->
The device is the '''disk''' ('''not a partition''')
The device is the '''disk''' ('''not a partition''')
{{RootCmd|command=grub-install --force --target=i386-pc --recheck --boot-directory=/boot /dev/sdy}}
{{RootCmd|command=grub-install --force --target=i386-pc --recheck --boot-directory=/boot /dev/sdy}}
Line 77: Line 80:
{{RootCmd|command=grub-mkconfig -o /boot/grub/grub.cfg}}
{{RootCmd|command=grub-mkconfig -o /boot/grub/grub.cfg}}


===EFI System===
===EFI System=== <!--T:13-->
{{Important|You need to be in chroot for this procedure.}}
{{Important|You need to be in chroot for this procedure.}}
Reinstall grub
Reinstall grub
Line 84: Line 87:
{{RootCmd|command=grub-mkconfig -o /boot/grub/grub.cfg}}
{{RootCmd|command=grub-mkconfig -o /boot/grub/grub.cfg}}


<!--T:14-->
{{BoxWarning|EFI grub install messages|EFI variables are not supported on this system.}}
{{BoxWarning|EFI grub install messages|EFI variables are not supported on this system.}}
Verify the existance of an EFI system partition
Verify the existance of an EFI system partition
Line 101: Line 105:
If successfull re-run above installation commands
If successfull re-run above installation commands


==Troubleshooting==
==Troubleshooting== <!--T:15-->
=== Arch Linux is not recognized ===
=== Arch Linux is not recognized ===
If Arch Linux wasn't recognized after an update-grub then probably your Arch installation is missing the package lsb-release.
If Arch Linux wasn't recognized after an update-grub then probably your Arch installation is missing the package lsb-release.


==See also==
==See also== <!--T:16-->
* [http://wiki.manjaro.org/index.php?title=UEFI_-_Install_Guide UEFI Install Guide]
* [http://wiki.manjaro.org/index.php?title=UEFI_-_Install_Guide UEFI Install Guide]
* [https://wiki.archlinux.org/index.php/GRUB GRUB on Arch wiki]
* [https://wiki.archlinux.org/index.php/GRUB GRUB on Arch wiki]
</translate>
</translate>
[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]