[DRBD-user] online-resizing ext3-partition on top of drbd and lvm

lowshoe lowshoe at gmail.com
Tue May 31 07:46:12 CEST 2011

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


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



More information about the drbd-user mailing list