On Mon, May 19, 2014 at 7:01 AM, Neil Bothwick <[email protected]> wrote: > On Mon, 19 May 2014 12:07:32 +0200, Marc Stürmer wrote: > >> Just take a look at the official Gotchas Page of BTRFS, which can be >> found here: >> >> https://btrfs.wiki.kernel.org/index.php/Gotchas >> >> Putting virtual image files on Btrfs is something that the developers >> still do not recommend at all, and that's with reason! > > The page you linked to does not actually state that. There are plenty of > hints and sideways references but little concrete information about what > is safe with the current release - hence my question.
I haven't had significant issues with casually running VMs on btrfs, but right now I wouldn't say the performance is spectacular. I do have my VM images set to use COW - I'd rather take a performance hit than not have data protected. If performance were a big concern I'd probably end up setting up an ext4 on mdadm+lvm, but I really don't want to go splitting up my drives as managing that was a real pain in the past (mdadm is much less flexible than btrfs when you have drives of differing sizes). > >> If you really do want to put them up a COW filesystem, you should try >> ZFS on Linux instead, otherwise go with XFS or ext4 - in that kind of >> order. > > They are already on ZFS but I am investigating btrfs as an alternative to > ZFS. ZFS and ext4 would mean losing the volume management that ZFS and > btrfs offer, not to mention forcing a repartition. How does ZFS prevent fragmentation? Does it use COW for all writes (I thought it did)? The fundamental issue is that data is never overwritten in place. That means that if you change one block in a 2GB file, you end up with two extents for the file, until things get bad enough that the OS ends up copying the entire file into a single extent. Maybe another strategy (if there aren't any impacted snapshots) is to overwrite data in place using a journal when you have a file with many random writes (basically like journal=data mode on ext4). That would be a bit like creating a second extent and then when there is time moving it back on top of the first extent. Once you have a snapshot I'd think you'd never be able to prevent fragmentation, though I guess if you're clever you could merge extents that share common snapshots. Has ZFS actually been shown to perform well for VMs in comparison to ext4? If so, I wonder how they do it. Rich

