Skip to content

Instantly share code, notes, and snippets.

@AlD
Last active December 16, 2023 18:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlD/6632516 to your computer and use it in GitHub Desktop.
Save AlD/6632516 to your computer and use it in GitHub Desktop.
Fix „ERROR: This RRD was created on another architecture“ on Debian
debootstrap --arch=i386 --include=rrdtool stable /tmp/rrdtool-i386 &&
mount --bind /var /tmp/rrdtool-i386/var &&
find /var -mount -type f -name \*.rrd |
while read rrd; do
td=$(mktemp -d)
linux32 chroot /tmp/rrdtool-i386 rrdtool dump "$rrd" > $td/xml &&
rrdtool restore $td/xml $td/rrd &&
cp $td/rrd "$rrd"
rm $td/{xml,rrd}
rmdir $td
done
# © 2013-09-20 Daniel Albers <daniel@lbe.rs>, GPL
@dennisheitmann
Copy link

dennisheitmann commented Apr 15, 2018

Great Idea! Thank you.

@grguthrie
Copy link

grguthrie commented Nov 27, 2022

Great - thanks!!
But how do I run this?
I have a directory of .rrd files on the new machine.
I got the debootstrap successfully, but it does not find my files - not sure how to then run this.
It seems to still complain that the rrd's are "created on another architecture".

@AlD
Copy link
Author

AlD commented Nov 27, 2022

@grguthrie Please note that this snippet is almost ten years old and things may have changed.

The script expects the .rrds to be below /var. If that's not the case for you, replace all occurrences of /var with the appropriate directory.

@grguthrie
Copy link

Thanks - I'll try again. A clever and useful approach!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment