[DRBD-user] Re: How to shrink a filesystem safely with DRBD

trickytools jd at trickytools.com
Tue Sep 20 08:27:44 CEST 2005

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


Hello Lars,

Here are my answers to your questions:

> >
> > I had to activate drbd on top of an existing filesystem (ext3).
> > I reduced the filesystem size  to make drbd able to store its internal
data.
> >
> > After some test I got the following message:
> >
> > "drbd1: attempt to access beyond end of device"
> >
> > According to the mailing list archive it seems the size of the ext3 fs
and
> > the size of drbd differ.
> > I understand what is the size of the ext3 fs, but what is the size
> > considered by drbd, the partition size ?
> >
> > Here are the commands I used (/dev/sda3 partition size is initially
equal to
> > 10Go):
>
> just for the rest of the world: Go is Giga octets (french for byte)
>
> now, it would be interessting what exactly "G" is, here.
> 1000*1000*1000 ? 1024*1024*1024 ?
>

(Sorry for the confusion with Go and GB)

> > # umount /dev/sda3
> > # e2fsck -f /dev/sda3
> > # resize2fs /dev/sda3 9800M
>
> the same for "M", here.
> but I guess it is 1024*1024 in resize2fs.
> 9800 * 1024 * 1024 == 10276044800
>
> how sure are you about those 10 "giga" byte ?
>

In fact, the partition has been created by specifying a size given in MB,
so it is easy to do a substraction of at least 128 MB for the DRBD internal
meta-data.

> > # e2fsck -f /dev/sda3
> > # drbdadm attach myresource
> > # drbdadm connect myresource
> > # drbdadm primary myresource
>
> you probably needed to --do-what-I-say, right?
>

Yes, I did.

> > # drbdadm invalidate myresource
>
> you hopefully did invalidate on the other node, right?
>
I'm not sure....

> > # mount /dev/drbd1 ....
>
> btw, how big is the device on the other node?
>

The partition on the other node has also been created with the same initial
size
and then shrinked the same way with the same values.

> and what does drbd say in the kernel log about the device size?
> the lines about "creating state block... bits in bitmap ... etc."

I will check.

> on a tangent, is this file system nfs exported?

No.

But there is another fact that should (?) be taken in account:
I have upgraded from version 0.7.12 to 0.7.13. To do so, I installed the new
driver and made a reboot.
I did not invalidate anything.
May this be the cause of the problem ?

Thanks,

Jerome





More information about the drbd-user mailing list