<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi all<br>
<br>
Last night I had occasion to resize one of my DRBD devices from 32GB
to 17GB and used the guide
<a class="moz-txt-link-freetext" href="http://www.drbd.org/users-guide/s-resizing.html">http://www.drbd.org/users-guide/s-resizing.html</a> to do an offline
resize. In doing so, I found that I would consistently get an error
message<br>
<br>
<font size="3"><font color="#909090">confused in
meta_restore_md:TK_NUM: expected to write 131072 bytes, actually
wrote 77824<br>
<br>
</font></font>The page is good but seems to lack some detail about
how you calculate la-size-sect and also is missing some information
about the bm {} section which seems to also need to be changed. I
found that la-size-sect can be calculated by taking the bm_offset
from the output of the drbdadm create-md and dividing it by 512 to
get the number of sectors involved. This is for internal metadata
only, I don't use external so the procedure may be different for
that.<br>
<br>
What's not documented at all, is that on a resize of the device
downwards, you also need to adjust the section that says e.g.<br>
<br>
bm {<br>
# at 0kB<br>
131068 times 0x0000000000000000;<br>
}<br>
<br>
so that the number on the front (131068) reflects the new size of
the metadata which can be calculated by taking the new
la-size-sect/512 - so in my case bm_offset was 18466918400 and
la-size-sect ends up as 36068200 and the bm "times" number ends up
as 70445.x and rounded up is 70446.<br>
<br>
My devices are now both resized and up and running and seem to be
working but if I got anything wrong then perhaps someone can correct
me before google eats this mail and serves up incorrect information
to anyone looking for the "confused" message above.<br>
<br>
Trevor<br>
<font size="3"><font color="#909090"></font></font>
</body>
</html>