How to boot loopback devices in GRUB?

szyszqu

New Member
Joined
Mar 13, 2023
Messages
1
Reaction score
0
Credits
16
Hi,
For a long time now I've tried to do something like this:
Get a pendrive and format it to something like fat, only for grub. Make some files from /dev/zero there and format them to ext4 so I can put my systems there and then just boot them as loopback devices. I think I'm on a good way for now, but there's only one problem. My grub.cfg looks something like this:
insmod part_msdos
insmod fat
insmod ext2
search --no-floppy --set=root --fs-uuid {uuid}
loopback loop /linux.ext4
linux (loop)/boot/vmlinuz-linux
initrd (loop)/boot/initramfs-linux.img

But there's a small problem. You have to put a fs uuid after Linux kernel. But I don't know what uuid it'll be since this is a loop file. Does anyone know a solution?
 

Members online


Latest posts

Top