Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Stephane CHAZELAS <stephane_chazelas@yahoo.fr>
To: kvm@vger.kernel.org
Subject: Re: Convert one .img disk created with sparse=true to no sparse
Date: Thu, 20 Oct 2011 15:57:44 +0000 (UTC)	[thread overview]
Message-ID: <slrnja0h7o.i8d.stephane.chazelas@spam.is.invalid> (raw)
In-Reply-To: slrnja0dl8.h81.stephane.chazelas@spam.is.invalid

2011-10-20, 14:56(+00), Stephane CHAZELAS:
[...]
> On extent based FS (ext4, btrfs...), there might be a way to
> guarantee as few extents as possible, but I don't know it.

Actually, with both ext4 and btrfs, it is possible to defrag a
file in place. So you could un-sparse the file first:

 make sure it is not being used otherwise and:
cat < old.img 1<> old.img
or
pv < old.img 1<> old.img

to get a progress bar.

and defrag it:

e4defrag -v old.img
btrfs filesystem defragment -v old.img

(not tested).
-- 
Stephane


      reply	other threads:[~2011-10-20 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 11:21 Convert one .img disk created with sparse=true to no sparse Gonzalo Marcote Peña
2011-10-20 14:43 ` Stefan Hajnoczi
2011-10-20 21:28   ` Simon Wilson
2011-10-21 10:24     ` Stephane CHAZELAS
2011-10-21 11:20     ` Gonzalo Marcote Peña
2011-10-20 14:56 ` Stephane CHAZELAS
2011-10-20 15:57   ` Stephane CHAZELAS [this message]

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=slrnja0h7o.i8d.stephane.chazelas@spam.is.invalid \
    --to=stephane_chazelas@yahoo.fr \
    --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