Le 10/09/2024, Andy Smith <a...@strugglers.net> a écrit:

> Good point. I understand the bootloader is actually the first 446
> bytes so maybe I should only be looking at these.
>
>     https://unix.stackexchange.com/a/254668/36243
The partition table indeed starts at offset 446 (decimal), however I'd
still rather run grub-install or “dpkg-reconfigure grub-pc” than copy
the first 446 bytes from one drive to another drive. The reason is that,
AFAIUI, what GRUB writes in this area when installed is likely to
contain disc-specific info. More specifically, according to [1]:

  There isn't room for much function in the 446 bytes available for
  executable code in the boot sector. The sole function of this stage1
  code is to load the much larger stage2 boot program. When stage1 is
  installed in the MBR, it is configured with the BIOS drive number and
  the absolute LBA of the first sector of the stage2 file in the boot
  partition. It loads that one sector into a fixed location in memory
  and transfers control to it. (...)

> Yes, this machine boots with BIOS and MBR.
>
> To keep such machines (BIOS boot, multiple boot drives, MD RAID for
> redundancy once booted) in good booting health are people doing
> anything more sophisticated than remembering to run "dpkg-reconfigure
> grub-pc" and install grub to all boot drives any time grub-pc is
> updated?

That's what I've been doing for a bit more than 20 years (before
switching to UEFI), but that was only my home machine.

> THis machine dates from 2016 and whatever was Debian stable at that
> time. It will have been dist-upgrade as far as 10 (buster) after
> that. As far as I;m aware the drives are the same as it was first
> installed with.

These dates seem consistent with my guess that this is probably GRUB 2
that was installed to your MBRs.

> Thanks for the info!

You're welcome. Hope someone with more experience chimes in. Good luck
in any case. :)

Regards

[1] 
https://www.linuxquestions.org/questions/linux-general-1/help-understand-446-bytes-of-boot-code-in-mbr-4175500398/#post5146305

-- 
Florent

Reply via email to