From: Kai Krakow <hurikhan77@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: mount option nodatacow for VMs on SSD?
Date: Mon, 28 Nov 2016 09:20:15 +0100 [thread overview]
Message-ID: <20161128092015.70b75dd8@jupiter.sol.kaishome.de> (raw)
In-Reply-To: 20161128003829.GD15348@rus.uni-stuttgart.de
Am Mon, 28 Nov 2016 01:38:29 +0100
schrieb Ulli Horlacher <framstag@rus.uni-stuttgart.de>:
> On Sat 2016-11-26 (11:27), Kai Krakow wrote:
>
> > > I have vmware and virtualbox VMs on btrfs SSD.
>
> > As a side note: I don't think you can use "nodatacow" just for one
> > subvolume while the other subvolumes of the same btrfs are mounted
> > different. The wiki is just wrong here.
> >
> > The list of possible mount options in the wiki explicitly lists
> > "nodatacow" as not working per subvolume - just globally for the
> > whole fs.
>
> Thanks for pointing this out!
> I have misunderstood this, first.
You can, however, use chattr to make the subvolume root directory (that
one where it is mounted) nodatacow (chattr +C) _before_ placing any
files or directories in there. That way, newly created files and
directories will inherit the flag. Take note that this flag can only
applied to directories and empty (zero-sized) files.
That way, you get the intended benefit and your next question applies a
little less because:
> Ok, then next question :-)
>
> What is better (for a single user workstation): using mount option
> "autodefrag" or call "btrfs filesystem defragment -r" (-t ?) via
> nightly cronjob?
>
> So far, I use neither.
When using the above method to make your VM images nodatacow, the only
fragmentation issue you need to handle is when doing snapshots.
Snapshots are subject to copy-on-write. If you do heavy snapshotting,
you'll be getting heavy fragmentation based on the write-patterns. I
don't know if autodefrag will handle nodatacow files. You may want to
use a dedupe utility after defragmentation, like duperemove (running
it manually) or bees (a background daemon also trying to keep
fragmentation low).
If you are doing no or infrequent snapshots, I won't bother with manual
defragging at all for your VM images since you're on SSD. If you aren't
going to use snapshots at all, you even won't have to think about
autodefrag, tho I still recommend to enable it (see post from Duncan).
Manual defrag is a highly write-intensive operation, rewriting multiple
gigabytes of data. I strongly recommend against using it on a daily
basis for SSD.
--
Regards,
Kai
Replies to list-only preferred.
next prev parent reply other threads:[~2016-11-28 8:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 8:28 mount option nodatacow for VMs on SSD? Ulli Horlacher
2016-11-25 12:01 ` Duncan
2016-11-25 12:25 ` Roman Mamedov
2016-11-26 10:27 ` Kai Krakow
2016-11-28 0:38 ` Ulli Horlacher
2016-11-28 2:56 ` Duncan
2016-11-28 9:49 ` [Not TLS] " Graham Cobb
2016-11-29 5:14 ` Duncan
2016-11-29 10:34 ` [Not TLS] " Niccolò Belli
2016-11-29 12:18 ` [Not TLS] " Austin S. Hemmelgarn
2016-11-28 8:20 ` Kai Krakow [this message]
2016-11-28 11:11 ` Niccolò Belli
2016-11-29 5:06 ` Duncan
2016-11-29 12:20 ` 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=20161128092015.70b75dd8@jupiter.sol.kaishome.de \
--to=hurikhan77@gmail.com \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).