strange filefrag output on btrfs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below.
aph@thor /mnt/nutshell $ sudo filefrag -v funtoo.img | grep extents funtoo.img: 2624 extents found
aph@thor /mnt/nutshell $ sudo filefrag funtoo.img | grep extents funtoo.img: 2653 extents found
Thanks,
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJN84wiAAoJEJIcBJ3+XkgikzsQAKlH4dMcDMAplulM67TNUDRy hMwQhgpkLTBfvB7SRcNImojPwj2TQq6CXWHqk+yjufN6Mz4Tb1F5vWbgPwQOkC3S BNtNCJrua6COO2ijOv12UubTY6qQZqXSXNB2be5SVeh9Jt+DUZ55EJRUlhbPb7al xhXIRNzIW4P0TfTfLgrQ4cZT+89FGilMe0x4YAw6TCl50f28X7Xjj94UHurM/wzX eX2rR37GALSOw2CwIR2m9fmTOPXw61puXyx2ddO4iv3KWmu8lpp9Cl7QkacSKpOd kxg0jFVAGj7NAeZU4ekVqZq0GVOqlNEwYfAZyGPI6D6PfO+Fj7l+hWh2aohv0GsL xU1mcN9d7X+dvwt4NwbAS3H+ZlHIwJeRIdKyFwvMu3gyLmASuDJIZfFkomFzSfjN DNMWvJdXoB4NZoi4I4cIIrQkcVHwglz3NjjCTErbvKHP7oALXqKGVaB2jIQQCOzz gi201uGWaOM/tbIUGUxe9nL2cMfID+frMtBng7Q0muPiI57ek4vm7c2wA//2PK9S /ZGfhzgZPOWQcULhzQ1/o9vIq6asnnd3eGAgEQAeuO90QAEMrnUY8MAsfK8m3i0L EU7XyziQ3j2vXrN5HKkEJiKHjCrnK7/kFG0y0L5iWGBt0/29YMYqAqxDSvu7RXo/ laQ+Z6t5BcfRrP3I2lX/
=6T05
-----END PGP SIGNATURE-----
Quoted 8 lines · Andreas Philipp
On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below.
aph@thor
/mnt/nutshell$ sudo filefrag -v funtoo.img | grep extents funtoo.img: 2624 extents found
aph@thor/mnt/nutshell$ sudo filefrag funtoo.img | grep extents funtoo.img: 2653 extents found
is the file open and being written to? did you run sync before the first command?
david
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 5 lines · David Sterba
Quoted 4 lines · Andreas Philipp
On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below.
Quoted 7 lines
Quoted 4 lines
aph@thor
/mnt/nutshell$ sudo filefrag -v funtoo.img | grep extents funtoo.img: 2624 extents found
aph@thor/mnt/nutshell$ sudo filefrag funtoo.img | grep extents funtoo.img: 2653 extents foundis the file open and being written to? did you run sync before the first command?
The file is not open. Yes, I have run sync before the first command. Now, I tested again with a copy of file but the results is more or less the same.
aph@thor /mnt/nutshell $ cp funtoo.img funtoo.1.img aph@thor /mnt/nutshell $ sync
aph@thor /mnt/nutshell $ sudo filefrag -v funtoo.img funtoo.1.img | grep extents
funtoo.img: 2624 extents found
funtoo.1.img: 57 extents found
aph@thor /mnt/nutshell $ sudo filefrag funtoo.img funtoo.1.img | grep extents
funtoo.img: 2653 extents found
funtoo.1.img: 311 extents found
Thanks,
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJN9inZAAoJEJIcBJ3+XkgiADgP/1+B26+vvEhb2cFy64gCh9c1 eeJJXgZgQsMkq4ScTwmdgBkG49XtFRao+IAJLT8NEEYfWK2s/e7COK5KvjqHQP6T Z64TKo/SKD3YaskszZEO30fM/A9pXcsDDRaCgOXJosCjRfl2vNyxvSMjnRRGEGGL F4qI9sr9pkZrqbzwIrhPFBm1etkwMOOrXyqByg/VQoNxTts6xZ9hz0l42qOhrjXW EZ1zLRrDqd0HTBPmrkntG4yACBW4/eJf0vPPn7cNRFf1a6ts9UTAgEOkobgP4tho D+mGle5bPElyB72tcQ2jutk9+qr89VrUjrNHNHU3QAI9ZtvWLeHIS1P2PkiXk/s2 xQKL83V8QGoeK8BQTB2exMf7cBrgoVs4IfTcXaQyperFRFTYtjQ78J8p2iPvwTKY 6/4LkHkIEPJO3IZ81TFv1Vm5wefGqMWnpTRgvzLv52UlbNEkdcvdNM5IWGiIhFD6 cVQohZuHaTidhn2ancBVd3qE3oYMiBQknvKG39seUw8zTRixz7Ac+/uF7kcQSP6U 4RatjRADGN99Kt4ydwpZbIBiDQxttR+Js/sv8E8skqll96LeT+DVzMh2JRx+iy93 eatIlrTIgoPfi3Oo+NUXczMfamYfG7UcVhBUxDlQUTtKPAhPHmXvE9pkjqIJ5sxD 3mkSkEZ6ZXGujyIPXnfQ
=Yx0a
-----END PGP SIGNATURE-----
Quoted 21 lines · Andreas Philipp
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 5 lines · David Sterba
Quoted 4 lines · Andreas Philipp
On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below.
Quoted 7 lines
Quoted 4 lines
aph@thor
/mnt/nutshell$ sudo filefrag -v funtoo.img | grep extents funtoo.img: 2624 extents found
aph@thor/mnt/nutshell$ sudo filefrag funtoo.img | grep extents funtoo.img: 2653 extents foundis the file open and being written to? did you run sync before the first command?
The file is not open. Yes, I have run sync before the first command. Now, I tested again with a copy of file but the results is more or less the same.
Quoted 11 lines
aph@thor
/mnt/nutshell$ cp funtoo.img funtoo.1.img aph@thor/mnt/nutshell$ sync
aph@thor/mnt/nutshell$ sudo filefrag -v funtoo.img funtoo.1.img | grep extents
funtoo.img: 2624 extents found
funtoo.1.img: 57 extents found
aph@thor/mnt/nutshell$ sudo filefrag funtoo.img funtoo.1.img | grep extents
funtoo.img: 2653 extents found
funtoo.1.img: 311 extents found
If you look into the source code of filefrag, you'll know why.
There are two ways to calc the extent number, depending on whether verbose option is turned on or not.
In the verbose mode, it will check if the next extent is adjacent to the prev extent in the physical position, and in this case they are considered to be one extent.
That's why the number returned in verbose mode is smaller.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 33 lines · Li Zefan
Quoted 22 lines · Andreas Philipp
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Quoted 7 lines · David Sterba
Quoted 5 lines · Andreas Philipp
On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below.
Quoted 7 lines
Quoted 4 lines
aph@thor
/mnt/nutshell$ sudo filefrag -v funtoo.img | grep extents funtoo.img: 2624 extents found aph@thor/mnt/nutshell$ sudo filefrag funtoo.img | grep extents funtoo.img: 2653 extents foundis the file open and being written to? did you run sync before the first command?
The file is not open. Yes, I have run sync before the first command. Now, I tested again with a copy of file but the results is more or less the same.
Quoted 7 lines
aph@thor
/mnt/nutshell$ cp funtoo.img funtoo.1.img aph@thor/mnt/nutshell$ sync aph@thor/mnt/nutshell$ sudo filefrag -v funtoo.img funtoo.1.img | grep extents funtoo.img: 2624 extents found funtoo.1.img: 57 extents found aph@thor/mnt/nutshell$ sudo filefrag funtoo.img funtoo.1.img | grep extents funtoo.img:
2653 extents found funtoo.1.img: 311 extents foundIf you look into the source code of filefrag, you'll know why.
Quoted 8 lines
There are two ways to calc the extent number, depending on whether verbose option is turned on or not.
In the verbose mode, it will check if the next extent is adjacent to the prev extent in the physical position, and in this case they are considered to be one extent.
That's why the number returned in verbose mode is smaller.
Thank you for this explanation.
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJN9wmvAAoJEJIcBJ3+XkgiIWgQAL0+SLwnc6V6nar30rG6wCt+ czTTy7wFgdP5oYby9NMj2a5YifxG2XBa+Hnw3doLSxTHv4i7WqouaFeT4OotBzb+ jV8GBAn3vRyGlV0mfEx1PHzqUJNzUpJHZpWKvKx4JW91z3gZ/FdXEhbZXNyTVvPm WtaLXz71CMtCSy81TN437T92H7yvv4SxiRubbe+IuBpKCJaIA1eH2yoJ+72yDNKH TS74hvfYoDXngxZry4EA2/3mGTOq3PMSljWBw76pqx47KhsZged0ZN+YA8th7iiK H3Pm3m19yzvt5niA5aS/ilwR50pKE2LI2dq7kkc2yjol/A86iUmIkAEm94Bv7a/3 hdBHslzqZpb2sWaQB2qjDA9aWGyDld3B2C1a+CiYSr0kqtPRlWKPPCQiDNibxrMp cC2vT92OCoJMnsz7OC3nQN+UZAzBTnx7deFVAlgxnLrsuVT2IZMfxeurTLGJy0vG zygp7pXdLbj4pzvLcIbf53DQ8wsSfQfLlMDec7wj+TpDLWCuBLQRVmWIKsc1ovMb epoBihD4xJZguaeQAsyxBuFgYNoWCj0ebxWejGIYvilCZ8SJflN8/dEN3HaT8haR 9k6qdNB9cNULggs4dN8zvB530InDNxJHuI67hRcdLs+VDcWHjCdXmfcgn3Lz5km4 wDAlG4uZi/T5Pqz1Eqvq
=NrYD
-----END PGP SIGNATURE-----
Quoted 2 lines · Li Zefan
There are two ways to calc the extent number, depending on whether verbose option is turned on or not.
To me that's very counter intuitive!
Maybe another way to do that is to name those two values differently and in verbose mode report them both so people can see that there is a match ?
cheers,
Chris
Signature · 1 line
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC