lxcdisk=vm-154-disk-0
lxcvg=main
mkdir /mnt/old
mount /dev/$lxcvg/$lxcdisk /mnt/old/
lvcreate -T main/lvpool -V 1G -n $lxcdisk-new
mkdir /mnt/new
mkfs.ext4 /dev/$lxcvg/$lxcdisk-new
mount /dev/$lxcvg/$lxcdisk-new /mnt/new/
cd /mnt/old/
rsync --stats -h -X -A --numeric-ids -aH --delete --no-whole-file --inplace --one-file-system --relative '--exclude=/tmp/?*' '--exclude=/var/tmp/?*' '--exclude=/var/run/?*.pid' * /mnt/new
cd ..
umount /mnt/old/ /mnt/new/
lvrename main $lxcdisk $lxcdisk-old
lvrename main $lxcdisk-new $lxcdisk
echo lvremove /dev/$lxcvg/$lxcdisk-old