linux:system:grub
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:system:grub [2023/08/06 06:58] – oscar | linux:system:grub [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== GRUB 2 ====== | ||
| - | |||
| - | ---- | ||
| - | ===== Grub Configuration ===== | ||
| - | GRUB settings are stored in the following locations: | ||
| - | * **/ | ||
| - | * **/ | ||
| - | * **/ | ||
| - | |||
| - | When you run the update-grub command, GRUB automatically combines the settings from the / | ||
| - | # / | ||
| - | # update-grub | ||
| - | # grub-install /dev/sdX | ||
| - | # grub-install --recheck /dev/sdX | ||
| - | |||
| - | ===== Probe installed OS ===== | ||
| - | Open a terminal and run the os-prober command with root privileges. This will search for other operating system installations besides the current distro you’re booted into. | ||
| - | |||
| - | $ sudo os-prober | ||
| - | |||
| - | It should find your Linux distro, the Windows installation, | ||
| - | $ sudo update-grub | ||
| - | |||
| - | The output should show that Windows 10 has been found and added to the GRUB boot menu. | ||
| - | |||
| - | |||
| - | ===== Repair, Restore, or Reinstall Grub 2 with Live USB ===== | ||
| - | Grub 2 typically gets overridden when you install Windows or another Operating System. To make Linux control the boot process, you need Reinstall (Repair/ | ||
| - | |||
| - | Create a live USB and boot system from USB | ||
| - | |||
| - | Mount the partition your broken Linux installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt. | ||
| - | < | ||
| - | # mount /dev/sdXY /mnt | ||
| - | </ | ||
| - | |||
| - | Now bind the directories that grub needs access to to detect other operating systems, like so. | ||
| - | < | ||
| - | # mount --bind /dev /mnt/dev | ||
| - | # mount --bind /dev/pts / | ||
| - | # mount --bind /proc /mnt/proc | ||
| - | # mount --bind /sys /mnt/sys | ||
| - | </ | ||
| - | |||
| - | Internet access | ||
| - | For internet access inside chroot: | ||
| - | < | ||
| - | # mv / | ||
| - | # cp / | ||
| - | </ | ||
| - | |||
| - | Now we jump into that using chroot. | ||
| - | < | ||
| - | # chroot /mnt | ||
| - | </ | ||
| - | |||
| - | Now install, check, and update grub. This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda. | ||
| - | < | ||
| - | # grub-install /dev/sdX | ||
| - | # grub-install --recheck /dev/sdX | ||
| - | </ | ||
| - | |||
| - | Alternatively, | ||
| - | < | ||
| - | apt-get remove --purge grub-pc grub-common | ||
| - | apt-get install grub-pc | ||
| - | grub-mkconfig | ||
| - | update-grub | ||
| - | grub-install /dev/sda | ||
| - | </ | ||
| - | |||
| - | Now grub is back, all that is left is to exit the chrooted system and unmount everything: | ||
| - | < | ||
| - | # exit | ||
| - | # umount /mnt/sys | ||
| - | # umount /mnt/proc | ||
| - | # umount /mnt/dev/pt | ||
| - | # umount /mnt/dev | ||
| - | # umount /mnt | ||
| - | </ | ||
| - | Shut down and turn your computer back on, and you will be met with the default Grub2 screen. | ||
| - | ===== Customize boot layout ===== | ||
| - | For customizing the layout of the Grub startup screen at boot, the files are located in:/ | ||
| - | The sample below illustrates adding a background image and changing the font size. | ||
| - | Copy the background images to the folder: /boot/grub. Remember that other partitions might not yet be mounted and available at boot time. Update / | ||
| - | |||
| - | #nano / | ||
| - | | ||
| - | Modify Lines: | ||
| - | | ||
| - | GRUB_BACKGROUND=/ | ||
| - | GRUB_GFXMODE=1024x768 | ||
| - | | ||
| - | If you change this file, run ' | ||
| - | update-grub | ||
| - | |||
| - | Currently a grub2 wallpaper image cannot be larger than 1024×768px, | ||
| - | |||
linux/system/grub.1691305094.txt.gz · Last modified: by oscar
