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:16:20 +0800

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
)

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]