On Sun, Jul 9, 2023 at 8:16 PM Hongyi Zhao <[email protected]> wrote: > > On Sun, Jul 9, 2023 at 6:47 PM Andrei Borzenkov <[email protected]> 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
