Lessfs 1.5 On CentOS 5

There is plenty of tuning to be done based on volume size, file types, and compression choices.

The latest lessfs required more recent versions of fuse and tokyocabinet than was in the CentOS repository, so I chose to install most of this from source.

1 Install dependencies:

need ‘gcc’ packages or others to compile

yum install mhash-devel pkgconfig zlib-devel bzip2-devel

2 Install Fuse from source

wget http://sourceforge.net/projects/fuse/files/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz/download
tar xzvf fuse-2.8.5.tar.gz
cd fuse-2.8.5
./configure && make && make install
cd ..

3 Install TokyoCabinet from source

wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz
tar xzvf tokyocabinet-1.4.47.tar.gz
cd tokyocabinet-1.4.47
./configure && make && make install
cd ..

4 Install LessFS from source

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
wget http://sourceforge.net/projects/lessfs/files/lessfs/lessfs-1.5.4/lessfs-1.5.4.tar.gz/download
tar xzvf lessfs-1.5.4.tar.gz
cd lessfs-1.5.4
./configure && make && make install

5 Configure lessfs

cp etc/lessfs.cfg /etc/

5.1 Edit /etc/lessfs.cfg
the kernel is less than version 2.6.26

5.2 Prepare the volume

create the mountpoint used to work

mklessfs -fc /etc/lessfs.cfg
mkdir /lessfs

5.3 Edit /etc/rc.d/rc.local

modprobe fuse > /dev/null 2>&1

5.4 Load the fuse module

modprobe fuse

5.5 Configure lessfs startup

cp etc/lessfs-init.example /etc/init.d/lessfs

5.5.1 Add lessfs to init

chkconfig --add lessfs
chkconfig lessfs on

6 Start it up and Test it

/etc/init.d/lessfs start

6.1 Verify that it’s mounted


6.2 Copy files
I copied data from my host, but you could pull from anywhere, or use the dd command to create empty files. Watch the disk usage on /lessfs (where you’re copying to) and /data (where it’s actually being stored) and compare the two to see how efficient lessfs is. The more similar the data is, the more efficient the deduplication will be. Images, encrypted files, and compressed files don’t deduplicate as well, or at all

Leave a comment