Hi There,
I may be misunderstanding something or there may be a bug in qemu-img. Could someone shed some light on this? The VM is shut down of course while I'm running these commands. Note how the size of tt.qcow2 changes in the commit. It grows to almost 10 times the size of all the data on the entire image!
address@hidden:~/Documents/TTDE/UbuntuInstall/install/images/tt$ dir -h *.qcow2; du -h *.qcow2; qemu-img info --backing-chain disk.qcow2
-rw-r--r-- 1 seb users 2.4G Nov 27 22:03 base.qcow2
-rw-r--r-- 1 seb users 175M Nov 27 22:57 disk.qcow2
-rw-r--r-- 1 seb users 194K Nov 27 22:57 tt.qcow2
2.4G base.qcow2
175M disk.qcow2
196K tt.qcow2
image: disk.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 175M
cluster_size: 65536
backing file: tt.qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
image: tt.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 196K
cluster_size: 65536
backing file: base.qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
image: base.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 2.4G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
address@hidden:~/Documents/TTDE/UbuntuInstall/install/images/tt$ qemu-img commit disk.qcow2
Image committed.
address@hidden:~/Documents/TTDE/UbuntuInstall/install/images/tt$ dir -h *.qcow2; du -h *.qcow2
-rw-r--r-- 1 seb users 2.4G Nov 27 22:03 base.qcow2
-rw-r--r-- 1 seb users 175M Nov 27 22:57 disk.qcow2
-rw-r--r-- 1 seb users 19G Nov 27 23:04 tt.qcow2
2.4G base.qcow2
175M disk.qcow2
19G tt.qcow2Here are the steps I can reproduce this with:
- Install Ubuntu onto base.qcow2 from scratch and then shut it down.
- Create the two snapshots:
qemu-img create -b base.qcow2 -f qcow2 tt.qcow2
qemu-img create -b tt.qcow2 -f qcow2 disk.qcow2 - Restart the VM using -drive file=disk.qcow2,if=scsi,cache=none,discard=unmap
- Issue fstrim / and shut the VM down again.
- Issue the commands shown below.
The interesting thing is that the 19G seem to be about the empty space in the / FS.
Oh, and btw. all of this is running up-to-date Ubuntu 14.04 in both Guest + Host.