Lessfs 1.5 On CentOS 5

Want to support HowtoForge? Become a subscriber!
 
Submitted by ExocTBlid (Contact Author) (Forums) on Mon, 2011-09-26 19:25. :: CentOS

Lessfs 1.5 On CentOS 5

For this HowTo I used a VirtualBox with CentOS 5.7 x86_64. I attached a separate 20GB Data drive mounted to /data. This will hold the lessfs DB and data. The lessfs mountpoint I put at /lessfs.

This is a very basic setup, just to get it running. 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:

You may 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

Because the kernel is less than version 2.6.26, it doesn't support block sizes over 4096.

Change the following variable to look like this:

BLKSIZE=4096

 

5.2 Prepare the volume

By default the DB is configured in the /data directory. The following commands will create the database and file structure in /data, and then create the mountpoint used to work with the files.

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

 

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

Add the following line:

modprobe fuse > /dev/null 2>&1

 

5.4 Load the fuse module

modprobe fuse

 

5.5 Configure lessfs startup

You should still be in the lessfs source directory

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

 

5.5.1 Edit /etc/init.d/lessfs

PATH=$PATH:/usr/bin:/usr/local/bin
LD_LIBRARY_PATH=/usr/local/lib
MKLESSFS=/usr/local/bin/mklessfs
MOUNTPOINT=/lessfs
LESSFS_OPTS="/etc/lessfs.cfg $MOUNTPOINT"
LESSFS=/usr/local/bin/lessfs

 

5.5.2 Add lessfs to init

chkconfig --add lessfs
chkconfig lessfs on

 

6 Start it up and Test it

You can reboot, to test your startup script, or use this command

/etc/init.d/lessfs start

 

6.1 Verify that it's mounted

Running

mount

should give you similar output to this:

mount
[...]
[...]
[...]
fuse on /lessfs type fuse[...]

 

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.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by bluelinq@gmail.com (not registered) on Wed, 2013-11-27 04:02.

Not sure I follow

is the data stored in /data or in /lessfs?

say I have an NDS export in etc/export with

/nas/GENERIC2           172.16.1.0/24(rw,no_root_squash,async,no_wdelay)

and in my /etc/lessfs.cfg the standard stuff for /data/dta and /mta

In my init file the MOUNTPOINT=/nas

So where is really the data being stored? I only see /nas consumed with files and very little under /data

Regards,

 

Paul

Submitted by Amal Antony (not registered) on Thu, 2011-11-24 06:49.
pls add postfix compilation in an easier way