help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debug grub scripts without rebooting into grub shell.


From: Hongyi Zhao
Subject: Re: Debug grub scripts without rebooting into grub shell.
Date: Sun, 9 Jul 2023 20:45:49 +0800

On Sun, Jul 9, 2023 at 8:16 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sun, Jul 9, 2023 at 6:47 PM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> >
> > On 09.07.2023 12:26, Hongyi Zhao wrote:
> > ...
> > >>>>
> > >>>> You create device.map and give names hd0, hd1, ... to your devices.
> > >>>
> > >>> See below:
> > >>>
> > >>> werner@X10DAi:~$ sudo grub-mkdevicemap -n
> > >>> werner@X10DAi:~$ cat /boot/grub/device.map
> > >>> (hd0)    /dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00B00_S677NF0R503706
> > >>> (hd1)    /dev/disk/by-id/ata-WDC_WDS100T2B0A-00SM50_191533467906
> > >>>
> > >>> Now, I see the following devices in grub-emu:
> > >>>
> > >>> grub> ls
> > >>> (proc) (hd0) (hd1) (host)
> > >>>
> > >>> But how to access the corresponding partitions on these devices?
> > >>>
> > >>
> > >> Did you try to load partition driver?
> > >
> > > I tried as follows, but still failed to see the partitions:
> > >
> > > grub> insmod lvm fat ntfs part_msdos part_gpt ext2 btrfs
> > > grub> ls
> > > (proc) (hd0) (hd1) (host)
> > >
> > > Any more hints?
> > >
> >
> > Are you running grub-emu as root or your normal user?
>
> Normal user.
>
> Thanks for your tip. Switch to root does the trick:
>
> werner@X10DAi:~$ sudo grub-emu
>
> grub> ls
> (proc) (hd0) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1) 
> (host
> )

Though under the root user, I can list all partitions, but I still
cannot see any loaded partition related modules/drivers:

grub> ls
(proc) (hd0) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1) (host)
grub> lsmod
Name    Ref Count       Dependencies

So I still puzzled by your previous hint: "Did you try to load
partition driver?"

Regards,
Zhao

> BTW, how to change the background color of grub-emu's console? I don't
> want it to reset the background color of the terminal from which I
> issue the grub-emu command. Is this possible?
>
> Regards,
> Zhao



reply via email to

[Prev in Thread] Current Thread [Next in Thread]