Skip to contentSkip to conversation

Defragmenting open files

DISCUSSION Swâmi Petaramesh 1 participant 1 message Feb 28, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi folks,

My BTRFS systems now have slowed down to the point where I finally decided to trash all my snapshots and try and defrag it all.

I basically wrote a shell script that goes down the complete FS tree, runs a "filefrag" over each file and issues a "btrfs filesystem defrag $blah" against every files which number of fragments is > 1.

I'm currently running it, but I notice that for every file that is likely open (i.e. /bin/bash), my script spits out :

failed to open /bin/bash
open:: Text file busy
total 1 failures
FAILED !

I expected that the BTRS defragmentation was done by the kernel and was able to handle open files, but apparently not ?

Another question is : Is there a way to determine if a directory needs a defrag ? filefrag doesn't seem to be able to work properly against a directory...

TIA.

Kind regards.

Signature · 2 lines
Swâmi Petaramesh <[email protected]> http://petaramesh.org PGP 9076E32E
Ne cherchez pas : Je ne suis pas sur Facebook.