Can anyone provide a clear explanation what the root directory is for grub-install
and when to use it?
2 Answers
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.
-
1An 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. Aug 4, 2016 at 22:03
-
5Apparently the
grub-install
of the original grub had the option--root-directory
, butgrub-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. Aug 4, 2016 at 22:07 -
1
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
.
grub-install
doesn't need the root directory at all.Pattern not found (press RETURN)
at least in my version (1.99-27+deb7u2)