Discussion:
online-resizing ext3-partition on top of drbd and lvm
lowshoe
2011-05-31 05:46:12 UTC
Permalink
hi guys,

i want to resize my drbd-partition which is on top of lvm.
drbd-version is 8.3.4 on SLES 11SP1 x86_64
in the end, i want to increase the original size of my
drbd-data-partition from 25 GB to 50 GB.
for this, i already added a new harddisk to the lvm volume group,
resized the logical volume and also resized the drbd-device.

this is the configuration so far:

# cat /etc/drbd.conf

[..]
resource mysqldata {
device /dev/drbd0;
disk /dev/lvm-data/mysql;
flexible-meta-disk /dev/lvm-data/mysql-meta;

on node1{
address 192.168.10.2:7788;
}
on node2 {
address 192.168.10.3:7788;
}
}


# vgdisplay lvm-data

--- Volume group ---
VG Name lvm-data
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 49,98 GB
PE Size 4,00 MB
Total PE 12796
Alloc PE / Size 12796 / 49,98 GB
Free PE / Size 0 / 0
VG UUID KhczlK-y2Qe-Vttd-R1Vc-3m6k-lr31-SRGQLL

in this volume group i have one logical volume for my mysql-database
(ext3-partition) and one for the drbd-metadata (meta-disk external).

# lvdisplay lvm-data
--- Logical volume ---
LV Name /dev/lvm-data/mysql
VG Name lvm-data
LV UUID LTs4PN-xnM4-t80v-fiyl-EVb2-qPqY-tKQOXv
LV Write Access read/write
LV Status available
# open 1
LV Size 49,86 GB
Current LE 12764
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 253:7

--- Logical volume ---
LV Name /dev/lvm-data/mysql-meta
VG Name lvm-data
LV UUID R0J1Fp-r1jA-uWs0-xdwd-DMBc-iOMl-XiFmy9
LV Write Access read/write
LV Status available
# open 1
LV Size 128,00 MB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 253:8


# df -h
Filesystem Size Used Available Use% Mounted on
/dev/drbd0 25G 12G 12G 51% /var/lib/mysql

# mount
/dev/drbd0 on /var/lib/mysql type ext3 (rw,noatime)


these are the steps i already made:

- partitioned new harddisk for lvm-usage:
fdisk /dev/sdc (created new primary parition, type e8 - lvm)

- created new physical volume out of this partion for lvm-usage:
pvcreate /dev/sdc1

- added the new physical volume to the lvm volume group:
vgextend lvm-data /dev/sdc1

- increased size of the logical volume "mysql" to 100% of the newly
available free space:
lvextend -l +100%FREE /dev/lvm-data/mysql

- resized drbd-device
drbdadm resize mysqldata


all of these steps worked well so far without any errors. i think,
one last step is required now:

resize2fs /dev/drbd0

can i now safely make this last step and resize the overlying
ext3-partition online without data-loss or did i miss something? do i
need to remount /dev/drbd0 at the end?

regards, lowshoe
Felix Frank
2011-05-31 07:37:37 UTC
Permalink
Hi,
Post by lowshoe
resize2fs /dev/drbd0
can i now safely make this last step and resize the overlying
ext3-partition online without data-loss or did i miss something? do i
need to remount /dev/drbd0 at the end?
I believe this is supposed to be possible. I've heard of people hurting
themselves this way, though.

It is definitely safe to resize2fs on an unmounted volume. I wouldn't
dare online-resizing such a large (and mission-critical?) filesystem.

Other than that, yes, that's the only missing step.

Cheers,
Felix
lowshoe
2011-05-31 08:47:51 UTC
Permalink
hi felix,

thanks your your quick response. the filesystem is indeed mission critical
:-) that's why i wanted to resize it online to avoid downtimes. but i guess
the downtime in case of a failure during online resizing would be longer
than a offline (unmounted) resize :-)

are there any experiences how long the resizing process for such a size
would take?
and one (rather silly - but i better play it safe) last question: with
"unmounted" you mean simply to unmount the overlying ext3-partition? the
drbd-device should still be active and in the connected state, right?

best regards,
lowshoe
Post by Felix Frank
Hi,
Post by lowshoe
resize2fs /dev/drbd0
can i now safely make this last step and resize the overlying
ext3-partition online without data-loss or did i miss something? do i
need to remount /dev/drbd0 at the end?
I believe this is supposed to be possible. I've heard of people hurting
themselves this way, though.
It is definitely safe to resize2fs on an unmounted volume. I wouldn't
dare online-resizing such a large (and mission-critical?) filesystem.
Other than that, yes, that's the only missing step.
Cheers,
Felix
_______________________________________________
drbd-user mailing list
http://lists.linbit.com/mailman/listinfo/drbd-user
--
View this message in context: http://old.nabble.com/online-resizing-ext3-partition-on-top-of-drbd-and-lvm-tp31738276p31738997.html
Sent from the DRBD - User mailing list archive at Nabble.com.
Loading...