0

due to limitation in infrastructure, I cannot boot any VM from any ISO file, specifically I need gparted and clonezilla.

In a CentOS 7 test installation, I can do something like:

 in /etc/grub.d/40_custom

menuentry 'clonezilla' {
 set isofile="/clonezilla.iso"
 loopback loop (hd0,1)$isofile
     linux (loop)/live/vmlinuz boot=live config nolocales edd=on nomodeset noprompt ocs_live_extra_param="" keyboard-layouts="NONE" ocs_live_batch="no" locales="en_US.UTF-8" net.ifnames=0 vga=788 ip=frommedia toram=filesystem.squashfs union=overlay nosplash findiso="$isofile"
     initrd (loop)/live/initrd.img
}

Then copy the clonezilla.iso file under /boot. This is working perfect. Problem is that in all VM I have (RedHat 7) there is no space under boot and Clonezilla is 422MB, and doesn't fit into /boot partition.

/dev/sda1                          485M  258M  202M  57% /boot

Is there any other way to boot Clonezilla/Gparted ISO from GRUB? Maybe copying under /root or / (LVM partition)?

/dev/mapper/lvm01-root.vol         5.9G  3.7G  2.3G  62% /

Thank you Lucas

EDIT:

Thanks to @Tom Yan for advice. Now I'm able to boot the ISO, but unfortunately clonezilla, after a few seconds, reports the following error: "Unable to find a medum containing a live file system"

menuentry "Clonezilla" {      
insmod lvm
set root='hd0,5'
ISO="/clonezilla.iso"                    
search --set -f $ISO
loopback loop $ISO
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components findiso=$ISO
initrd (loop)/live/initrd.img
}
6
  • Maybe all you need is insmod lvm (and changing "root" with e.g. search -s, course; the default "root" is what the /boot/ was when grub-install was performed.)
    – Tom Yan
    Commented Jun 2 at 8:58
  • Remove (hd0,1) before $isofile when you have "root" properly set/changed, btw. (You probably never needed it there anyway. And it's fragile.)
    – Tom Yan
    Commented Jun 2 at 9:05
  • Thanks, Tom Yan, I edited my first post with my progress. Now I'm able to boot the iso, but I'm stuck with a clonezilla error.
    – Lucas Rey
    Commented Jun 2 at 9:27
  • No idea. The truth is AFAIK, not all ISOs supports being booted from grub like this. An ISO that does would need to be able to detect / accept input of which device contains the filesystem that holds the ISO and the path of the ISO (relative to the root of that filesystem). This also means that in your case the kernel / initramfs would need to have support for and kicks off LVM stuff beforehand. (It's a bit more complicated than just insmod lvm once you are out of the grub context.)
    – Tom Yan
    Commented Jun 2 at 9:53
  • 1
    Yeah that's why I mentioned the LVM part. Very likely the problem was that the ISO doesn't really expect itself to resides in an LV. It seems that it would try to "scan all possible devices", but without kicking off the LVM stuff, the LV wouldn't be in that list.
    – Tom Yan
    Commented Jun 2 at 10:04

0

You must log in to answer this question.

Browse other questions tagged .