0

As the title states, I am trying to understand the discrepancies from ncdu and/or du in terms of what I am observing from disk usage. From what I understand, on modern systems, there is difference between disk usage and apparent size.

root@pve:/var/lib/vz/images/104# du -h vm-104-disk-1.raw 
30G     vm-104-disk-1.raw

However the actual disk usage inside the container is

21G     /

Since it's a sparse file and size is set to 50GB

root@pve:/var/lib/vz/images/104# du -b -h vm-104-disk-1.raw 
50G     vm-104-disk-1.raw

Can someone explain to me where the extra 10GB disk usage is being used for in QEMU raw images?

horace
  • 40
  • 3

1 Answers1

0

A sparse file doesn't shrink again, so if you have used that space inside the VM at some point and freed it afterwards, the image file will not become smaller again.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Thanks a lot, make's a lot more sense now and I am trying to figure out why this didn't come across my mind. I guess it's because I didn't know. This was very informative. – horace Jun 17 '16 at 09:11