0
I have rescued data from a 2TB hdd (and it turned out that it was not faulty - but this is a different story) and I got a 2TB image. Mounting this image under Linux, I can see (using df
) that in this image, 512GB are free. Now, I would like get this space back, i.e., either shrink the image, which seems to be slightly complicated (as several questions and answers on Super User and other sites pointed out) or put the files into a new image.
My question is: What is the easiest way to get a mountable image which contains the data, but not the free space? I prefer to keep all the data in one image file.
Thanks - this sounds promising. I think I will go with a sparse qcow2 as the image contains a lot of text files which should compress quite nicely. I found https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/ and this lead me also to
– Rainer – 2015-03-27T09:06:46.513libguestfs
and the toolvirt-sparsify
which looks very nice, as it can also do the conversion to qcows.