Long story short: I'm trying to create a snapshot of a volume using lvcreate using the following command:
lvcreate -l 100%FREE -s -n SNAPSHOT /dev/volume-group/data
I get an error saying "Unable to create new logical volume with no extents." After some digging, I discovered that the volume group in question has no free space according to vgdisplay, even though df -h shows plenty of space available.
--- Volume group --- VG Name volume-group System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 8 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 39.99 GiB PE Size 4.00 MiB Total PE 10238 Alloc PE / Size 10238 / 39.99 GiB Free PE / Size 0 / 0 VG UUID fP36on-3yzf-c8i2-bOzO-4Htf-txUa-k3y8p9
df -h output:
Filesystem Size Used Avail Use% Mounted on udev 7.5G 0 7.5G 0% /dev tmpfs 1.5G 73M 1.5G 5% /run /dev/xvda1 62G 2.2G 60G 4% / tmpfs 7.5G 0 7.5G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 7.5G 0 7.5G 0% /sys/fs/cgroup tmpfs 1.5G 0 1.5G 0% /run/user/1000 /dev/mapper/volume--group--data 40G 17G 24G 43% /mnt/mysql
I think what I'd need to do at this point is change the size of the logical volume containing /dev/volume-group/data to something a little bit larger than the current disk usage, take my snapshot, and then set it back to 40GB? But I'm not sure if that's the proper procedure or if I should be doing something else.
This is all happening in an AWS EC2 instance and the volume I'm trying to take a snapshot of is an EBS volume housing MySQL database data, in case those details matter.