Linux Commands Examples

A great documentation place for Linux commands

grub-install

install GRUB to a device


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

Synopsis

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!

examples

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

description

Install GRUB on your drive.
-h
, --help

print this message and exit

-v, --version

print the version information and exit

--modules=MODULES

pre-load specified modules MODULES

--boot-directory=DIR

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

--target=TARGET

install GRUB for TARGET platform [default=current]

--directory=DIR

use GRUB images from DIR. Takes precedence over target

--grub-setup=FILE

use FILE as grub-setup

--grub-mkimage=FILE

use FILE as grub-mkimage

--grub-mkrelpath=FILE

use FILE as grub-mkrelpath

--grub-probe=FILE

use FILE as grub-probe

--allow-floppy

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

--recheck

delete device map if it already exists

--force

install even if problems are detected

--force-file-id

use identifier file even if UUID is available

--disk-module=MODULE

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

--no-nvram

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

--removable

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

--bootloader-id=ID

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

--efi-directory=DIR

use DIR as the EFI System Partition root.

--uefi-secure-boot

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.

--no-uefi-secure-boot

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