Grub-install: what's the root directory

9,537

Solution 1

The root directory is just what it says: your root directory, i.e /. If you are running grub-install while booted from some other medium and have your normal root directory mounted somewhere other than /, then you want to specify this argument to point it to your root directory.

Solution 2

I'm not too much of an expert about GRUB, but as far as I know, the root directory for GRUB it's the directory where you can install a working GRUB when you have started your system in recovery mode:

grub-install –-root-directory=/test/kernelimage /dev/sda

Here the root directory contains an image of the Linux kernel to boot, and must also contain a directory /boot/grub.

Share:
9,537

Related videos on Youtube

Author by

ThatsMe

Updated on September 18, 2022

Comments

  • ThatsMe 5 months

    Can anyone provide a clear explanation what the root directory is for grub-install and when to use it?

    • YoMismo
      YoMismo almost 8 years
      Did you mean boot directory? grub-install doesn't need the root directory at all.
    • ThatsMe almost 8 years
      @YoMismo No, I meant root directory. See man
    • YoMismo
      YoMismo almost 8 years
      I did, root search returns: Pattern not found (press RETURN) at least in my version (1.99-27+deb7u2)
  • David Tonhofer
    David Tonhofer over 6 years
    An nice explanation is here: "The --root-directory=/x option tells grub where to look for the grub directory during the installation process. The grub directory is /x/boot/grub on typical distributions such as Ubuntu and Debian, but may be /x/grub on some *bsd setups. ... the inode of interest will be reached by the path "/x" during the installation process. Grub assumes this inode will be reached by the simple path "/" later .... This distinction is, alas, not well documented.
  • David Tonhofer
    David Tonhofer over 6 years
    Apparently the grub-install of the original grub had the option --root-directory, but grub-install of grub2 has option --boot-directory: --boot-directory=DIR: Use DIR as the boot directory. The default is /boot. GRUB will put its files in a subdirectory of this directory named grub.
  • SebMa
    SebMa almost 3 years
    @DavidTonhofer You should convert your comment to an answer :)