[DRBD-user] DRBD attempts to access beyond end of device

Lars Ellenberg lars.ellenberg at linbit.com
Thu Feb 28 20:22:29 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Thu, Feb 28, 2008 at 01:09:46PM -0500, Nate Seif wrote:
> # tune2fs -l /dev/hda4 | grep -e ^Block.count: -e ^Block.size:
> Block count:              26499186
> Block size:               4096
>

btw, for the next one excercising this,
provided that your awk gets the math right,
you can do:

tune2fs -l /dev/whatever |
  awk '/^Block.size:/ { bs=$NF }
       /^Block.count:/ { bc=$NF }
       END { print bc * bs / 1024, "kB" }'


>> or better
>> tune2fs -l /dev/drbd0 |
>>      grep -e ^Block.count: -e ^Block.size:
>
> # tune2fs -l /dev/drbd0 | grep -e ^Block.count: -e ^Block.size:
> Block count:              26499186
> Block size:               4096
>
> I see that 26499186 * 4096 = 108540665856 bytes.
> 108540665856 bytes * (1 kilobyte / 1024 bytes) = 105996744 kilobytes.
>
> This appears to be the same size that my kernel sees for hda4, and not  
> drbd0:
>
> # grep -e hda4 -e drbd0 /proc/partitions
>     3     4  105996744 hda4
>   147     0  105993472 drbd0
>
>
>
>>> >  you again get two numbers, this time unit is kilo byte.
>>> >  that is the size of the partitions as the kernel sees them now.
>>> >  according to the logs above (the limit= is unit sectors),
>>> >  drbd0 will be 105993472 kB.
>>> >  I dare say hda4 will be somewhat larger, my best guess, given the
>>> >  information I have, is that hda4 will be 105996740 kB.
>>> >  and that this also matches what the tune2fs reports.
>
> hda4 is slightly larger than drbd0 according to /proc/partitions AND this 
> does match what tune2fs reports. This seems to me to be what we'd expect  
> if I had created the filesystem directly on hda4... (Is this how  
> everyone else interprets it?) But, I swear when I set up my DRBD cluster 
> I created the file system on /dev/drbd0:
>
> # mke2fs -j /dev/drbd0
>
> I am and was very much aware of the fact that I have to deal only with  
> /dev/drbd0 and not the underlying partition /dev/hda4. Is it possible 
> that mke2fs created the ext3 file system on /dev/hda4 instead of 
> /dev/drbd0 as I told it to?

maybe there have been some gui tools involved,
or some re-partition tools (parted and friends),
that decided for themselves that they wanted to "optimize"
your partition/file system layout?

> I imagine I need to get ext3 to see/truncate its FS size to that of  
> /dev/drbd0 so that the tune2fs command returns the bytes the kernel sees  
> on /dev/drbd0. Is this correct?

suggestion to get out of this:
 either do backup / mkfs / restore,
 or
 umount. drbdadm down all.
 force fsck of /real/device (hda4).
 now you have again two options:
   reconfigure drbd to use external meta data
   (you'd need an additional lv or partion for this)
   or 
 resize2fs /real/device $usable_size_of_drbd_with_internal_meta_data
 (or even some MB smaller, just to be sure)
 drbdadm up 
 drbdadm primary
 drbdadm invalidate-remote


-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list