From: Matthew Palmer <mpalmer@hezmatt.org>
To: kvm@vger.kernel.org
Subject: Re: Can i shrink the image file size?
Date: Sun, 22 Mar 2009 15:20:36 +1100 [thread overview]
Message-ID: <20090322042036.GN21195@hezmatt.org> (raw)
In-Reply-To: <5p3bs4pg76tcivd96qpqs0nbkg1uq1nssl@4ax.com>
On Sun, Mar 22, 2009 at 12:12:13PM +1100, Ross McKay wrote:
> John Wong wrote:
>
> >I create the 30G qcow2 image file, installed winxp, winxp show me the
> >harddisk used 5G, but the image file size is 12G now.
> >can i shrink the image file size? how?
> >my kvm version is: "kvm-84", qemu version is: "0.9.1".
> >please help, thank you.
>
> In addition to what the others said, you might be able to reclaim some
> space by running qemu-img convert. If you tell it to compress, it will
> certainly reduce the image file size, perhaps with a little loss in
> performance.
The problem there is that qemu-img convert will only save space where the
blocks are zeroes, and most filesystems don't zero blocks when they're
freed, so not much space is actually saved.
I'm working on a tool at the moment that understands various filesystem
formats and doesn't copy the non-zero freed blocks either. It's only
working for swap partitions at the moment, but once I get up to speed on how
ext2/3 works I'll have that sorted. I guess I should announce it here once
I get ext2 support working now that there are people here who care...
- Matt
--
MacOS X ... [is] enough of a bother to luse it if you've progressed past the
"ooh, click on the shiny little picture!" stage, if you try to treat it as a
serious OS, then it really gets out the little tricycle wheels and the toy
horn that goes "onk! onk!" -- Dave Brown, ASR
next prev parent reply other threads:[~2009-03-22 4:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-21 16:45 Can i shrink the image file size? John Wong
2009-03-21 19:47 ` Piavlo
2009-03-21 20:25 ` Luca Tettamanti
2009-03-22 1:12 ` Ross McKay
2009-03-22 4:20 ` Matthew Palmer [this message]
2009-03-23 5:26 ` Alberto Treviño
2009-03-23 8:03 ` Ross McKay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090322042036.GN21195@hezmatt.org \
--to=mpalmer@hezmatt.org \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox