• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

grub2-install: command not found

by admin

The grub2-install command is used to install the GRUB 2 boot loader on a storage device. It copies GRUB 2 files into the /boot/grub2 directory and, on some platforms, installs GRUB 2 into the boot sector. However, grub2-install applies to BIOS systems, not UEFI. To install GRUB 2 on a UEFI system, use a package manager to install the grub2-efi package. Installing this package will copy GRUB 2 files onto the EFI system partition (ESP) in the /boot/efi directory.

Syntax

The syntax of the grub2-install command is:

# grub2-install [options] [device name]

The following are some options you can use with the grub2-install command:

Option Description
–modules {module names} Preload the specified kernel modules with the GRUB 2 boot loader.
—install-modules {module names} Install only the specified modules and their dependencies, rather than the default of installing all available modules.
—directory {directory name} Install files from the specified directory, rather than the default.
–target {target platform} Specify the target platform to install GRUB 2 for, rather than the platform that is currently running.
—boot-directory {directory name} Specify the boot directory to install GRUB 2 files to, rather than the default /boot/ directory.
–force Install GRUB 2 regardless of detected issues.

If you encounter below error while running the the grub2-install command:

grub2-install: command not found

you may try installing the below package:

# dnf install grub2-tools-1

Conclusion

Typically the bootloader is installed during the boot process, but it is possible that the bootloader could become corrupt and need to be reinstalled. To install the bootloader, execute the grub-install command and provide the device where you want to install GRUB.

Filed Under: Linux

Some more articles you might also be interested in …

  1. Order of environment calls for different OS shells in Linux
  2. named-checkconf: command not found
  3. How to Map Static IP to your Domain (with GoDaddy example)
  4. How to configure NTP server and client in CentOS / RHEL 7
  5. How to recover from deleted root entry in /etc/shadow and/or /etc/passwd files in CentOS / RHEL 6
  6. fail2ban-client Command Examples in Linux
  7. MySQL Server Error – “Can’t Create A New Thread (errno 11)”
  8. Auditd Messages Are Filling Up /var/log/messages
  9. qjoypad Command Examples in Linux
  10. How to Install default-libmysqlclient-dev software package in Debian

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright