Menu

Convert GPT disk image to format usable by Clonezilla

2024-08-16
2024-08-25
  • Will Thompson

    Will Thompson - 2024-08-16

    Hi,

    I work on Endless OS, a Linux distribution. Our installation media is
    simply a GPT disk image which is written with dd (or equivalent) to the
    target hard disk. On first boot, the OS resizes its partition to fill the
    disk and randomises the disk and filesystem UUIDs.

    It is common for our deployment partners to ask us whether they can use
    Clonezilla to install Endless OS. Typically they already have Clonezilla
    set up with PXE booting etc. and are practiced at using this to install
    other operating systems to a large number of systems.

    At the moment the best known method is to install Endless OS to one source
    device, then boot Clonezilla on that device to capture a disk image. The
    deployment partner must take great care to not boot the source device
    before taking the Clonezilla disk image, or else all devices onto which the
    captured image is restored will have the same disk UUID and machine ID. One
    also needs to take great care to configure Clonezilla to take a direct disk
    image and not make any changes to the GRUB configuration etc.

    This is an error-prone process and seems wasteful. Is there a way to
    convert a raw GPT disk image (typically compressed with .gz or .xz) to
    Clonezilla's format, "offline", without having to install the source image
    to a device first then read it back from disk? We haven't been able to find
    a documented way to do this.

    Thanks,

    – Will

     
  • Steven Shiau

    Steven Shiau - 2024-08-25

    "a raw GPT disk image" is the dd image file you mention?
    If so, actually this is no such tool exists. However, there is one program (bash script) you can refer to:
    /usr/sbin/ocs-img-2-vdk
    This program actually uses qemu/kvm to convert the Clonezilla image to a virtual disk. It's likely you can write a similar tool based on this and qemu/kvm.
    //NOTE// Actually the program ocs-img-2-vdk is not actively maintained... We haven't used it for a long time, and no one reported it's working or not for the past few years.
    If you have developed such a program, please share that, and if you agree, we can include that in Clonezilla in the future.
    Thanks.

    Steven

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.