Sebastian Ochmann
2014-Jul-15 21:17 UTC
Why does btrfs defrag work worse than making a copy of a file?
Hello, I have a VirtualBox hard drive image which is quite fragmented even after very light use; it is 1.6 GB in size and has around 5000 fragments (I'm using "filefrag" to determine the number of fragments). Doing a "btrfs fi defrag -f image.vdi" reduced the number of fragments to 3749. Even doing a "btrfs fi defrag -f -t 1 image.vdi" which should make sure every extent is rewritten (according to the btrfs-progs 3.14.2 manpage) does not yield any better result and seems to return immediately. Copying the file, however, yields a copy which has only 5 fragments (simply doing a cp image.vdi image2.vdi; sync; filefrag image2.vdi). What do I have to do to defrag the file to the minimal number of fragments possible? Am I missing something? Kernel version 3.15.5, btrfs progs 3.14.2, Arch Linux. Best regards, Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html