I fixed my restore problems!

Go there if you encounter an unexpected error when using the softare. For installation problems, use another forum.

Moderator: feffer

treczoks
Posts: 2
Joined: Tue Sep 27, 2005 2:25 pm
Location: Königswinter, Germany

I fixed my restore problems!

Postby treczoks » Thu Nov 03, 2005 1:22 pm

Hi, all.

Like many here, I experienced problems when restoring from larger splitted images. I used "--compress 1 --volume=4000" with backup and could not get the pieces back together with restore.

Neither "cat"ing nor "zcat"ing the files into partimage would help, so I dug the net for an answer. I found that Steven Shiau who uses partimage with his Clonezilla system ran into similar problems and found a solution. Sadly, his solution did not work with splits of 4GB due to limitations in the gzip file standard, and the workaround would be quite timeconsuming for everydays usage (it involves a "zcat (file) | wc -c" to determine the file size!).

After studying his partimage_stdin source, I found a way faster and more elegant method of dealing with this problem:

Code: Select all

# this bash-code expects the backup files as $BACKUPSET.000,
# $BACKUPSET.001, etc. Modify to match your environment.
toskip=0
{
  for partfile in $BACKUPSET.*; do
    zcat $pertfile | dd skip=$toskip 2>/dev/null
    toskip=1
  done;
} | partimage $RESTORE_OPTS restore $DEVICE stdin


Basically, all files of the set are uncompressed with zcat, but only the first is passed unaltered, all the later files get the first 512 bytes (1 block for dd - the partimage header) removed. With the help of {} grouping all output together, this is then passed into partimage.

As this method uses zcat, it only applies to backup sets generated with "--compress 1". I don't know if the approach would work with bzcat on a "--compress 2" image.

Warning: You use this code snippet at your own risk. Don't blame me if you burn soemething down by running it...

And: A big, big THANK YOU to Steven Shiau, who originally found the problem and provided the source with the answer.

Yours, Christian Treczoks

steven
Posts: 20
Joined: Fri Apr 09, 2004 3:27 pm
Location: Taiwan
Contact:

Re: I fixed my restore problems!

Postby steven » Sat Nov 05, 2005 1:51 am

Excellent! This is really much more elegant! Thanks for sharing that with us.

Florian

Postby Florian » Wed Jan 11, 2006 10:10 pm

Thanks a lot for this script. I'm in process of restoring a 40GB disk split in 2G files.

By the way, please note a typo: in the zcat command, the variable should be

Code: Select all

$partfile
and not

Code: Select all

$pertfile
.

Florian.

Gleison
Posts: 2
Joined: Tue Sep 02, 2008 5:42 pm

Problem with this step

Postby Gleison » Tue Sep 02, 2008 5:49 pm

I just made exactly as is written above, but an error message is occurring... It is recognizing the stdin as a place from where the partimage will restore the files.. It is showing that the partimage can't find stdin.000!! =(
Could anyone help me to identify this issue? I will be thanked a lot!!!

Thanks and Regards
Gleison Ziviani

TiaTrevarthen
Posts: 1
Joined: Tue Feb 01, 2011 3:01 pm

Postby TiaTrevarthen » Tue Feb 01, 2011 3:13 pm

I'm going to join twelve files on 2GB each and I hope your method helps me with that !

Lcstyle
Posts: 6
Joined: Wed Feb 29, 2012 7:32 am

Re: Problem with this step

Postby Lcstyle » Wed Feb 29, 2012 4:44 pm

Gleison wrote:I just made exactly as is written above, but an error message is occurring... It is recognizing the stdin as a place from where the partimage will restore the files.. It is showing that the partimage can't find stdin.000!! =(
Could anyone help me to identify this issue? I will be thanked a lot!!!

Thanks and Regards
Gleison Ziviani


Your problem is that you are not getting the correct syntax:

try
wget -q -O - ftp://whatever

(research "redirect wget output to stdout" for more information).


Return to “Unexpected errors during usage”

Who is online

Users browsing this forum: No registered users and 3 guests