#!/bin/bash set -e VG="vg" NAME="$1" if [ -z "$NAME" ]; then echo "Need name as parameter" >&2 exit 1 fi lvcreate -n $NAME -L128M /dev/$VG mke2fs -F -m0 -b 4096 -t ext4 -O resize_inode,^has_journal -E resize=1073741824 /dev/$VG/$NAME mount /dev/$VG/$NAME /mnt lvextend -f --size 1708M /dev/$VG/$NAME df -h /mnt resize2fs /dev/$VG/$NAME 2361000s df -h /mnt resize2fs /dev/$VG/$NAME 3109200s umount /mnt