Start Clonezilla/grub from encrypted partition

I’m striving to start clonezilla/gparted (I will always talk about clonezilla, but it is the same issue) with grub with the live-hd configuration (so basically from the boot partition on /dev/sda3 but encrypted with luks)

Few things :

  • All my system is encrypted, there is a specific partition for /boot folder, the partition is crypted with LUKS 1 , not in a LVM
  • I want the Clonezilla system to be pushed in RAM, to allow modification on all partitions

I tried many things provided by the Clonezilla website without success.

My best try was stopped by an error telling that the live medium could not be found.

How can I manage to get Clonezilla started and to RAM ?

Here is some info on my configuration :

mc2@MERCURE:~$ sudo blkid
/dev/sda1: TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="17a760ce-5299-42b0-8281-3c0820d20aa6"
/dev/sda2: UUID="e6ad004e-e459-4ae5-bbfd-cd860061518c" TYPE="apfs" PARTLABEL="macOS" PARTUUID="fb078942-ab18-422f-88d6-81da561d23b1"
/dev/sda3: UUID="aa6df7fe-3a05-45f9-87c4-fda78d76bd3f" TYPE="crypto_LUKS" PARTUUID="bbdb077e-f66d-425e-83fc-2d1b33d871a5"
/dev/sda4: UUID="317c209a-dbde-42c1-b357-e5ec0c80d33f" TYPE="crypto_LUKS" PARTUUID="1cb43c35-f760-b44d-be7d-f51fb898fb92"
/dev/sdb1: LABEL="ESP" UUID="3829-4DAD" TYPE="vfat" PARTUUID="8073951c-e777-48ab-8eec-1c054b33a830"
/dev/sdb3: TYPE="BitLocker" PARTLABEL="Basi" PARTUUID="2a8c1a94-28c9-4a3e-bd5b-bb28fb92d981"
/dev/sdb4: LABEL="Recovery" UUID="4ECA2AABCA2A8F71" TYPE="ntfs" PARTLABEL="Basi" PARTUUID="9e709953-6dfa-4578-9445-c54f0cadfe69"
/dev/mapper/LINUX: UUID="AyD1SN-yVTw-T78Q-YjJE-fdYw-HiEE-R64qOL" TYPE="LVM2_member"
/dev/mapper/LINUX-DEBIAN: UUID="6e972e95-7d3e-49b3-9559-7f9560bf2d74" TYPE="ext4"
/dev/mapper/LINUX-SWAP: UUID="192ac298-9303-4d13-ac72-93539273134d" TYPE="swap"
/dev/sdb2: PARTLABEL="Micr" PARTUUID="a2ff8df1-7eec-421c-b634-2f4534e1c971"
/dev/loop0: LABEL="Acer" UUID="646C2A0E6C29DB94" TYPE="ntfs"
/dev/loop1: LABEL="Data" UUID="0022AEDE22AED844" TYPE="ntfs"
/dev/loop2: TYPE="squashfs"
/dev/mapper/boot_crypt: UUID="2d4ab347-09dd-48a5-84ff-c1417411605b" TYPE="ext2"
mc2@MERCURE:~$ sudo cat /etc/grub.d/50_tools 
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Clonezilla" {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod cryptodisk
        insmod luks
        insmod gcry_rijndael
        insmod gcry_rijndael
        insmod gcry_sha256
        insmod ext2
        set isofile='/tools/clonezilla.iso'
        cryptomount -u aa6df7fe3a0545f987c4fda78d76bd3f
        set root='cryptouuid/aa6df7fe3a0545f987c4fda78d76bd3f'
        if [ x$feature_platform_search_hint = xy ]; then
                search --no-floppy --fs-uuid --set=root --hint='cryptouuid/aa6df7fe3a0545f987c4fda78d76bd3f'  2d4ab347-09dd-48a5-84ff-c1417411605b
        else
                search --no-floppy --fs-uuid --set=root 2d4ab347-09dd-48a5-84ff-c1417411605b
        fi
        search --set -f $isofile
        loopback loop $isofile
        linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts= ocs_live_batch=\"no\" locales= vga=788 ip=frommedia nosplash toram=live,syslinux,EFI findiso=$isofile
        initrd (loop)/live/initrd.img
}

menuentry "GParted" {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod cryptodisk
        insmod luks
        insmod gcry_rijndael
        insmod gcry_rijndael
        insmod gcry_sha256
        insmod ext2
        set isofile='/tools/gparted.iso'
        cryptomount -u aa6df7fe3a0545f987c4fda78d76bd3f
        set root='cryptouuid/aa6df7fe3a0545f987c4fda78d76bd3f'
        if [ x$feature_platform_search_hint = xy ]; then
                search --no-floppy --fs-uuid --set=root --hint='cryptouuid/aa6df7fe3a0545f987c4fda78d76bd3f'  2d4ab347-09dd-48a5-84ff-c1417411605b
        else
                search --no-floppy --fs-uuid --set=root 2d4ab347-09dd-48a5-84ff-c1417411605b
        fi
        search --set -f $isofile
        loopback loop $isofile
        linux (loop)/live/vmlinuz boot=live config union=overlay username=user components noswap noeject vga=788 ip= net.ifnames=0 toram=filesystem.squashfs findiso=$isofile
        initrd (loop)/live/initrd.img
}
mc2@MERCURE:~$ sudo ls /boot/tools
clonezilla.iso  gparted.iso
mc2@MERCURE:~$

Thanks



Read more here: https://stackoverflow.com/questions/67381030/start-clonezilla-grub-from-encrypted-partition

Content Attribution

This content was originally published by Dev0110 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: