Categories
Linux Mastering Development

how to chainload from image file which contain multiple partitions?

I have a disk images:

Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  262MB  261MB  fat16        MemTest86             legacy_boot, msftdata
 2      263MB   524MB  261MB  fat16        EFI System Partition  boot, esp

In grub console I did:

loopback loop (some partition)/memtest.img

ls correctly show 2 partition (loop,gpt2) and (loop,gpt1)
ls (loop,gpt2)/efi/boot/ show:

Benchmark  blacklist.cfg  BOOTIA32.efi  BOOTX64.efi  mt86.png  unifont.bin

However, if I do following, it gives error not a valid root device

root=(loop,gpt2)
chainloader (loop,gpt2)/efi/boot/BOOTX64.efi

What else I need to do to correctly chainload the bootloader?

Leave a Reply

Your email address will not be published. Required fields are marked *