• 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. What are Reserved User Accounts in MySQL
  2. How to control resource (cgroup) with systemd for user process group in CentOS/RHEL 7
  3. cloud-init Command Examples in Linux
  4. How to Create a New /boot Partition in CentOS / RHEL
  5. How to use Magic SysRq tool in CentOS / RHEL
  6. “BAD PASSWD : is too simple” – error during password change in CentOS/RHEL 7 and 8
  7. lsns Command Examples in Linux
  8. dar Command Examples in Linux
  9. dolphin: command not found
  10. chpasswd Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright