 |
 |
 |
 |
www.partimage.org Partimage forums
|
 |
 |
 |
 |
 |
| Author |
Message |
treczoks
Joined: 27 Sep 2005
Posts: 2
Location: Königswinter, Germany
|
Posted:
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: |
# 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
Joined: 09 Apr 2004
Posts: 20
Location: Taiwan
|
Posted:
Sat Nov 05, 2005 1:51 am |
  |
Excellent! This is really much more elegant! Thanks for sharing that with us. |
|
|
   |
 |
Florian
Guest
|
Posted:
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 and not .
Florian. |
|
|
|
 |
Gleison
Joined: 02 Sep 2008
Posts: 2
|
Posted:
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 |
|
|
  |
 |
sweeppicker
Joined: 28 Jul 2010
Posts: 1
|
Posted:
Thu Jul 29, 2010 8:23 am |
  |
i applied this code but its giving some errors which i don't understand. What can i do?
Thanks.
pheromones |
Last edited by sweeppicker on Sat Aug 14, 2010 10:58 am; edited 2 times in total |
|
  |
 |
reenfoo
Joined: 11 Aug 2010
Posts: 1
|
Posted:
Thu Aug 12, 2010 11:22 am |
  |
| Florian wrote: |
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 and not .
Florian. |
oh it helped me a lot! Your correction saved my time :)
peace out~
Movie trailers |
|
|
   |
 |
|
|
|
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB
© 2001, 2002 phpBB Group :: FI Theme
All times are GMT
|