Go to the first, previous, next, last section, table of contents.


Which files have an indirect cluster bitmap block?

The following command shows which files are larger than 16 clusters:

find mountpoints -xdev -type f -size +64k -exec sh -c "
e2bitmap '{}' | 
sed -e 's/.*: //' -e 's/ .*//' |
cut -c 17- |
grep -q '[01]'
" \; -print0 > /tmp/bigpaths;
xargs -0 ls -li < /tmp/bigpaths

(For mountpoints, substitute the current mount points of the filesystems that you wish to defragment; e.g. `/mnt'.)

Note that the above command will take a while to run.

[For the technically interested: A small proportion of the files displayed by the above command, don't in fact have an indirect cluster bitmap block. (This is because e2compr doesn't allocate a cluster bitmap block until a cluster after the first 16 is found that compresses. However, you can't safely change the `[01]' in the above to `1' because the extra bitmap block isn't necessarily deallocated when the file contents change such that there cease to be any compressed clusters after the first 16 clusters. That said, most files are only written to at creation; for such files it would be safe to change the `[01]' to `1' because the bitmap has never changed.)]


Go to the first, previous, next, last section, table of contents.