On Aug 13, 2014, at 9:57 PM, "G. Richard Bellamy" <rbellamy@xxxxxxxxxxxxx> wrote: > On Mon, Aug 11, 2014 at 11:36 AM, G. Richard Bellamy > <rbellamy@xxxxxxxxxxxxx> wrote: >> That being said, how would I determine what the root issue is? >> Specifically, the qcow2 file in question seems to have increasing >> fragmentation, even with the No_COW attr. >> >> [1] >> $ mkfs.btrfs -m raid10 -d raid10 /dev/sda /dev/sdb /dev/sdc /dev/sdd >> $ mount /dev/sda /mnt >> $ cd /mnt >> $ btrfs create subvolume __data >> $ btrfs create subvolume __data/libvirt >> $ cd / >> $ umount /mnt >> $ mount /dev/sda /var/lib/libvirt >> $ chattr +C /var/lib/libvirt/images >> $ cp /run/media/rbellamy/433acf1d-a1a4-4596-a6a7-005e643b24e0/libvirt/images/atlas.qcow2 >> /var/lib/libvirt/images/ >> $ filefrag /var/lib/libvirt/images/atlas.qcow2 >> /var/lib/libvirt/images/atlas.qcow2: 0 extents found Sorta weird, it ought to have at least 1. Or maybe it wasn't sync'd yet from the copy. >> [START UP THE VM - DO SOME THINGS] >> $ filefrag /var/lib/libvirt/images/atlas.qcow2 >> /var/lib/libvirt/images/atlas.qcow2: 12236 extents found >> [START UP THE VM - DO SOME THINGS] >> $ filefrag /var/lib/libvirt/images/atlas.qcow2 >> /var/lib/libvirt/images/atlas.qcow2: 34988 extents found > > I appreciate the information to date. lsattr /var/lib/libvirt/images/atlas.qcow2 Is the xattr actually in place on that file? > > So, I think my question still stands: how can I determine empirically > what is causing the fragmentation? It will fragment somewhat but I can't say that I've seen this much fragmentation with xattr C applied to qcow2. What's the workload? How was the qcow2 created? I recommend -o preallocation=metadata,compat=1.1,lazy_refcounts=on when creating it. My workloads were rather simplistic: OS installs and reinstalls. What's the filesystem being used in the guest that's using the qcow2 as backing? It might be that your workload is best suited for a preallocated raw file that inherits +C, or even possibly an LV. Chris Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
