On Sat 26 Oct 2024 at 20:55:11 (-0700), pe...@easthope.ca wrote:
> Tim & all,
> 
>     From: Tim Woodall <debianu...@woodall.me.uk>
>     Date: Fri, 25 Oct 2024 22:35:50 +0100 (BST)
> > It's possibly not reading the grub.cfg you think it is reading.  I've
> > hit this problem before - IIRC grub uses the grub.cfg from the *first*
> > place it finds one - this can even be a partition (or in my case a LV)
> > that is not used anywhere on any system.
> 
> That's it!  The working system is in (hd0,gpt1) and update-grub2 was 
> updating (hd0,gpt1)/boot/grub/grub.cfg. Grub2 was displaying the menu 
> according to (hd0,gpt2)/boot/grub/grub.cfg which hadn't changed since
> an earlier installation.

That earlier installation is presumably the bookworm that
wrote (hd0,gpt2)/boot/grub/grub.cfg with the Grub deb12u1,
which I pointed out in my first post, but wasn't confirmed
by your follow-up.

> Therefore booted into (hd0,gpt1), as usual, and execute "grub-install 
> /dev/sda". The fresh grub refers to (hd0,gpt1)/boot/grub/grub.cfg 
> which has the stanza from (hd0,gpt1)/etc/grub.d/40_custom as intended.
> 
> After that, a further problem.  The grub ls command didn't show the 
> USB attached drive containing the Void Linux system.  A Web search 
> found mention of grub command nativedisk which I added.  

I don't know anything about nativedisk or the distinctions between
various types of driver.

> cat /etc/grub.d/40_custom
> #!/bin/sh
> exec tail -n +3 $0
> # This file provides an easy way to add custom menu entries.  Simply type the
> # menu entries you want to add after this comment.  Be careful not to change
> # the 'exec tail' line above.
> #
> menuentry "Void linux"{
>   insmod part_gpt
>   insmod ext2
>   echo 'Grub is running nativedisk to allow access to a USB store.'
>   nativedisk
>   echo 'These disks are accessible.'
>   ls
>   echo 'Setting root part.'
>   set root='(usb2,gpt6)'
>   echo 'Booting Linux.'
>   linux /boot/vmlinuz-6.6.56_2 root=UUID=e5c7eb47-8d4c-49da-9038-09c27e8e8990 
> ro
>   echo    'Loading ramdisk.'
>   initrd  /boot/initramfs-6.6.56_2.img
> }
> 
> The USB attached drive was then reported by grub2 ls.  Then another 
> problem.  Appears the drive doesn't respond quickly enough for the 
> linux command to succeed.  Grub2 shows this.
> ...
> Booting Linux.
> error: error communication with USB Mass Storage device.
> Loading ramdisk.
> error: you need to load the kernel first.
> 
> Press any key to continue...
> 
> A bug in grub2 nativedisk?  The USB 2.0 adapter is too slow?  Replace 
> with a USB 3 adapter?
> 
> This setup is needed only to configure the USB connected system. When 
> working, the drive will be installed in another machine. Currently 
> speed isn't required.  Any ideas for a software solution?  

AIUI Grub needs to be small in order to fit in the nooks and cranies
where it secretes itself (unless you give it a BIOS Boot Partition).
I imagine that when Grub is installed, it makes sure it provides the
modules needed to communicate with all the partitions that it will
need to when it is asked to boot them, and perhaps no more.

But if you install Grub without running os-prober, it might not know
to add the appropriate modules in Void's menuentry. So I would try
booting into Grub, selecting the Void menuentry, typing E, and adding
insmod lines for usb… modules there are, before you exit and
type Return. Perhaps filesystem modules too.

OTO you could just let os-prober run when you build Grub and let it
do the job for you. Is there any reason why you don't want to run
os-prober? Sorry, I'm repeating myself.

Cheers,
David.

Reply via email to