Skip to contentSkip to conversation

image size - OS reports 720mb, but image file is 2.3 gig

Qemu-devel Joe Bogner 5 participants 7 messages Feb 11, 2005 – Feb 12, 2005

lore
Share & tools
lore

Joe Bogner

author
#0 lore raw

Hello,

I'm trying to create an win2k image that is as small as possible. I'd like to be able to copy the image back and forth between machines so that I have a complete win2k development image.

According to win2k, the size is about 720mb. Originally win2k was reporting the size to be about 1.2gig, but I was able to reduce it through NTFS compression.

Here's the dilemna. The physical image file is 2.3gig. I've run a qemu-img convert -f qcow <input> -O qcow <output>, which took the original 4.5 gig image down to 2.3 gig. With qemu-img compression, I was able to get it down to 1.7gig.

Why is there such a large discrepency between what win2k reports and the physical image file on disk? Is there anything else I can do to reduce it, aside from compressing the physical image file?

1.7 gig is still quite a bit to be shuffling around between machines.

Thanks,
Joe

author
#2 lore raw
In reply to Mike Kronenberg

Yes. That was one of my first steps. Thanks for the response.

Quoted 5 lines · Mike Kronenberg

Have you tried to defrag your Partition? If you only have one block of data and one block of free space, compression will be much more effective.

G V

#3 lore raw
In reply to Joe Bogner
Quoted 15 lines · Joe Bogner

Hello,

I'm trying to create an win2k image that is as small as possible. I'd like to be able to copy the image back and forth between machines so that I have a complete win2k development image.

According to win2k, the size is about 720mb. Originally win2k was reporting the size to be about 1.2gig, but I was able to reduce it through NTFS compression.

Here's the dilemna. The physical image file is 2.3gig. I've run a qemu-img convert -f qcow <input> -O qcow <output>, which took the original 4.5 gig image down to 2.3 gig. With qemu-img compression, I was able to get it down to 1.7gig.

Quoted 5 lines

Why is there such a large discrepency between what win2k reports and the physical image file on disk? Is there anything else I can do to reduce it, aside from compressing the physical image file?

1.7 gig is still quite a bit to be shuffling around between machines.

Even if files have been deleted/compressed the data will still be there on the disk. qemu can't tell the difference between "useful" data, and unused data that can be discarded. You need to make sure all the unused space on the image is actually zeroed.

One way to achieve this would be to shrink the guest partition to its minimum size, then create a second partition on the unused space and explicitly zero that out (using dd from knoppix if necessary).

Paul

author
#4 lore raw

WipeDisk did the trick on Windows. My physical disk image is now the same size as what the guest OS reports.

WipeDisk - http://www.birdcomputer.ca/Software/SoftwareToC.html

Thanks for your help.

Quoted 33 lines · Paul Brook
Quoted 15 lines · Joe Bogner

Hello,

I'm trying to create an win2k image that is as small as possible. I'd like to be able to copy the image back and forth between machines so that I have a complete win2k development image.

According to win2k, the size is about 720mb. Originally win2k was reporting the size to be about 1.2gig, but I was able to reduce it through NTFS compression.

Here's the dilemna. The physical image file is 2.3gig. I've run a qemu-img convert -f qcow <input> -O qcow <output>, which took the original 4.5 gig image down to 2.3 gig. With qemu-img compression, I was able to get it down to 1.7gig.

Quoted 5 lines

Why is there such a large discrepency between what win2k reports and the physical image file on disk? Is there anything else I can do to reduce it, aside from compressing the physical image file?

1.7 gig is still quite a bit to be shuffling around between machines.

Even if files have been deleted/compressed the data will still be there on the disk. qemu can't tell the difference between "useful" data, and unused data that can be discarded. You need to make sure all the unused space on the image is actually zeroed.

One way to achieve this would be to shrink the guest partition to its minimum size, then create a second partition on the unused space and explicitly zero that out (using dd from knoppix if necessary).

Paul

#6 lore raw
In reply to Joe Bogner

I have done exactly that:
-Win2k SP4
-Office 2000
-Adobe Pro 6
-Mozilla suite
-Some other stuff.

Contained in a cd compressed with Drive Image.
Uncompressed it is 1.2 GB.
It is certainly doable.

Furthermore it works at whatever machine you put it in provided that
you have the drivers for it EXCEPT pcs with sata.

I could (privately) provide the image if you want to take a look at it
but i don't want redistribution.

Under qemu some things don't work (i have posted an account of that in
the qemu list previously). I think that the root of all qemu problems under windows has something to do with the date/time of the emulated machine.

lefteris.

Quoted 29 lines · Joe Bogner

Hello,

I'm trying to create an win2k image that is as small as possible. I'd like to be able to copy the image back and forth between machines so that I have a complete win2k development image.

According to win2k, the size is about 720mb. Originally win2k was reporting the size to be about 1.2gig, but I was able to reduce it through NTFS compression.

Here's the dilemna. The physical image file is 2.3gig. I've run a qemu-img convert -f qcow <input> -O qcow <output>, which took the original 4.5 gig image down to 2.3 gig. With qemu-img compression, I was able to get it down to 1.7gig.

Why is there such a large discrepency between what win2k reports and the physical image file on disk? Is there anything else I can do to reduce it, aside from compressing the physical image file?

1.7 gig is still quite a bit to be shuffling around between machines.

Thanks,
Joe

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#5 lore raw
In reply to Paul Brook

Hello,

Quoted 6 lines

You need to make sure all the unused space on the
image is actually zeroed.

One way to achieve this would be to shrink the guest partition to its minimum size, then create a second partition on the unused space and explicitly zero that out (using dd from knoppix if necessary).

I think there is a easier way to zero unused space on an image or partition.

Mount the image/partition
cd into it
cat /dev/zero > dummy_file
(Wait until error : No space left on device)
rm dummy_file

Hope it helps,

Best regards,

Charles Longeau