Trying to make an USB with full installed Linux distros, I've landed on a bunch of pages (like this: How can I repair grub? (How to get Ubuntu back after installing Windows?) ) explaining how to install/reinstall grub on a device.
Trying to understand the procedures and methods, some questions raised:
- How
grub-install
command knows where to find (partitions of) O.S.s to boot?
I saw that - f.e. using a Linux USB live drive - we mount one of the partitions of the device where we want to install Grub and with the command: for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
we mount all the directory grub-install needs to locate all the O.S. installed on all the recognized devices (as all the devices under the /dev/ directory should be taken into consideration). Did I got it the right way? I also thought that, once you mount and set up everything, grub-install creates a configuration which tells grub where the O.S. to boot are located on the device... Is that right? Is this configuration manually editable after the installation (e.g. Install a new S.O. and manually adding its boot instructions into grub configuration)?
- What are the exact differences among grub-pc
, grub-efi
and grub-legacy
packages?
I know that grub can be installed both for legacy boot (boot with BIOS from MBR) and for EFI boot; but I also noticed that grub-install command, which you can launch after the installation of one among grub-pc
, grub-efi
and grub-legacy
packages, have the --efi-directory
parameter. This parameter allows you to specify where the ESP partition is mounted on the running system and, therefore, I think it allows to install Grub in EFI boot mode... Is this right? Does this mean that I can install Grub in EFI or BIOS mode with any of these packages? If yes, how? How can I specify that I want to install Grub in Bios or EFI mode with grub-install after the installation of one of these packages?
Moreover, I noticed that it seems you can install only one of these packages (if you already have one and try to install a different one with aptitude, aptitude marks the currently installed package for removal), why this happens?
Asked by ela
(161 rep)
Apr 18, 2021, 10:03 PM
Last activity: Apr 19, 2021, 02:09 PM
Last activity: Apr 19, 2021, 02:09 PM