Tag Archives: reduce

LVM: reduce partition size

# umount mountpoint with lvm partition
unmount /data

# check for errors and fix them
fsck -f /dev/sys/data

# resize filesystem to 80Gb
resize2fs /dev/sys/data 80G

# deactivate logical volume
lvchange -an /dev/sys/data

# change size of logical volume
lvreduce --size 191G /dev/sys/data

# create new volume «drbdmaster» in logical group «sys» with size 4Gb
lvcreate -n drbdmaster -L4G sys

# activate volumes
lvchange -ay  /dev/sys/data
lvchange -ay /dev/sys/drbdmaster

# mount data
mount /dev/sys/data

# create filesystem on drbdmaster
mkfs.ext4 /dev/sys/drbdmaster

# mount drbdmaster
mkdir -p /drbd/master
mount /dev/sys/drbdmaster /drbd/master