Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Robert White <rwhite@pobox.com>
To: Marc MERLIN <marc@merlins.org>,
	Larkin Lowrey <llowrey@nuclearwinter.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Heavy nocow'd VM image fragmentation
Date: Fri, 24 Oct 2014 19:41:32 -0700	[thread overview]
Message-ID: <544B0DDC.1020102@pobox.com> (raw)
In-Reply-To: <20141024114916.GI12554@merlins.org>

On 10/24/2014 04:49 AM, Marc MERLIN wrote:
> On Thu, Oct 23, 2014 at 06:04:43PM -0500, Larkin Lowrey wrote:
>> I have a 240GB VirtualBox vdi image that is showing heavy fragmentation
>> (filefrag). The file was created in a dir that was chattr +C'd, the file
>> was created via fallocate and the contents of the orignal image were
>> copied into the file via dd. I verified that the image was +C.
> To be honest, I have the same problem, and it's vexing:

If I understand correctly, when you take a snapshot the file goes into 
what I call "1COW" mode. The snapshot is pinning the old image into 
place and the new data has to go somewhere. One explainer said it was 
"on its head" but I suspect the fragmentation still ends up in the 
written segment.

Options may include transferring the VMs to a subvolume that you don't 
snapshot very often.

Doing backups by taking the snapshot, transfering it to backup, and then 
dropping it before you restart the virtual machine.

Honestly while autodefrag would be your enemy, I don't see a lot of 
harm/degradation in leaving the VM images on my drive all normal COW and 
doing the occasional defrag.

I could, of course, be wrong.


  reply	other threads:[~2014-10-25  2:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 23:04 Heavy nocow'd VM image fragmentation Larkin Lowrey
2014-10-24 11:49 ` Marc MERLIN
2014-10-25  2:41   ` Robert White [this message]
2014-10-25  3:28     ` Duncan
2014-10-26 17:20       ` Larkin Lowrey
2014-10-27  6:44         ` Duncan
2014-10-27 12:04         ` Austin S Hemmelgarn

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=544B0DDC.1020102@pobox.com \
    --to=rwhite@pobox.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=llowrey@nuclearwinter.com \
    --cc=marc@merlins.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