Tradeoffs between btrfs, lvm, and lvm thin provisioning.

1,010 views
Skip to first unread message

indol...@gmail.com

unread,
Jun 27, 2016, 9:47:16 PM6/27/16
to qubes-users
What are the tradeoffs between btfs, lvm, and lvm with thin provisioning WRT speed and space efficiency?

Chris Laprise

unread,
Jun 28, 2016, 10:37:57 AM6/28/16
to indol...@gmail.com, qubes-users
On 06/27/2016 09:47 PM, indol...@gmail.com wrote:
> What are the tradeoffs between btfs, lvm, and lvm with thin provisioning WRT speed and space efficiency?
>

Both btrfs and (thin) lvm do similar things with copy-on-write, though I
have not seen direct comparisons of speed between them. Btrfs is more
flexible by far, though, and its what I use for Qubes. Regular lvm is
just a hassle and IMO only good for snapshots that are immediately
created and destroyed for backup procedures.

Qubes will automatically use reflinks whenever it clones vm disk images,
which is a COW copy that happens instantly and only allocates extra data
blocks when blocks are changed in either copy. It allows a lot of
experimentation to be done at virtually no cost in disk space, for
instance. This happens on a per-vm (actually, per-file) basis, without
having to do whole-filesystem snapshots as in lvm. This makes btrfs
potentially much more space efficient than the rest if you make use of
cloning. Btrfs also has compression.

Its worth noting that vm images suffer from logical fragmentation
because writing to disk image files behaves like random database
updates. Because btrfs does COW on *every* write, it does make it slower
than ext4 but on Qubes not noticeably so. Qubes vm images are sparse, so
whenever deletions occur this fragments ext4 filesystems and slows them
down also.

The fastest filesystem to use in dom0 is probably ext4 *without* lvm.
Turning off 'discard' in the vm's /rw volume may prevent some
sparse-related slowdown (at a cost in disk space). With lvm, ext4 will
probably become slower than btrfs as soon as you start making snapshots
and updates.

Beyond that, I think its possible to assign a raw block device to a vm,
though I haven't explored that yet. Ext4 on a raw block device would be
the fastest, but not flexible or space efficient.

Chris

naku...@gmail.com

unread,
Nov 25, 2016, 5:37:12 AM11/25/16
to qubes-users, indol...@gmail.com, tas...@openmailbox.org
вторник, 28 июня 2016 г., 17:37:57 UTC+3 пользователь Chris Laprise написал:
Hello Chris,

Thank you so much for your answer
Reply all
Reply to author
Forward
0 new messages