LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

grub-install

install GRUB bootloader to a device

TLDR

Install GRUB on a BIOS system
$ sudo grub-install [/dev/device]
copy
Install GRUB on a BIOS system with specific architecture
$ sudo grub-install --target i386-pc [/dev/device]
copy
Install GRUB on an UEFI system
$ sudo grub-install --efi-directory [/path/to/efi]
copy
Install GRUB on UEFI with architecture and bootloader ID
$ sudo grub-install --target x86_64-efi --efi-directory [/path/to/efi] --bootloader-id GRUB
copy
Install GRUB pre-loading specific modules
$ sudo grub-install --target x86_64-efi --efi-directory [/path/to/efi] --modules "part_gpt part_msdos"
copy
Display help
$ grub-install --help
copy

SYNOPSIS

grub-install [options] device

DESCRIPTION

grub-install installs the GRUB bootloader to a disk device or EFI System Partition. The installation method differs between BIOS/legacy and UEFI systems.For BIOS systems, GRUB is installed to the Master Boot Record (MBR) or a BIOS Boot Partition on GPT disks. For UEFI systems, GRUB is installed to the EFI System Partition (ESP), and the --bootloader-id option sets the name shown in the UEFI boot menu.After installation, run grub-mkconfig to generate the configuration file.

PARAMETERS

--target PLATFORM

Installation target: i386-pc (BIOS), x86_64-efi, i386-efi, arm-efi
--efi-directory DIR
EFI System Partition mount point
--bootloader-id ID
Boot manager identifier in EFI menu
--boot-directory DIR
Directory containing boot files (default: /boot)
--modules MODULES
Pre-load specified GRUB modules
--recheck
Delete device map and regenerate
--removable
Install to removable media path
--force
Install even if problems detected

INSTALL

sudo apt install grub2-common
copy
sudo dnf install grub2-common
copy
sudo pacman -S grub
copy
sudo apk add grub
copy
sudo zypper install grub2-common
copy

CAVEATS

Requires root privileges. Incorrect installation can make system unbootable - have recovery media ready. UEFI installation requires the ESP to be mounted. Secure Boot may require signed GRUB binaries.

HISTORY

GRUB 2 grub-install replaced the older GRUB Legacy installation method around 2009. It supports modern features like GPT partition tables, UEFI, and modular design.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid