Sympify Reddit del.icio.us Digg

Get it there ! (v0.30)
Project's page on Savannah
(ebuild is now in the tarball)
Git changelog
(this is GPL-ed software, distributed without any warranty)

What is it ?

Shake is a defragmenter that runs in userspace, without the need of patching the kernel and while the system is used (for now, on GNU/Linux only).
There is nothing magic in that : it just works by rewriting fragmented files. But it has some heuristics that could make it more efficient than other tools, including defrag and, maybe, xfs_fsr.
As an example, it allows you to write find -iname '*.mp3' | sort | shake to defrag all mp3 in a directory, puting together on the disk those close in lexical order.

How to install it ?

If you can, use the package suitable to your distribution. Packages for Ubuntu, Debian, ebuilds and RPM are available on the internet.
If you still want to use the tarball, then install cmake and developpment files for libattr. Then extract the files, open the build/ directory in a terminal, and run cmake .. (to generate the Makefiles), make (to build files) and make install.

How to use it ?

Before any use, check that your partition is mounted with user_xattr. If it is not, edit your fstab to add this option then call mount -o remount MY_PARTITION. Shake can works without them, but will be less efficient (it use xattr to store information helping incremental use).

Short version

As root, call shake my_dir, and go do something usefull or pleasant until it complete. Then my_dir should be less fragmented.
For better results, you should call Shake on the whole partition, when you're not using it.

If you just wanted to see the fragmentation, call shake --pretend --verbose --verbose my_dir, alias shake -pvv my_dir.


With --old 0 --bigsize 0, you can tell him that all files are old enough, not too big, and so need to be shaked.
If you see a warning saying "failed to set position time", read the above message about setting user_xattr on your partition.

Long version

If you want to adapt the behaviour of Shake, you should read the following lines before.
Shake do the following to decide if a file is fragmented (guilty) or not :

The code

I will write this section if someone ask for it ^_^.
The fact it runs only on GNU/Linux is due to lack of competence, not to a choice.

This page is standards compliant ! (XHTML 1.0)
Copyright 2008 (C) un_brice (Brice Arnould).