<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I found that doing a resize on an rrd file caused a total loss of data with rrdtool 1.3.9 which is bundled with zenoss 3.2.1 on CentOS 5. &nbsp;Investigating with the tools found that the data was there, but the timestamps were corrupt.<div><br></div><div>So I grabbed rrdtool 1.4.7 and tried to use it and found that it has the same problem on CentOS 5.</div><div><br></div><div><div>$ rrdtool dump testfile.rrd | head -40</div><div>&lt;?xml version="1.0" encoding="utf-8"?&gt;</div><div>&lt;!DOCTYPE rrd SYSTEM "<a href="http://oss.oetiker.ch/rrdtool/rrdtool.dtd">http://oss.oetiker.ch/rrdtool/rrdtool.dtd</a>"&gt;</div><div>&lt;!-- Round Robin Database Dump --&gt;&lt;rrd&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&lt;version&gt; 0003 &lt;/version&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;step&gt; 15 &lt;/step&gt; &lt;!-- Seconds --&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;lastupdate&gt; 1342133281 &lt;/lastupdate&gt; &lt;!-- 2012-07-12 15:48:01 PDT --&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;name&gt; ds0 &lt;/name&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;type&gt; COUNTER &lt;/type&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;minimal_heartbeat&gt; 45 &lt;/minimal_heartbeat&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;min&gt; NaN &lt;/min&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;max&gt; 1.0000000000e+04 &lt;/max&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;!-- PDP Status --&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;last_ds&gt; 5585260819 &lt;/last_ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;value&gt; 5.2688224977e+02 &lt;/value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;unknown_sec&gt; 0 &lt;/unknown_sec&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/ds&gt;</div><div><br></div><div>&lt;!-- Round Robin Archives --&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&lt;rra&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;cf&gt; AVERAGE &lt;/cf&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;pdp_per_row&gt; 1 &lt;/pdp_per_row&gt; &lt;!-- 15 seconds --&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;params&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;xff&gt; 5.0000000000e-01 &lt;/xff&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/params&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;cdp_prep&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;primary_value&gt; 5.0500416920e+02 &lt;/primary_value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;secondary_value&gt; 5.0571394032e+02 &lt;/secondary_value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;value&gt; NaN &lt;/value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;unknown_datapoints&gt; 0 &lt;/unknown_datapoints&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/cdp_prep&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;database&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- 2012-07-12 13:18:15 PDT / 1342124295 --&gt; &lt;row&gt;&lt;v&gt; 5.2835238201e+02 &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- 2012-07-12 13:18:30 PDT / 1342124310 --&gt; &lt;row&gt;&lt;v&gt; 5.2950058206e+02 &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- 2012-07-12 13:18:45 PDT / 1342124325 --&gt; &lt;row&gt;&lt;v&gt; 5.3706333105e+02 &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- 2012-07-12 13:19:00 PDT / 1342124340 --&gt; &lt;row&gt;&lt;v&gt; 5.2656011537e+02 &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- 2012-07-12 13:19:15 PDT / 1342124355 --&gt; &lt;row&gt;&lt;v&gt; 5.0348379147e+02 &lt;/v&gt;&lt;/row&gt;</div><div><br></div><div>$ rrdtool resize testfile.rrd 0 GROW 1416</div><div><br></div><div>$ rrdtool dump resize.rrd | head -40</div><div>&lt;?xml version="1.0" encoding="utf-8"?&gt;</div><div>&lt;!DOCTYPE rrd SYSTEM "<a href="http://oss.oetiker.ch/rrdtool/rrdtool.dtd">http://oss.oetiker.ch/rrdtool/rrdtool.dtd</a>"&gt;</div><div>&lt;!-- Round Robin Database Dump --&gt;&lt;rrd&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&lt;version&gt; 0003 &lt;/version&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;step&gt; 15 &lt;/step&gt; &lt;!-- Seconds --&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;lastupdate&gt; 4048795654275216693 &lt;/lastupdate&gt; &lt;!-- -547790155-01-11136 05:31:33 PST --&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;name&gt; ds0 &lt;/name&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;type&gt; COUNTER &lt;/type&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;minimal_heartbeat&gt; 45 &lt;/minimal_heartbeat&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;min&gt; NaN &lt;/min&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;max&gt; 1.0000000000e+04 &lt;/max&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;!-- PDP Status --&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;last_ds&gt; &nbsp;&lt;/last_ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;value&gt; 0.0000000000e+00 &lt;/value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;unknown_sec&gt; 0 &lt;/unknown_sec&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/ds&gt;</div><div><br></div><div>&lt;!-- Round Robin Archives --&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&lt;rra&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;cf&gt; AVERAGE &lt;/cf&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;pdp_per_row&gt; 1 &lt;/pdp_per_row&gt; &lt;!-- 15 seconds --&gt;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;params&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;xff&gt; 5.0000000000e-01 &lt;/xff&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/params&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;cdp_prep&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;primary_value&gt; 0.0000000000e+00 &lt;/primary_value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;secondary_value&gt; 0.0000000000e+00 &lt;/secondary_value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;value&gt; 0.0000000000e+00 &lt;/value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;unknown_datapoints&gt; 0 &lt;/unknown_datapoints&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/ds&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/cdp_prep&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;database&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11136 21:07:45 PST / 892845857 --&gt; &lt;row&gt;&lt;v&gt; NaN &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11136 21:08:00 PST / 892845872 --&gt; &lt;row&gt;&lt;v&gt; NaN &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11136 21:08:15 PST / 892845887 --&gt; &lt;row&gt;&lt;v&gt; NaN &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11136 21:08:30 PST / 892845902 --&gt; &lt;row&gt;&lt;v&gt; NaN &lt;/v&gt;&lt;/row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11136 21:08:45 PST / 892845917 --&gt; &lt;row&gt;&lt;v&gt; NaN &lt;/v&gt;&lt;/row&gt;</div></div><div><br></div><div>Let's find the first value that was in the old file.</div><div><br></div><div><div>$ rrdtool dump tmp.0.resize.rrd | grep 5.28352</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;!-- -547790155-01-11098 03:01:15 PST / 892867067 --&gt; &lt;row&gt;&lt;v&gt; 5.2835238201e+02 &lt;/v&gt;&lt;/row&gt;</div><div><br></div><div>Hm. That's a way bit different timestamp than this record</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">                        </span>&lt;!-- 2012-07-12 13:18:15 PDT / 1342124295 --&gt; &lt;row&gt;&lt;v&gt; 5.2835238201e+02 &lt;/v&gt;&lt;/row&gt;</div></div><div><br></div><div><div apple-content-edited="true">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">--&nbsp;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Jo Rhett</font></div><span class="Apple-style-span" style="font-size: 12px; ">Net Consonance :&nbsp;</span><span class="Apple-style-span" style="font-size: 12px; ">net philanthropy to improve open source and internet projects.</span><br><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><span class="Apple-style-span" style="font-size: 12px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div></span></div></div></div></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>