Hello, I'm trying to shrink LVM backing block device offline because I use internal metadata, and I'm following this guide https://linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-shrinking-offline . But it failed at create-md step.
*Here's the log for first machine (called ol1):* [root@ol1 drbd.d]# e2fsck -f /dev/drbd0 e2fsck 1.42.9 (28-Dec-2013) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/drbd0: 12/51200 files (0.0% non-contiguous), 109774/204732 blocks [root@ol1 drbd.d]# drbdadm status test role:Primary disk:UpToDate ol2 role:Secondary peer-disk:UpToDate [root@ol1 drbd.d]# resize2fs /dev/drbd0 180M resize2fs 1.42.9 (28-Dec-2013) Resizing the filesystem on /dev/drbd0 to 184320 (1k) blocks. The filesystem on /dev/drbd0 is now 184320 blocks long. [root@ol1 drbd.d]# drbdadm down test [root@ol1 drbd.d]# drbdadm dump-md test > /tmp/metadata Found meta data is "unclean", please apply-al first [root@ol1 drbd.d]# drbdadm apply-al test [root@ol1 drbd.d]# drbdadm dump-md test > /tmp/metadata [root@ol1 drbd.d]# lvreduce -L 180M /dev/mapper/vgdrbd-vol_drbd WARNING: Reducing active logical volume to 180.00 MiB. THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce vgdrbd/vol_drbd? [y/n]: y Size of logical volume vgdrbd/vol_drbd changed from 200.00 MiB (50 extents) to 180.00 MiB (45 extents). Logical volume vgdrbd/vol_drbd successfully resized. [root@ol1 drbd.d]# vi /tmp/metadata [root@ol1 drbd.d]# blockdev --getsz /dev/mapper/vgdrbd-vol_drbd 368640 [root@ol1 drbd.d]# vi /tmp/metadata [root@ol1 drbd.d]# drbdadm create-md test --max-peers=5 You want me to create a v09 style flexible-size internal meta data block. There appears to be a v09 flexible-size internal meta data block already in place on /dev/vgdrbd/vol_drbd at byte offset 188739584 Do you really want to overwrite the existing meta-data? [need to type 'yes' to confirm] yes md_offset 188739584 al_offset 188706816 bm_offset 188674048 Found ext3 filesystem 184320 kB data area apparently used 184252 kB left usable by current configuration Device size would be truncated, which would corrupt data and result in 'access beyond end of device' errors. You need to either * use external meta data (recommended) * shrink that filesystem first * zero out the device (destroy the filesystem) Operation refused. Command 'drbdmeta 0 v09 /dev/vgdrbd/vol_drbd internal create-md 5' terminated with exit code 40 [root@ol1 drbd.d]# drbdadm create-md test You want me to create a v09 style flexible-size internal meta data block. There appears to be a v09 flexible-size internal meta data block already in place on /dev/vgdrbd/vol_drbd at byte offset 188739584 Do you really want to overwrite the existing meta-data? [need to type 'yes' to confirm] yes md_offset 188739584 al_offset 188706816 bm_offset 188698624 Found ext3 filesystem 184320 kB data area apparently used 184276 kB left usable by current configuration Device size would be truncated, which would corrupt data and result in 'access beyond end of device' errors. You need to either * use external meta data (recommended) * shrink that filesystem first * zero out the device (destroy the filesystem) Operation refused. Command 'drbdmeta 0 v09 /dev/vgdrbd/vol_drbd internal create-md 1' terminated with exit code 40 *Here's the log for second machine (ol2):* [root@ol2 ~]# drbdadm down test [root@ol2 ~]# rm /tmp/metadata rm: remove regular file /tmp/metadata? y [root@ol2 ~]# drbdadm dump-md test > /tmp/metadata Found meta data is "unclean", please apply-al first [root@ol2 ~]# drbdadm apply-al test [root@ol2 ~]# lvreduce -L 180M /dev/mapper/vgdrbd-vol_drbd WARNING: Reducing active logical volume to 180.00 MiB. THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce vgdrbd/vol_drbd? [y/n]: y Size of logical volume vgdrbd/vol_drbd changed from 200.00 MiB (50 extents) to 180.00 MiB (45 extents). Logical volume vgdrbd/vol_drbd successfully resized. [root@ol2 ~]# vi /tmp/metadata At this point, ol1 can't create-md so I stopped and restore the size back to 200MB, then create-md, and succeeded. Any help will be much appreciated. -- Best Regards, Christophorus Reyhan Tantio A.
_______________________________________________ Star us on GITHUB: https://github.com/LINBIT drbd-user mailing list drbd-user@lists.linbit.com https://lists.linbit.com/mailman/listinfo/drbd-user