On Fri, Nov 22, 2019 at 10:40:18PM +0100, Pascal Hambourg wrote: > > > Le 22/11/2019 à 18:08, Chris Green a écrit : > > > > grub-install installs the 'invisible' bits of grub like the MBR and > > the code executed after the MBR. These reside on parts of the disk > > that one can't normally 'see'. > > Yes. They are called the boot image and the core image, which must reside on > the same disk. grub-install also installs GRUB modules in /boot (by default) > or in the location specified with --boot-directory. > > > They are installed, by default, on the 'first' hard disk. > > No, there is no default location for the boot image and core image. Anyway > "first hard disk" is meaningless. First for what ? The BIOS ? Linux ? > So how does it decide? ... or at least how does, for example, an Ubuntu install decide?
> > There only needs to be one set of these 'bits', > > But there can be as many as you want, in every disk and every partition. > Yes, I see that, one can install them on every drive but which gets run at boot time then? > > grub-mkconfig (or update-grub on ubuntu etc.) creates the grub > > configuration file and other stuff that resides in the /boot > > directory. > > No, grub-mkconfig/update-grub generates only the configuration file > /boot/grub/grub.cfg. Other GRUB files are installed by grub-install. > OK > > What I still don't quite understand is what happens with (as I have) > > more than one OS installed. Presumably only one grub.cfg gets used > > even though there is more than one. How does the initial boot process > > (starting with MBR etc.) and created by grub-install decide which > > /boot it should use (and is it easy to change which /boot it goes to?). > > The BIOS boots one drive. Its MBR contains a GRUB boot image which loads and > runs the core image of the same installation, which loads modules and > configuration files from the same installation. > But someone said it doesn't matter which drive is marked as the boot drive, how does the BIOS decide which drive to boot from? -- Chris Green