Clonezilla fix (yes, it's broken)

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Lolo Uila
Level 5
Level 5
Posts: 575
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Clonezilla fix (yes, it's broken)

Post by Lolo Uila »

I know most of you probably use Clonezilla from a live boot (Clonezilla-live, Parted Magic, etc.), but if you happen to try it from within Linux Mint 17.x LTS (or Ubuntu 14.04 LTS) it will not work. Examining the output and logs will reveal that Partclone aborts with an invalid option -z error. This is because we have an updated version of Clonezilla, but an old version of Partclone in the repos.

In Partclone 2.61 the option -m was replaced with -z and the version of Clonezilla we have is using that, but we still have Partclone 2.51 in the repos (which uses -m).

This is a well known and long-standing bug that it appears no one cares to fix. It has been fixed in later versions of Debian and Ubuntu, but those of us who use the Ubuntu 14.04 LTS based distros are stuck with the older Partclone.

There are two options to fix this.
1. Compile and install a newer version of Partclone.
2. Edit the /etc/drbl/drbl-ocs.conf file and replace -z with -m in the command options.

I opted for #2 since it seemed easier. There are 4 lines in the config file to change.

DEFAULT_PARTIMAGE_SAVE_OPT="-M -f3 -o -d -b -c -z0 --volume=0"

PARTCLONE_SAVE_OPT_INIT="-z 10485760"
PARTCLONE_RESTORE_OPT_INIT="-z 10485760"
PARTCLONE_RESTORE_ONTHEFLY_OPT_INIT="-z 10485760"

Find those and change -z to -m and it should work.

In case you're wondering, I ran into this bug while trying to clone bootable SD cards from Raspberry Pi computers.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Everyone thinks I'm crazy (except my friends deep inside the earth).
Lolo Uila
Level 5
Level 5
Posts: 575
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Re: Clonezilla fix (yes, it's broken)

Post by Lolo Uila »

Guess I spoke too soon. My fix seems to work for making backups, but when I tried to restore an image today it failed, even though the image was fine.

Clonezilla successfully restored the first partition, but then fails on the second partition. However, if I just use the test function to verify the backup, it passes. Odd... still trying to figure out what's causing that.

Anyway, had to boot into Parted Magic and run Clonezilla from there to restore my backup.

Code: Select all

*****************************************************.
Restoring partition /dev/sdd1...
*****************************************************.
Starting unicast restoring image 2016-05-16-12-img_Raspbian_64GB_microSD to /dev/sdd1...
If this action fails or hangs, check:
* Is the saved image /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd1.vfat-ptcl-img.gz.* corrupted ?
*****************************************************.
  ( for img in /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd1.vfat-ptcl-img.gz.*; do
      cat 
    done
  )   | pigz -d -c 2> /tmp/unzip_stdin_cmd_error.jAgy7t   | LC_ALL=C partclone.vfat -m 10485760 -N -L /var/log/partclone.log -s - -r -o /dev/sdd1
Partclone v0.2.51 http://partclone.org
Starting to restore image (-) to device (/dev/sdd1)
we need memory: 20804 bytes
image head 4160, bitmap 16128, crc 516 bytes
Calculating bitmap... Please wait... get device size 66060288 by ioctl BLKGETSIZE64,
done!
File system:  FAT16
Device size:   66.1 MB = 129024 Blocks
Space in use:  21.2 MB = 41326 Blocks
Free Space:    44.9 MB = 87698 Blocks
Block size:   512 Byte
Syncing... OK!
Partclone successfully restored the image (-) to the device (/dev/sdd1)
>>> Time elapsed: 10.73 secs (~ .178 mins)
Finished unicast restoring image 2016-05-16-12-img_Raspbian_64GB_microSD to /dev/sdd1.
Informing kernel the file system has been changed...... done!
*****************************************************.
Restoring partition /dev/sdd2...
*****************************************************.
Starting unicast restoring image 2016-05-16-12-img_Raspbian_64GB_microSD to /dev/sdd2...
If this action fails or hangs, check:
* Is the saved image /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2.ext4-ptcl-img.gz.* corrupted ?
*****************************************************.
  ( for img in /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2.ext4-ptcl-img.gz.*; do
      cat 
    done
  )   | pigz -d -c 2> /tmp/unzip_stdin_cmd_error.8nPCTy   | LC_ALL=C partclone.ext4 -m 10485760 -N -L /var/log/partclone.log -s - -r -o /dev/sdd2
Partclone v0.2.51 http://partclone.org
Starting to restore image (-) to device (/dev/sdd2)
we need memory: 1914692 bytes
image head 4160, bitmap 1906432, crc 4100 bytes
Calculating bitmap... Please wait... get device size 62469963776 by ioctl BLKGETSIZE64,
done!
File system:  EXTFS
Device size:   62.5 GB = 15251456 Blocks
Space in use:  20.5 GB = 4993393 Blocks
Free Space:    42.0 GB = 10258063 Blocks
Block size:   4096 Byte
>>> Time elapsed: .50 secs (~ .008 mins)
Finished unicast restoring image 2016-05-16-12-img_Raspbian_64GB_microSD to /dev/sdd2.
Informing kernel the file system has been changed...... done!
*****************************************************.
Failed to restore partition image file /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2* to /dev/sdd2! Maybe this image is corrupt or there is no /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2*! If you are restoring the image of partition to different partition, check the FAQ on Clonezilla website for how to make it.
Press "Enter" to continue......
*****************************************************.
The relevant part being:
Failed to restore partition image file /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2* to /dev/sdd2! Maybe this image is corrupt or there is no /home/partimag/2016-05-16-12-img_Raspbian_64GB_microSD/sdd2*!

Since the image passes a verification test, I really can't figure out what's going on here?

EDIT: Ran it a few more times and watched the execution, and noticed a Partclone SEGFAULT message that is not appearing in the log. :(

Oddly it's not happening on restoring the first partition.

Could be the small size. Could be partclone.vfat (1st partition) vs partclone.ext4 (2nd partition)??
Everyone thinks I'm crazy (except my friends deep inside the earth).
Lolo Uila
Level 5
Level 5
Posts: 575
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Re: Clonezilla fix (yes, it's broken)

Post by Lolo Uila »

Okay, I spent the better part of the night installing tools, dependencies, and gathering all the missing bits I'd need to build an updated version of partclone, and while I was looking for yet another missing library, I found .deb files for the latest stable versions of drbl, partclone and clonezilla.

:roll:

So after all that effort, it was fixed with a few mouse clicks. :lol:

Running a restore to test it now, but its already past the part where it crashed before...

You know, the first thing I did was look for .debs, but the ones I found had unsolvable dependencies. Guess I just need to look harder next time.

http://free.nchc.org.tw/drbl-core/pool/drbl/stable/
Everyone thinks I'm crazy (except my friends deep inside the earth).
killer de bug

Re: Clonezilla fix (yes, it's broken)

Post by killer de bug »

Isn't CloneZilla supposed to be stand alone and not being linked to any Linux Mint distro? That's the point of CloneZilla. Being a live system cloning your HD as a backup. Therefore I don't understand what you are trying to achieve here. :?
Lolo Uila
Level 5
Level 5
Posts: 575
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Re: Clonezilla fix (yes, it's broken)

Post by Lolo Uila »

I'm using it to backup other drives (from other computers), and it's inconvenient to have to reboot to use Clonezilla for that.
Everyone thinks I'm crazy (except my friends deep inside the earth).
killer de bug

Re: Clonezilla fix (yes, it's broken)

Post by killer de bug »

When why don't you use simpler softwares like MintBackup?
I guess your issues are coming from the fact that you are creating you own usage of CloneZilla. Not respecting the way it is supposed to work. :wink:
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Clonezilla fix (yes, it's broken)

Post by Cosmo. »

Lolo Uila wrote:I'm using it to backup other drives (from other computers), and it's inconvenient to have to reboot to use Clonezilla for that.
You can use qt4-fsarchiver from inside of a running system. You need this PPA: ppa:dieterbaum/qt4-fsarchiver
Locked

Return to “Software & Applications”