PDA

View Full Version : Booting kali ISO file on LVM partition through GRUB



maretodoric
2019-04-30, 19:29
Greetings everyone,

I would like to create a GRUB menu entry that would allow me to boot kali through by GRUB reading the ISO file directly from HDD.
ISO is located on an LVM partition. I've tried lots of different ways to create menu entry, basically, i can load kernel and initrd from ISO but cannot load LIVE and mount LIVE from ISO file. The most recent settings I've tried is this:


menuentry "Kali Live ISO" --class gnu-linux { insmod lvm
insmod ext2
insmod gzio




set vg='Fedora'
set lv='root'
set root='lvmid/2QDhix-cN7c-rCkJ-Fhgm-g2B3-9npK-KsCy4a/JHgX9G-PYvc-59Ub-kBMo-Wisv-pr5m-OG0mj8'
search --no-floppy --fs-uuid --set=root --hint=${root} 29e2f518-5fad-49c9-90ef-966b0c033c5e
set isofile="/ISO/kali-linux-2019.1a-amd64.iso"
echo "Using ${isofile}..."
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live iso-scan/filename=${isofile} noconfig=sudo username=root hostname=kali
initrd (loop)/live/initrd.img
}

What i remember that I've also tried is this as well




menuentry "Kali LIVE ISO" --class os --class gnu-linux --class gnu --class os --group group_main {
set iso="/ISO/kali-linux-2019.1a-amd64.iso"


insmod part_msdos
insmod ext2
insmod loopback
insmod iso9660
insmod lvm


loopback loop (lvm/Fedora-root)$iso
search --no-floppy --fs-uuid --set=root 29e2f518-5fad-49c9-90ef-966b0c033c5e
linux (loop)/live/vmlinuz boot=live fromiso=/dev/mapper/Fedora-root/$iso noconfig=sudo username=root hostname=kali
initrd (loop)/live/initrd.img
}


The uuid listed in both cases is the UUID of /dev/mapper/Fedora-root where ISO file is located.
I don't know what else could i try. Does anyone have any idea and can provide help on this one ?