0

I have a lot of rrd files which got generated on a 1st Gen Cubieboard (1 GHz CPU, 1 Core, 1 GB RAM), and about a year ago, when I migrated the data loggers to an x86_64 machine, I noticed that I can no longer read those old files. I didn't know they were platform specific.

I know that there is a workflow where I export the data from the files into XML files and then import them on the other architecture, but this is not my first choice as the old board is painfully slow and has other important work to do, like be a DNS server. The rrdtool version is stuck at 1.4.7 and there are 1.4 gigs worth of files to get processed.

Is there a way to emulate the Cubieboard on a fast Intel machine or some x86_64 based tool which can convert those rrd files?

Daniel F
  • 13,684
  • 11
  • 87
  • 116
  • 1
    This looks most likely to do with the size of integers. I would try to build rrd on x86 for your platform. That may be able to straight forwardly read the integers stored in the file, and "understand" it. If that fails, then it may be little/big endian differences. That would require targeted byte swapping to recover the data. Finally the floating point standard used by the arm may be incompatible. To fix that, the floating point numbers would need to be manually built. – mksteve Oct 08 '18 at 06:26
  • Do you think using a docker container like `multiarch/alpine:x86-edge` would do that job? https://github.com/multiarch/alpine I'll check that. – Daniel F Oct 08 '18 at 06:33
  • I have not really used docker for much, so not really sure. I would either look in documentation for rrdtool to see if it can be configured for x86 on a linux machine which has been configured with 32 bit compilers. Or use a full virtual box x86 linux machine to try out. Good luck – mksteve Oct 08 '18 at 06:38
  • Just tested this with Docker. Just int-size (x86 vs x86_64) is not the issue, I still get a `ERROR: This RRD was created on another architecture` when I use an x86 (not the x86_64) variant of rrdtool. `qemu` with `armhf` should be the solution, but I guess I'll just export it slowly (niceness adjusted) onto an microsd card during the next couple of days. – Daniel F Oct 08 '18 at 07:09

1 Answers1

1

RRD File are not portable between architectures, as you have noticed. The format depends not only on the 32/64 bit integer size, but also on the 'endian' characteristics, and even on the compiler behaviour with structure padding. It may be possible to compile the library in 32-bit mode on your new platform, but it is still not likely to be compatible with your old RRD files as there are other hardware differences to consider.

In short, your best option is to (slowly?) export to XML and then re-import in the new architecture, as you already mentioned. I have previously done this on a large RRD installation, running in parallel for a while to avoid gaps in the data, but it takes time.

I seem to remember that Tobi was, at one time, planning on a new architecture-independent RRD format in RRD 1.6, but even if this comes to pass then it won't help you with your legacy data.

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39