Why consider using fusecompress?
Many light-weight Notebooks and all Chromebooks today come with balzingly fast but limited capacity Solid State Drives (SSDs) on the theory that people store much of their data in the cloud. However, to use these as Android development machines, you typically do need to store space hogs like sources & library documentation, emulator images etc locally.Fusecompress is a great little legacy utility that uses the FUSE (File System in User Space) library to provide an on the fly compressed mountable filesystem that in effect lets you compress specific directories in manner completely transparent to all other programs.
I use my HP Chromebook 14 loaded with Ubuntu 14.04 via the ChrUbuntu on a lean 9GB partition as my primary development machine for instance & fusecompress the Android & Python offline documentation & Emulator system images. This reduces the SSD footprint considerably with barely any impact on the documetation load times. The Emulator startup does become significantly slower but then I need to do it only once each session.
Installing fusecompress on Ubuntu 14.04
Fusecompress however is not available in the standard Ubuntu repositories & must be compiled from source. Given the legacy nature of the codebase, it's a bit tricky to compile for novices due to a large number of dependencies & this blog post outlines the process step-by-step.
1. Install Aptitude
When I was using apt-get to install the dependency library sources, I found in a couple of cases the latest development releases of the libraries had conflicts & I had to regress to the previous version to install them. Aptitude does a much better job of solving for conflicts & so I'd recommend using aptitude rather than apt-get.
sudo apt-get install aptitude
2. Install the auto build tools
If they're not installed on your system already, you'll need to install autoconf & automake to be able to build from source.
sudo aptitude install autoconf automake libtool
3. Install compression algorithms development packages
Next install the development packages for compression algorithms supported by fusecompress - LZO, LZMA, ZLib & BZ2. I ran into trouble in the LZO package where I had to revert from the 2.06-1.2ubuntu1.1 version to 2.06-1.2ubuntu1 version. Aptitude gives you a series of menu choices to handle this smoothly
sudo aptitude install zlib1g-dev libbz2-dev liblzma-dev liblzo2-dev
4. Install the FUSE development package
sudo aptitude install libfuse-dev
5. Download the fusecompress sources
You can checkout the fusecompress source from Google Code with SubVersion.
svn checkout http://fusecompress.googlecode.com/svn/trunk/ fusecompress-read-only
If you don't have subversion installed, you can install the package
sudo aptitude install subverion
5. Run the fusecompress build process
Change to the folder where you've downloaded the fusecompress sources & run the following commands
./autogen.sh ./configure make
Using fusecompress
The least disruptive way I found to use fusecompress is to simply mount the compressed folders exactly where they currently are. The key thing to remember while using fusecompress is that it compress files when they get written to disk. So files that are already in the folder won't automatically get compressed. So the way I typically manage this is:
1. Rename the directory you want to compress
mv directoryname temporaryname
2. Create an empty directory with the old name
mkdir directoryname
3. Fusecompress the directory
If you want to use the default fast but light LZO compression, just type
fusecompress directoryname
If you want to choose a compression algorithm with a better ratio like LZMA, use
fusecompress -c lzma directoryname
You may want to add this line to your ~/.profile to automatically mount the compressed folder every time you login.
4. Move back all the contents
cd temporaryname mv *.* ../directoryname
0 comments:
Post a Comment