forked from sphurti/Log-Structured-Filesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
87 lines (54 loc) · 3.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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