0

On a Ubuntu 20.04 Server. How to setup grub so that it can boot on a recent Clonezilla image (ISO preferred, but also possible ZIP) ?

I've found great post here https://askubuntu.com/a/490206/30535 , that worked for me as as long as I don't use LVM.

Disk setup looks like this :

lsblk
sda                         8:0    0   40G  0 disk 
├─sda1                      8:1    0    1M  0 part 
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0   39G  0 part 
  └─ubuntu--vg-ubuntu--lv 253:0    0   39G  0 lvm  /
sr0                        11:0    1 1024M  0 rom  
df -h / /boot
Filesystem                         Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv   39G  6.5G   31G  18% /
/dev/sda2                          976M  199M  711M  22% /boot

The Ubuntu entry that works looks like this :

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-95cc5dff-ed40-9541-44e7-dca7da766a4c' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  6c60cf4b-a54a-4584-43b6-f1b83b7db110
    else
      search --no-floppy --fs-uuid --set=root 6c60cf4b-a54a-4584-43b6-f1b83b7db110
    fi
    linux   /vmlinuz-5.4.0-67-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  nosplash debug
    initrd  /initrd.img-5.4.0-67-generic
}

After adapting oldfred's suggestion to Clonezilla, I have this.

menuentry "Clonezilla live" {
    insmod part_gpt
    insmod lvm
    insmod ext2
    set root="lvm/ubuntu--vg-ubuntu--lv"
    search --no-floppy --fs-uuid --set=root --hint=${root} 6c60cf4b-a54a-4584-43b6-f1b83b7db110
    set isofile="(lvm/ubuntu--vg-ubuntu--lv)/clone_sys/clonezilla.iso"
    echo "Using ${isofile} ..."
    loopback loop $isofile
    linux (loop)/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_keymap=\"\" ocs_live_batch=\"no\" ocs_lang=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
}

Now, this boot, up to the message live-boot will now start a shell. The error message was : Unable to find a medium containing a live file system, leaving me in a (initramfs) console.

samb
  • 1,306

1 Answers1

0

I do not know nor use LVM. But have this in my notes for booting Fedora from LVM. You need to adjust for your path & ISO.

menuentry "Fedora 21 Live M6600" --class fedora {
    insmod part_gpt
    insmod lvm
    insmod ext2
    set vg='m6600'
    set lv='F21Live'
    set root="lvm/${vg}-${lv}"
    search --no-floppy --fs-uuid --set=root --hint=${root} 95e4eec8-c1de-4802-b821-5753de990cbe
    set isofile="/Fedora-Live-Workstation-x86_64-21-5.iso"
    echo "Using ${isofile}..."
    loopback loop $isofile
    linux (loop)/isolinux/vmlinuz0 iso-scan/filename=${isofile} root=live:CDLABEL=Fedora-Live-WS-x86_64-21-5 rootfstype=auto ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0 rd.auto=1
    initrd (loop)/isolinux/initrd0.img
}
oldfred
  • 12,100
  • Thank you oldfred, I've adapted to Clonezilla and tested. This is not a success yet, but it goes a bit further. See my update on the question. Regards – samb Mar 24 '21 at 08:41
  • I find getting path correct one of the bigger issues. It is path as seen before you boot or what you see without any mounts in fstab or automatically with browser. So if using live installer is your path correct? And I do not have path in set ISO command. ISO boot Examples but none with LVM, but otherwise similar one with clonezilla: https://help.ubuntu.com/community/Grub2/ISOBoot/Examples – oldfred Mar 24 '21 at 13:59