grub-install
system managementLinux
The grub-install command is one of the most frequently used commands in Linux/Unix-like operating systems. grub-install Install GRUB bootloader on a device
Quick Reference
Command Name:
grub-install
Category:
system management
Platform:
Linux
Basic Usage:
grub-install [options] [arguments]
Common Use Cases
Syntax
grub-install [options] [--target=target] [device]
Options
Option | Description |
---|---|
--target=TARGET |
Install GRUB for TARGET platform [default=i386-pc] |
--boot-directory=DIR |
Install GRUB images under the directory DIR/grub instead of the default /boot/grub |
--efi-directory=DIR |
Use DIR as the EFI System Partition root |
--bootloader-id=ID |
The ID of bootloader for EFI or Macs. The default is 'grub' |
--removable |
Install GRUB for removable media (for EFI only) |
--recheck |
Delete device map if it already exists |
--force |
Install even if problems are detected |
--allow-floppy |
Make the drive also bootable as a floppy (default for fdX devices) |
--modules=MODULES |
Pre-load specified modules MODULES |
--no-nvram |
Don't update the NVRAM (for EFI only) |
--no-bootsector |
Don't install bootsector |
--help |
Display help information and exit |
--version |
Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the grub-install
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
grub-install /dev/sda