Skip to content

sphurti/Log-Structured-Filesystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

					Log Structured File System

What is it ?
--------------
 A Log Structured Filesystem is a technique for disk storage management in which all the file writes are written sequentially in a log-like structure.  A log consists of a series of segments where each segment contains both data and inode blocks. A log structured file system gathers a segment worth of data in memory and appends the segment at the end of the log. This improves the write performance while maintaining the same read performance.

This has been implemented at user level using FUSE(Filesystem at User Space).This basic implementation of LFS creates only files. The concept of directories can be added which is very similar to that of normal file system.


Files and Naming Conventions:
--------------------------------------------
The code for the LFS consist of following src files

1. Makefile :  Makefile is used to direct the compilation of the code.

2. lfs.c and lfs.h :
The code implementing the log structured filesystem is present in lfs.c. Every function defined in this file starts with lfs_. The open,read,write,create,unlink,getattr and readdir functionalities have been implemented.

3. inode.h, segment.h and segment.c
These contain the declarations and definitions of structures that represent inode and segment summary along with the methods used to read and write segment to the log.

4. cleaner.c and cleaner.h
The cleaner function is invoked to reclaim the holes created in the log by compacting the live data and freeing segments that can be resused again.


Installation of FUSE:
--------------------------
Before compiling and running LFS, installation of FUSE is necessary. The FUSE version 26 has been used for our project. FUSE can be downloaded from the below link : 
http://sourceforge.net/projects/fuse/files/fuse-2.X/

Download fuse-2.8.6.tar.gz (505.3 kB) [ the latest version]

Uncompress the fuse-2.8.6.tar.gz using the command 
> tar -xvf fuse-2.8.6.tar.gz
 
FUSE installation :
> ./configure
>  make
>  make install

Compiling LFS:
-------------------------------------

Clone the repository for LFS from the git-hub repo using the command 
> git clone git://github.com/sphurti/Log-Structured-Filesystem.git

Go to the downloaded directory  Log-Structured-Filesystem 
> cd Log-Structured-Filesystem

To compile the LFS filesystem, executing the command

$ make

Mounting the LFS :
----------------------
The LFS is mounted by running the command lfs from the src directory which takes the mountdir as the argument.

$ mkdir /tmp/fuse
$ ./lfs /tmp/fuse
	
	Here /tmp/fuse represents the mountdir. The lfs command also creates file lfslog, a huge file that represents our filesystem . This file is created in the Log-Structured-Filesystem directory.

Running Testcases:
-----------------------
Once the filesystem is mounted using lfs command, the testcases can be run by executing the following command from the testcases directory of Log-Structured-Filesystem.

$ make
$ ./lfs_test

	The output of the testcase execution are displayed on the screen.


To rerun LFS:
------------------

- Unmount LFS, remove logfile, remove mountdir, create mountdir again.

$ fusermount -u /tmp/fuse ;  rm -f ./lfslog ; \rm -rf /tmp/fuse ; mkdir /tmp/fuse

$ ./lfs /tmp/fuse



Author :
------------

Sphurti Sortur

About

LFS using Fuse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published