Root/fs/mini_fo/README

1README for the mini_fo overlay file system
2=========================================
3
4
5WHAT IS MINI_FO?
6----------------
7
8mini_fo is a virtual kernel file system that can make read-only
9file systems writable. This is done by redirecting modifying operations
10to a writeable location called "storage directory", and leaving the
11original data in the "base directory" untouched. When reading, the
12file system merges the modifed and original data so that only the
13newest versions will appear. This occurs transparently to the user,
14who can access the data like on any other read-write file system.
15
16Base and storage directories may be located on the same or on
17different partitions and may be of different file system types. While
18the storage directory obviously needs to be writable, the base may or
19may not be writable, what doesn't matter as it will no be modified
20anyway.
21
22
23WHAT IS GOOD FOR?
24-----------------
25
26The primary purpose of the mini_fo file system is to allow easy
27software updates to embedded systems, that often store their root
28file system in a read-only flash file system, but there are many
29more as for example sandboxing, or for allowing live-cds to
30permanently store information.
31
32
33BUILDING
34--------
35This should be simple. Adjust the Makefile to point to the correct
36kernel headers you want to build the module for. Then:
37
38    # make
39
40should build "mini_fo.o" for a 2.4 kernel or "mini_fo.ko" for a 2.6
41kernel.
42
43If you are building the module for you current kernel, you can install
44the module (as root):
45
46    # make install
47
48or uninstall with
49
50    # make uninstall
51
52
53USING THE FILE SYSTEM
54--------------------
55
56the general mount syntax is:
57
58   mount -t mini_fo -o base=<base directory>,sto=<storage directory>\
59                            <base directory> <mount point>
60
61Example:
62
63You have mounted a cdrom to /mnt/cdrom and want to modifiy some files
64on it:
65
66load the module (as root)
67
68    # insmod mini_fo.o for a 2.4 kernel or
69
70    # insmod mini_fo.ko for a 2.6 kernel
71
72
73create a storage dir in tmp and a mountpoint for mini_fo:
74
75    # mkdir /tmp/sto
76    # mkdir /mnt/mini_fo
77
78and mount the mini_fo file system:
79
80    # mount -t mini_fo -o base=/mnt/cdrom,sto=/tmp/sto /mnt/cdrom /mnt/mini_fo
81
82
83Now the data stored on the cd can be accessed via the mini_fo
84mountpoint just like any read-write file system, files can be modified
85and deleted, new ones can be created and so on. When done unmount the
86file system:
87
88    # unmount /mnt/mini_fo
89
90Note that if the file system is mounted again using the same storage
91file system, of course it will appear in the modified state again. If
92you remount it using an new empty storage directory, it will be
93unmodified. Therefore by executing:
94
95    # cd /tmp/sto
96    # rm -rf *
97
98you can nuke all the changes you made to the original file system. But
99 remember NEVER do this while the mini_fo file system is mounted!
100
101
102Alternatively you can use the mini_fo-overlay bash script, that
103simplifies managing mini_fo mounts. See TOOLS Section.
104
105
106TOOLS
107-----
108
109mini_fo-merge (experimental):
110
111This is a bash script that will merge changes contained in the storage
112directory back to the base directory. This allows mini_fo to function
113as a cache file system by overlaying a slow (network, ...) file system
114and using a fast (ramdisk, ...) as storage. When done, changes can be
115merged back to the (slow) base with mini_fo-merge. See "mini_fo-merge
116-h" for details.
117
118It can be usefull for merging changes back after a successfull test
119(patches, software updates...)
120
121
122mini_fo-overlay:
123
124This bash script simplifies managing one or more mini_fo mounts. For
125overlaying a directory called "basedir1", you can just call:
126
127    # mini_fo-overlay basedir1
128
129This will mount mini_fo with "basedir1" as base, "/tmp/sto-basedir1/"
130as storage to "/mnt/mini_fo-basedir1/". It has more options though,
131type "mini_fo-overlay -h" for details.
132
133
134DOCUMENTATION, REPORTING BUGS, GETTING HELP
135-------------------------------------------
136
137Please visit the mini_fo project page at:
138
139http://www.denx.de/twiki/bin/view/Know/MiniFOHome
140
141
142WARNINGS
143--------
144
145Never modify the base or the storage directorys while the mini_fo
146file system is mounted, or you might crash you system. Simply accessing
147and reading should not cause any trouble.
148
149Exporting a mini_fo mount point via NFS has not been tested, and may
150or may not work.
151
152Check the RELEASE_NOTES for details on bugs and features.
153
154
155
156Copyright (C) 2004, 2005 Markus Klotzbuecher <mk@creamnet.de>
157
158This program is free software; you can redistribute it and/or
159modify it under the terms of the GNU General Public License
160as published by the Free Software Foundation; either version
1612 of the License, or (at your option) any later version.
162
163
164

Archive Download this file



interactive