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