Annotation of htdocs/docs/puffs/index.html, Revision 1.75
1.25 jym 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1.1 pooka 2: <html>
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
1.4 kano 6: <link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
7: <link rel="up" href="../../docs/." title="NetBSD Documentation">
1.8 wiz 8: <link rel="previous" href="../../docs/power-mgmt/." title="NetBSD Documentation: Power Management">
1.15 pooka 9: <link rel="next" href="../../docs/puffs/rump.html" title="Kernel File Systems as Userspace Servers">
1.4 kano 10: <link rel="first" href="../../docs/Hardware/." title="Hardware Documentation">
11: <link rel="last" href="../../docs/x/." title="NetBSD Documentation: The X Window System">
1.9 dsieger 12: <link rel="stylesheet" href="../../global.css" type="text/css">
1.66 maya 13: <link rel="stylesheet" href="../../donations/thermo/fundraiser.css" type="text/css">
1.1 pooka 14:
15: <title>Filesystems in userspace: puffs, refuse, FUSE, and more</title>
16: </head>
1.67 maya 17: <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
1.1 pooka 18: <body class="website"><div class="webpage">
1.58 maya 19: <a name="docs-puffs-index"></a><div id="top"><a href="#mainContent" id="skiplink" tabindex="1">Skip to main content.</a></div>
1.67 maya 20: <input id="hamburger" type="checkbox"><label class="menuicon" for="hamburger"><span></span><span></span><span></span></label><div id="navBar" role="navigation">
1.42 maya 21: <div id="centralHeader"><div id="logo">
1.68 maya 22: <a href="../../"><img id="projectLogo" alt="" height="120" src="../../images/NetBSD-smaller-tb.png"></a><a href="/"><div id="fundraiser">
1.66 maya 23: <br><div id="fundraiser-amount"><div id="fundraiser-raised"></div></div>
24: </div></a>
1.42 maya 25: </div></div>
1.1 pooka 26: <span class="doNotDisplay">
27: Navigation:
1.25 jym 28: </span><ul>
29: <li>
30: <a href="../../">
1.69 maya 31: Home</a><ul>
1.25 jym 32: <li><a href="../../changes/">
33: Recent changes</a></li>
1.45 maya 34: <li><a href="//blog.NetBSD.org/">
1.25 jym 35: NetBSD blog</a></li>
1.64 maya 36: <li><a href="../../gallery/presentations/">
37: Presentations</a></li>
1.25 jym 38: </ul>
39: </li>
40: <li>
41: <a href="../../about/">
42: About</a><ul>
1.53 maya 43: <li><a href="../../people/developers.html">
1.69 maya 44: Developers</a></li>
1.25 jym 45: <li><a href="../../gallery/">
1.61 leot 46: Gallery</a></li>
1.69 maya 47: <li><a href="//wiki.NetBSD.org/ports/">
48: Ports</a></li>
1.75 ! leot 49: <li><a href="//cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/README.html">
1.69 maya 50: Packages</a></li>
1.25 jym 51: </ul>
52: </li>
53: <li>
54: <a href="../../docs/">
55: Documentation</a><ul>
56: <li><a href="../../docs/misc/index.html">
57: FAQ & HOWTOs</a></li>
58: <li><a href="../../docs/guide/en/">
59: The Guide</a></li>
1.74 nia 60: <li><a href="//man.NetBSD.org/">
1.25 jym 61: Manual pages</a></li>
1.45 maya 62: <li><a href="//wiki.NetBSD.org/">
1.25 jym 63: Wiki</a></li>
64: </ul>
65: </li>
66: <li>
67: <a href="../../support/">
68: Support</a><ul>
1.70 leot 69: <li><a href="/community/">
1.69 maya 70: Community</a></li>
1.70 leot 71: <li><a href="/mailinglists/">
72: Mailing lists</a></li>
1.25 jym 73: <li><a href="../../support/send-pr.html">
1.69 maya 74: Bug reports</a></li>
1.25 jym 75: <li><a href="../../support/security/">
76: Security</a></li>
77: </ul>
78: </li>
79: <li>
80: <a href="../../developers/">
81: Developers</a><ul>
1.48 maya 82: <li><a href="http://cvsweb.NetBSD.org/">
1.69 maya 83: CVSWeb</a></li>
84: <li><a href="//anonhg.NetBSD.org/">
85: Mercurial</a></li>
1.45 maya 86: <li><a href="//nxr.NetBSD.org/">
1.25 jym 87: Cross-reference</a></li>
1.45 maya 88: <li><a href="//releng.NetBSD.org/">
1.25 jym 89: Release engineering</a></li>
1.45 maya 90: <li><a href="//wiki.NetBSD.org/projects/">
1.25 jym 91: Projects list</a></li>
92: </ul>
93: </li>
94: </ul>
1.1 pooka 95: </div>
1.57 maya 96: <div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
1.1 pooka 97: <h1>Filesystems in userspace: puffs, refuse, FUSE, and more</h1>
1.23 spz 98: <div class="sect1">
1.1 pooka 99: <div class="titlepage"></div>
100: </div>
101: <h3 class="title"><a name="puffs"></a></h3>
102: <ul>
103: <li><a href="#about">About</a></li>
104: <li><a href="#components">Components</a></li>
1.16 pooka 105: <li><a href="#enabling">Enabling puffs</a></li>
1.1 pooka 106: <li><a href="#examples">Base system examples</a></li>
107: <li><a href="#pkgsrc">pkgsrc & FUSE</a></li>
108: <li><a href="#moreinfo">Further Information</a></li>
109: </ul>
110: <hr>
111: <h3 class="title"></h3>
112: <h4 class="title">
1.54 maya 113: <a name="about"></a>About</h4>
1.1 pooka 114:
115: <p>
116: NetBSD now offers full support for running file systems in
117: userspace. Major components are "puffs", which is the kernel
118: subsystem that realizes the pass-to-userspace framework file
119: system, as well as the userland libraries that support
1.16 pooka 120: constructing file system implementations. These are libpuffs
121: and the FUSE compatibility library, librefuse.
1.1 pooka 122: </p>
123:
124: <p>
1.16 pooka 125: This page describes the situation in NetBSD 5.0 and later.
1.1 pooka 126: </p>
127:
128: <h4 class="title">
1.54 maya 129: <a name="components"></a>Components</h4>
1.1 pooka 130:
131: <p>
132: There are a number of components interacting to provide routines
133: for userland file systems: puffs as the kernel part, and
134: libpuffs and librefuse to provide functions for userland file
135: systems to call. The following image gives an overview of the
136: components and their connections:
137: </p>
138:
139: <div class="figure">
140: <a name="puffs-overview"></a><p class="title"><b>Figure 1. Overview about puffs</b></p>
141: <div class="figure-contents">
142:
143: <div class="mediaobject"><img src="puffs.png" alt="Overview about puffs"></div>
144: </div>
145: </div>
146: <br class="figure-break">
147:
148: <p>
149: The components themselves are:
150: </p>
151:
1.31 tron 152: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 spz 153: <li class="listitem">
1.1 pooka 154: <p>
155: <span class="bold"><strong>puffs</strong></span> is the core component
156: inside the kernel. It exposes a file
157: system interface towards the userland programs (accessible via
158: <code class="filename">/dev/puffs</code> and libpuffs), and
159: communicates with the kernel's own idea of files,
160: which are represented as vnodes.
161: The puffs kernel component and how to interface it is described
1.73 martin 162: further in the <a href="//man.NetBSD.org/NetBSD-9.1/i386/puffs.4">puffs(4)</a> manpage.
1.1 pooka 163: </p>
164: </li>
1.23 spz 165: <li class="listitem">
1.1 pooka 166: <p>
167: The "<span class="bold"><strong>libpuffs</strong></span>" library is the
168: interface between userland
169: file systems and the kernel component. It provides a number of
170: convenience routines that userland file systems can use, and is
1.73 martin 171: described in the <a href="//man.NetBSD.org/NetBSD-9.1/i386/puffs.3">puffs(3)</a> manpage.
1.1 pooka 172: </p>
173: </li>
1.23 spz 174: <li class="listitem">
1.1 pooka 175: <p>
176: To facilitate running the huge amount of file systems already
177: available for the FUSE interface, but not dictate the
178: capabilities of puffs by it, it was decided that FUSE support
179: should be provided as a compatibility layer on top of the native
180: puffs interface, which is offered by "<span class="bold"><strong>librefuse</strong></span>". The re-implementation of the
181: FUSE functionality is designed to be source code compatible with
1.73 martin 182: FUSE, and it is further described in the <a href="//man.NetBSD.org/NetBSD-9.1/i386/refuse.3">refuse(3)</a> manpage.
1.1 pooka 183: </p>
184: </li>
185: </ul></div>
186:
187: <p>
188: Examples for puffs and refuse filesystems can be found in the
189: following directory of the NetBSD source tree in
190: <code class="filename">src/share/examples/{puffs,refuse}</code>.
191: </p>
192:
193: <h4 class="title">
1.54 maya 194: <a name="enabling"></a>Enabling puffs</h4>
1.16 pooka 195:
196: <p>
1.20 pooka 197: puffs is enabled by default in GENERIC on major architectures
198: starting from NetBSD 5.0. For a custom kernel, the following
199: are required in the kernel configuration.
1.1 pooka 200:
201: </p>
202: <pre class="programlisting">
1.16 pooka 203: file-system PUFFS
204: pseudo-device putter
1.1 pooka 205: </pre>
206: <p>
207:
1.20 pooka 208: Alternatively, modules can be used.
1.7 pooka 209: </p>
1.1 pooka 210:
211: <h4 class="title">
1.54 maya 212: <a name="examples"></a>Base system examples</h4>
1.1 pooka 213:
214: <p>
215: This section presents usage examples for file systems shipped with
216: the NetBSD base system.
217: </p>
218:
1.31 tron 219: <div class="sect4">
1.1 pooka 220: <div class="titlepage"><div><div><h5 class="title">
1.73 martin 221: <a name="example-psshfs"></a>psshfs, The NetBSD sshfs (<a href="//man.NetBSD.org/NetBSD-9.1/i386/mount_psshfs.8">mount_psshfs(8)</a>)</h5></div></div></div>
1.1 pooka 222:
223:
224: <pre class="programlisting">
225: # mount_psshfs host.name.tld:/directory /puffs
226: # ls /puffs
227: AdobeFnt.lst OS bin public_html
228: Desktop OpenOffice.org1.1.0 in tmp
229: ...
230: # cd /puffs
231: # ls -l .cshrc
232: -rw-r--r-- 1 39068 2000 4706 Jun 16 01:01 .cshrc
233: # head -2 .cshrc
234: # Default .cshrc for Solaris, Irix, ...
235: #
236: # md5 .cshrc
237: MD5 (.cshrc) = 2ad1d2606a5678f312709a388376c2e5
238: # ls -l test
239: ls: test: No such file or directory
240: # date >test
241: # ls -l test
242: -rw-r--r-- 1 39068 2000 29 Nov 23 01:19 test
243: # cat test
244: Thu Nov 23 01:19:36 MET 2006
1.16 pooka 245: # umount /puffs
1.1 pooka 246: </pre>
247: </div>
248:
1.31 tron 249: <div class="sect4">
1.1 pooka 250: <div class="titlepage"><div><div><h5 class="title">
251: <a name="example-9p"></a>
1.7 pooka 252: <a class="ulink" href="http://www.cs.bell-labs.com/sys/man/5/INDEX.html" target="_top">9P</a>
1.73 martin 253: file servers (<a href="//man.NetBSD.org/NetBSD-9.1/i386/mount_9p.8">mount_9p(8)</a>)
1.1 pooka 254: </h5></div></div></div>
255:
256:
257: <pre class="programlisting">
258: # mount_9p nobody@192.168.1.2:/tmp /puffs
259: # cd /puffs
260: # echo 9puffs in action > msg_from_earth
261: # ls -l msg_from_earth
262: -rw-r--r-- 1 nobody wheel 17 Apr 25 23:24 msg_from_earth
263: # rsh 192.168.1.2 cat /tmp/msg_from_earth
264: 9puffs in action
265: #
266: </pre>
267: <p>
268: Since there is currently no support in the implementation for
269: access control or support for authentication, the account
270: nobody was picked just to prove a point. The NFS nobody
271: user really does not have anything to do with 9P. Support
272: for access control and use of pre-established secure
1.7 pooka 273: connections will be added to <span class="command"><strong>mount_9p</strong></span>
1.1 pooka 274: on a later date.
275: </p>
276: </div>
277:
278:
279: <h4 class="title">
1.54 maya 280: <a name="pkgsrc"></a>pkgsrc & FUSE</h4>
1.1 pooka 281:
282: <p>
283: FUSE compatibility was added within pkgsrc, and besides the
284: required infrastructure work a number of FUSE packages were
285: added to pkgsrc in the new "filesystem" category. Example
286: packages that are currently available include:
287: </p>
288:
1.31 tron 289: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 spz 290: <li class="listitem">
1.7 pooka 291: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/filesystems/fuse/README.html" target="_top">fuse</a>: Filesystem in Userspace (compat headers, pkg-config files,
1.1 pooka 292: etc.), needed for pkgsrc on Linux
293: </li>
1.23 spz 294: <li class="listitem">
1.7 pooka 295: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/filesystems/fuse-archivemount/README.html" target="_top">fuse-archivemount</a>:
1.1 pooka 296: FUSE gateway to libarchive
297: </li>
1.23 spz 298: <li class="listitem">
1.7 pooka 299: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/filesystems/fuse-cddfs/README.html" target="_top">fuse-cddfs</a>:
1.1 pooka 300: FUSE filesystem that uses libparanoia for audio CDs
301: </li>
1.23 spz 302: <li class="listitem">
1.7 pooka 303: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/filesystems/fuse-ntfs-3g/README.html" target="_top">fuse-ntfs-3g</a>:
1.1 pooka 304: a NTFS driver with read and write support
305: </li>
1.23 spz 306: <li class="listitem">
1.1 pooka 307: ...
308: </li>
309: </ul></div>
310:
311: <p>
312: More packages are currently being worked on, please see
1.7 pooka 313: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/filesystems/README.html" target="_top">pkgsrc/filesystems</a>
1.1 pooka 314: for a full list.
315: </p>
316:
317: <p>
318: Here is an example of installing and using the FUSE-enabled
319: NTFS-3g implementation:
320: </p>
321:
322: <pre class="programlisting">
323: # cd pkgsrc/filesystems/fuse-ntfs-3g
324: # make install
325: # ntfs-3g ntfs.img /ntfs
326: </pre>
1.13 pooka 327:
328: <p>
329: Using FUSE file systems on NetBSD 4.0 is possible, but in
330: addition to adding puffs support support to the kernel, it
331: requires fetching and manually installing a backport of the
332: ReFUSE library. The library is available
333: <a class="ulink" href="http://www.cs.hut.fi/~pooka/NetBSD/librefuse_nb4-20080115.tar.gz" target="_top">here</a>
334: and further instructions are available
1.19 kano 335: <a class="ulink" href="http://mail-index.NetBSD.org/netbsd-users/2008/01/15/msg000075.html" target="_top">here</a>.
1.13 pooka 336: </p>
1.1 pooka 337:
338: <h4 class="title">
1.54 maya 339: <a name="moreinfo"></a>Further Information</h4>
1.1 pooka 340:
341: <p>An in-depth technical description of puffs was presented at
1.7 pooka 342: <a class="ulink" href="http://www.asiabsdcon.org/" target="_top">AsiaBSDCon</a> 2007
1.1 pooka 343: in a paper entitled "puffs - Pass-to-Userspace Framework File System".
1.7 pooka 344: The <a class="ulink" href="http://2007.asiabsdcon.org/papers/P04-paper.pdf" target="_top">paper</a> and
345: <a class="ulink" href="http://2007.asiabsdcon.org/papers/P04-slides.pdf" target="_top">slides</a>
1.1 pooka 346: are available.
347: </p>
348:
1.2 pooka 349: <p>The ReFUSE emulation layer for FUSE file systems is described
1.7 pooka 350: in "<a class="ulink" href="refuse.pdf" target="_top">ReFUSE: Userspace FUSE
1.2 pooka 351: Reimplementation Using puffs</a>" presented at EuroBSDCon 2007.
352: </p>
353:
1.13 pooka 354: <p>A
355: <a class="ulink" href="http://2008.asiabsdcon.org/papers/P4B-paper.pdf" target="_top">paper</a>
356: discussing the implementation of distributed file systems on top
357: of puffs was presented at AsiaBSDCon 2008.
358: </p>
359:
1.72 kim 360: <p>The <a class="ulink" href="//man.NetBSD.org/puffs.3" target="_top">puffs</a>
1.1 pooka 361: manual pages provide further information from a development perspective.
362: </p>
363:
1.11 pooka 364: <p>The source code in browsable form:
1.10 pooka 365: </p>
1.31 tron 366: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 spz 367: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/fs/puffs/" target="_top">kernel code</a></li>
368: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/lib/libpuffs/" target="_top">libpuffs</a></li>
369: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/lib/librefuse/" target="_top">librefuse</a></li>
370: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/usr.sbin/puffs/" target="_top">puffs file systems in the base system</a></li>
371: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/share/examples/puffs/" target="_top">source code examples of other puffs file systems</a></li>
372: <li class="listitem"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/share/examples/refuse/" target="_top">source code examples for refuse</a></li>
1.10 pooka 373: </ul></div>
374: <p>
375: </p>
376:
1.1 pooka 377: </div></div></div>
378: <div class="navfoot"></div>
1.21 mishka 379: <div id="footer"><div id="footerContent"><center>
1.45 maya 380: <span class="footfeed"><a href="//www.NetBSD.org/cgi-bin/feedback.cgi">
1.1 pooka 381: Contact</a> |
1.9 dsieger 382: </span><span class="footcopy"><a href="../../about/disclaimer.html">
1.1 pooka 383: Disclaimer</a> |
384:
1.74 nia 385: <span class="copyright">Copyright © 1994-2021 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.1 pooka 386: Foundation, Inc.</span>
1.21 mishka 387: </center></div></div>
1.1 pooka 388: </div></body>
389: </html>
CVSweb <webmaster@jp.NetBSD.org>