Hi, On Tue, Sep 10, 2024 at 03:58:58PM +0200, Florent Rougon wrote: > Le 09/09/2024, Andy Smith <a...@strugglers.net> a écrit: > > Can I simply copy the first 512 bytes of sdb to the start of sda? > > I would not do this, one of the reasons being that AFAICT, the start > offsets of the (up to 4) primary partitions of each drive are among > these bytes.
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 > I'd rather 'dpkg-reconfigure grub-pc' where you can IIRC select > the drives to act on (it will remember your selection, so in case > you don't select sdb in the debconf dialog for fear of breaking > it, next time GRUB is updated on that system, your sdb GRUB > installation would become out-of-date). Of course, I am assuming > the computer boots with BIOS, not UEFI. 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? > Out of curiosity, I skimmed through [1] and computed the offsets of your > "GRUB " strings as they would be found in memory when the code is run at > boot (adding 7C00h, AFAIUI). I found 7D88h for your sda and 7D80h for > your sdb, none of which matches the values at [1] under heading > “Location of the GRUB ID String and Error Messages in Memory”. Thus, my > understanding is that both of your MBRs were probably written by GRUB 2 > (I wanted to check if maybe one had been written by GRUB 1 and the other > by GRUB 2). 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. Thanks for the info! Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting