Difference between revisions of "FUSE"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(Added info on umounting sshfs)
m (VPS -> VE, minor formatting fixes)
Line 1: Line 1:
This page describes how to setup fuse inside VPS
+
This page describes how to setup FUSE (filesystem in userspace) inside a VE.
  
== Introduction ==
 
 
[http://git.openvz.org/?p=linux-2.6.18-openvz;a=blob;h=a584f05403a412e778cf359e84d3690d5a22d1e4;hb=045f4a5fcb8c2625fe7505a8d9d4ebffd7e0d905;f=Documentation/filesystems/fuse.txt FUSE] is a filesystem in which data and metadata are provided by an ordinary userspace process. The filesystem can be accessed normally through the kernel interface.
 
[http://git.openvz.org/?p=linux-2.6.18-openvz;a=blob;h=a584f05403a412e778cf359e84d3690d5a22d1e4;hb=045f4a5fcb8c2625fe7505a8d9d4ebffd7e0d905;f=Documentation/filesystems/fuse.txt FUSE] is a filesystem in which data and metadata are provided by an ordinary userspace process. The filesystem can be accessed normally through the kernel interface.
  
Line 14: Line 13:
 
== Setup ==
 
== Setup ==
 
=== Kernel ===
 
=== Kernel ===
Download appropriate kernel from [http://download.openvz.org openvz.org] or compile kernel with <code>CONFIG_FUSE_FS</code> option set
+
Download appropriate kernel from [http://download.openvz.org/ openvz.org] or compile kernel with <code>CONFIG_FUSE_FS</code> option set
  
 
=== Libfuse ===
 
=== Libfuse ===
Compile libfuse in VPS without kernel module
+
Compile libfuse in a VE without kernel module
 
<pre>
 
<pre>
 
# vzctl enter 100
 
# vzctl enter 100
Line 44: Line 43:
 
</pre>
 
</pre>
  
=== VPS tuning ===
+
=== VE tuning ===
You need to make a characted device named <code>/dev/fuse</code> and grant your VPS permissions to it
+
You need to make a characted device named <code>/dev/fuse</code> and grant your VE permissions to it
 
<pre>
 
<pre>
 
# vzctl set 100 --devices c:10:229:rw --save
 
# vzctl set 100 --devices c:10:229:rw --save
Line 54: Line 53:
  
 
=== Mounting filesystem ===
 
=== Mounting filesystem ===
After this you may try to mount FUSE in VPS
+
After this you may try to mount FUSE in a VE
 
<pre>
 
<pre>
 
# vzctl enter 100
 
# vzctl enter 100
Line 61: Line 60:
  
 
==== Unmounting filesystem ====
 
==== Unmounting filesystem ====
In case of <code>sshfs</code> after umounting an appropriate daemon must be killed. This may be done by the following command
+
In case of <code>sshfs</code> after umounting an appropriate daemon must be killed. This may be done by the following command:
 
<pre>
 
<pre>
 
# fusermount -u moutpoint
 
# fusermount -u moutpoint
Line 67: Line 66:
  
 
== Using fusectl filesystem ==
 
== Using fusectl filesystem ==
Fusectl is a helper filesystem for FUSE. You may mount it in VPS as well
+
Fusectl is a helper filesystem for FUSE. You may mount it in a VE as well
 
<pre>
 
<pre>
 
# vzctl enter 100
 
# vzctl enter 100
Line 73: Line 72:
 
</pre>
 
</pre>
  
[[category:HOWTO]]
+
[[Category:HOWTO]]

Revision as of 15:30, 17 November 2006

This page describes how to setup FUSE (filesystem in userspace) inside a VE.

FUSE is a filesystem in which data and metadata are provided by an ordinary userspace process. The filesystem can be accessed normally through the kernel interface.

Preparations

To use FUSE you need the following:

  1. OpenVZ kernel version 028test005 or higher
  2. Fuse lib
  3. Any FUSE-based filesystem

In the examples below sshfs is used.

Setup

Kernel

Download appropriate kernel from openvz.org or compile kernel with CONFIG_FUSE_FS option set

Libfuse

Compile libfuse in a VE without kernel module

# vzctl enter 100
# tar xzf fuse-2.6.0.tar.gz
# cd fuse-2.6.0
# ./configure --disable-kernel-module
...
# make
...
# make install
Yellowpin.svg Note: Sometimes libfuse.so.X is unseen by your programs. Usually this file is installed in /usr/local/lib directory so don't forget to add it into your /etc/ld.so.conf

Filesystem

Download and compile filesystem.

# vzctl enter 100
# tar xzf sshfs-fuse-1.7.tar.gz
# cd sshfs-fuse-1.7
# ./configure
...
# make
...
# make install

VE tuning

You need to make a characted device named /dev/fuse and grant your VE permissions to it

# vzctl set 100 --devices c:10:229:rw --save
...
# vzctl exec 100 mknod /dev/fuse c 10 229
...

Mounting filesystem

After this you may try to mount FUSE in a VE

# vzctl enter 100
# sshfs root@foo.org:/root /mnt/foo.org.root

Unmounting filesystem

In case of sshfs after umounting an appropriate daemon must be killed. This may be done by the following command:

# fusermount -u moutpoint

Using fusectl filesystem

Fusectl is a helper filesystem for FUSE. You may mount it in a VE as well

# vzctl enter 100
# mount -t fusectl none /fuse_ctl