Archives de catégorie : Uncategorized

Migrating RRDTool from 32bits to 64 bits

I had a very old server on a 32 bits platform. A few days ago, I bought a new one with a 64bits platform.
I was using Smokeping on this server, and I wanted to keep my old data. If you copy .rrd files in place, you’ll get an error :

This RRD was created on another architecture

That’s because RRD file structure changed based on the architecture you have. Yes, that’s silly but this is the way it is.

To convert files, you have to dump data to an XML file, sync it on the new server, and reimport it.
This is how to make it with justa few lines of bash :

cd /path/to/rrd/files;
for i in $(find . -name '*.rrd'); do rrdtool dump $i > $i.xml ; done
rsync -av . my.server.ip:/path/to/new/dir/rrd/

And on the new server :

cd /path/to/new/dir/rrd
for i in `find . -name '*.xml'`; do rrdtool restore --force-overwrite $i `echo $i |sed s/.xml//g`; done

 

XFS – Empty files after a crash

Another major bug in XFS :

After a power failure, server was back but shows some files with size 0 (when I was sure this cannot be possible).
using ‘du -sh’ on this folder shows that total size was > 0 …

The bug was already reported on XFS mailing list here :

http://oss.sgi.com/archives/xfs/2012-02/msg00517.html

If you have many files to recover, procedure is really a pain. That’s why I created a small PHP file that do the trick.

https://github.com/odoucet/xfsrepair

i’m not responsible if you destroy your data 😉 But this script worked well for me.