Linux Commands Examples

A great documentation place for Linux commands


install GRUB to a device

see also : grub-mkconfig - grub-mkimage - grub-mkrescue


grub-install [OPTION] [INSTALL_DEVICE]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


sudo grub-install --no-floppy /dev/sda3 --force && sudo update-grub2
if [ "$DISK" ]; then
grub-install /dev/sda > $LOGFILE
grub-install /dev/hda > $LOGFILE
echo "Se a guardado un registro de la operacion en $LOGFILE"
echo "chroot /mnt grub-install --force $hdPath"
echo "chroot /mnt update-grub"
chroot /mnt grub-install --force $hdPath
$ROOTCMD grub-install --no-floppy "(hd0)"
exit $error


Install GRUB on your drive.
, --help

print this message and exit

-v, --version

print the version information and exit


pre-load specified modules MODULES


install GRUB images under the directory DIR/grub instead of the /boot/grub directory


install GRUB for TARGET platform [default=current]


use GRUB images from DIR. Takes precedence over target


use FILE as grub-setup


use FILE as grub-mkimage


use FILE as grub-mkrelpath


use FILE as grub-probe


make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes.


delete device map if it already exists


install even if problems are detected


use identifier file even if UUID is available


disk module to use (biosdisk or native). This option is only available on BIOS target.


don’t update the ’boot-device’ NVRAM variable. This option is only available on IEEE1275 targets.


the installation device is removable. This option is only available on EFI.


the ID of bootloader. This option is only available on EFI.


use DIR as the EFI System Partition root.


install an image usable with UEFI Secure Boot. This option is only available on EFI and if the grub-efi-amd64-signed package is installed.


do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.

INSTALL_DEVICE must be system device filename.

grub-install copies GRUB images into /boot/grub, and uses grub-setup to install grub into the boot sector.

reporting bugs

Report bugs to <bug-grub[:at:]gnu[:dot:]org>.

see also

grub-mkconfig , grub-mkimage , grub-setup, grub-mkrescue

The full documentation for grub-install is maintained as a Texinfo manual. If the info and grub-install programs are properly installed at your site, the command

info grub-install

should give you access to the complete manual.

How can this site be more helpful to YOU ?

give  feedback