Restoring clonezilla images - cat | gzip | partclone not working!

I ran into the same issue. While dogonthehorizon's answer might give you the desired results in the end, you would also have to deal with fixing dependency issues when trying to install an older build of partclone.

Instead, stop using partclone.restore, it is considered deprecated. Use partclone.ext4 as the maintained alternative in combination with the options --restore --restore_raw_file (short notations: -r -W) instead. Here 'ext4' should be replaced with the appropriate file system ('ext3', 'ext4', 'ntfs', etc).

I have not experienced any incompatibilities this way, where I restored a version 0.2.58 ext4 file system clone with version 0.2.78.

With the example of the OP:

sudo cat /dir-to-images/sdb1.ntfs-ptcl-img.gz.* | sudo gzip -d -c | sudo partclone.restore -C -s - -O /dir-to-new-image/hda1.img

You would get the following when not using partclone.restore any longer but partclone.ntfs for ntfs instead:

sudo cat /dir-to-images/sdb1.ntfs-ptcl-img.gz.* | sudo gzip -d -c | sudo partclone.ntfs -C -r -W -s - -O /dir-to-new-image/hda1.img

Or the following for an ext4 file system backup:

sudo cat /dir-to-images/sdb1.ext4-ptcl-img.gz.* | sudo gzip -d -c | sudo partclone.ext4 -C -r -W -s - -O /dir-to-new-image/hda1.img

Notice the file system indications ('ntfs' and 'ext4') in the original .gz files.


TL;DR: install partclone 0.2.58 from source and attempt the partclone step again.

I stumbled upon this question while attempting to do something similar on my Arch-Linux machine. I approached the problem a little differently than you did but I'm hoping that my solution will at least get you on the right track.

I first unpacked the compressed backup that I had made with a previous version of Clonezilla:

cat sda4.ext4-ptcl-img.gz.a* | gzip -d -c > sda4.img

I then attempted to restore this file using partclone with the following command:

partclone.extfs -r -s sda4.img -o sda4-restored.img --restore_raw_file

Things should be familiar up to this point; all I've done here is split the process you attempted into two commands. Now, I ran into the same issues you did with these commands and it appears to be an issue with the version of partclone that we are using.

It appears that both Partclone v0.2.70 and Partclone v0.2.69 are not compatible with the back-ups I had made with Clonezilla v3.5.1.

However, installing an old version of Partclone, namely Partclone v0.2.58, allowed me to restore the backup image I had created using the same command as above. Since partclone had no prepared images for Arch-Linux it was necessary for me to compile from source, however running Ubuntu 12.04 you may be able to finagle the .deb files provided at this partclone mirror: http://partclone.nchc.org.tw/download/stable/0.2.58/.

The steps I followed to compile 0.2.58 we're pretty Arch-Linux specific, but I'd be happy to share this process with you if you still need some help.

Cheers!


In another forum I found a simple solution.

You have to create the file that you are writing to!

e.g.

touch sda4-restored.img

Please note that you will have to use the -C / dont check size .. unless you create a file that has the same or more size than your partition.

Original post:

https://bbs.archlinux.org/viewtopic.php?id=179929


i was getting an error when trying to loop mount an image i restored using partclone.restore. my original backup was created with clonezilla, i backed up a partition to an image.

EXT4-fs (loop0): bad geometry: block count 14648437 exceeds size of device (14215168 blocks)

so i used the following command to truncate it

truncate -o -s 14648437 sda2.img

you'll need sudo IF the img is owned by root and or in a folder owned by root. CAREFUL though because truncating an image may result in file loss but remember, you still have the original clonezilla backups so it's ok if you mess up the partclone.restore created .img file