Home

Shane Powell

Introduction

This is my fork of rofs-filtered

I needed a simple virtual file system that I can filter the file list through. I have a directory on my home file server full of a mix of both photos (jpg,png..) and videos (avi,3gp,mpg..). However, I have various applications (in particular XBMC) that I use to access different types of files in different ways. I didn't want to make copies, or even links in 2 different places just to be able to view the video files separate from the image files.

This is where a filtering virtual file system comes in. rofs-filtered succesfully did what I needed. It created a virtual FUSE file system of my main directory, and filtered out all JPG,GIF and PNG files. The limitation to rofs-filtered was that it's configuration file didn't provide a way of specifying what filtered are applied to what mount points. I have 3 mount points with totally different filtering requirements.

This is the reason for this simple fork of rofs-filtered. FilteredFS has the ability to specify a global filter section, and individual mount point filter sections within the same configuration file.

Project Admins

Project Admins:

Download

Download FilteredFS

Source Code

svn checkout svn://svn.code.sf.net/p/filteredfs/code/trunk/filteredfs filteredfs

Build

See below for distribution specific installs.

$ svn checkout svn://svn.code.sf.net/p/filteredfs/code/trunk/filteredfs filteredfs
$ cd filteredfs
$ ./configure
$ make
$ sudo make install

Installed Files

/usr/bin/filteredfs
/etc/filteredfs.conf
/usr/share/man/man1/filteredfs.1

Usage

$ filteredfs /source/directory /destination/directory

Both directory paths must be a FULL path. Relative paths don't work... yet.

fstab

filteredfs#/source/directory /destination/directory fuse defaults,allow_other 0 0

Planned Features

  • allow the use of relative paths
  • user specific filter config file ~/.filteredfs.conf

filteredfs.conf

View sample filterdfs.conf file (sourceforge.net)

The who reason for this fork was to change how the default /etc/filteredfs.conf file was treated. Instead of just one file with a global list of filteres, this config file can have both a global list, and a mount point specific section.

The key difference in this config file is the special comment line
### "regex mount"
which represents the start of a mount point filter section.
** The space between ### "regex mount" is REQUIRED**

The config file is read in, and processed in order from top to bottom. All lines starting with a '#' are comment lines, with the above noted '### ' exception. Each line represents a regex exclusion filter. Each line read before a mount point filter section is treated as a global filter. No matter the mount point, these filters will be applied.

To add more control, you can specify mount point specific filter sections.
Consider the following example config file (note the use of the \ escape character)

.*\.txt
.*\.bmp

 ### .*\/music\/.*
 .*\.jpg

 ### .*\/mnt\/data\/video
 .*\.flv
  • Filter all .txt and .bmp file no matter the mount point.
  • If a mount point matching the music regex, also filter out all .jpg files. This mount regex will match any mount with the directory /music/* in it's path.
  • If a mount point matching the path /mnt/data/video is found, also filter out all *.flv files.

Gentoo

# To install an overlay for this package.  You'll need layman with the subversion use flag.
$ USE="$USE subversion" layman
$ echo "source /var/lib/layman/make.conf" >> /etc/make.conf
$ layman -o http://svn.code.sf.net/p/filteredfs/code/build/gentoo-overlay/repositories.xml -a filteredfs-overlay
$ emerge sys-fs/filteredfs


# To update to a newer version
$ layman -o http://svn.code.sf.net/p/filteredfs/code/build/gentoo-overlay/repositories.xml -s filterdfs-overlay
$ emerge sys-fs/filteredfs

Help

Check your system log file for the results of running filteredfs. It will attempt to output the filters that are applied to each mount when it is created.


MongoDB Logo MongoDB