On Thu, Sep 12, 2024 at 01:21:12AM +0200, Florent Rougon wrote: > Hi, > > Le 11/09/2024, Andy Smith <a...@strugglers.net> a écrit: > > > Since booting from sdb wasn't working in any case, I thought I'd > > experiment a bit. I copied the first 446 bytes of sda to sdb. This > > made matters worse! Instead of a "grub> " prompt, I just got a blank > > screen. > > > > I then rebooted from sda and did: > > I believe “sda” and “sdb” are swapped with respect to your first > message. Of course, it's expected that these are not stable across > reboots, however it's a bit confusing for me here.
Yes, sorry. I actually have two machines like this I am looking at, where one of them seems to have an older (non-working) grub on sda and current grub on sdb, while the other has current grub on sds and no grub at all on sdb. I tried to simplify by only talking about one of these here, but ended up confusing myself several times over which one I was getting info from. Anyway. Copying the 446 bytes so as to make sda and sdb identical did not work, as described. Then doing "dpkg-reconfigure grub-pc" did result in working boot from either drive. > The special value 0xFF is the one you had on both of your drives and > means “use the boot drive” Okay, that is good to know, thanks! > In any case, stage 1 can load some “stage 1.5” from “empty sectors (if > available) between the MBR and the first partition”. These sectors > wouldn't by synchronized by MD RAID, unless you're using it on the whole > drives—as opposed to partition by partition. I don't claim that “this is > it”, but this might explain some difference between your drives' booting > behavior, even with identical: > - stage1 code+data in the MBR; > - boot partitions' start offset and contents. Sounds very plausible. The MD arrays are just made of partitions, and the first partitions for /boot start at 2048 (512 byte) sectors in. So, there's more grub data at different places in that first 1MiB of each boot disk. As some of it could be copied and some not, it sounds like I should not try to fix this again with dd and instead stick to reconfiguring grub-pc. > > Not understanding quite what is going on is worrying to me, even if > > things do now work. 🙁 > > I just hope I didn't confuse you more. :-) It was very helpful, thanks again! Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting