OffsetFS 0.2


NAME

offsetfs - mount arbitrary files via FUSE as a tree of offset-ed files

Resources


SYNOPSIS

offsetfs { -h | <image file> <mount point> }


DESCRIPTION

OffsetFS allows you to mount an arbitrary file or block device as a directory tree of read-only files that each represents the mounted file starting at different offset. Names given to files correspond to offset values, e.g. file named 0a (hex) has an offset of 10 (decimal).

OffsetFS was written as a workaround of tools (such as file) that does not provide an "offset" option and actually requires a regular file as input.

The offset-ed files of an OffsetFS are always at the eighth level of the mounted directory tree, if there are any (that is: if the image file is at least one byte in size). The concatenation of the path components from the root of the filesystem to a file gives you the hexadecimal representation of the value of the offset at which that file starts.

Note, however, that OffsetFS does not cope well with image files that change their size while they are mounted. It shouldn't crash, but you will not be able to access any newly-allocated space and you will immediately hit end of file, or maybe even get other errors, if you try to read from an offset-ed file for which there is no data in the image file anymore.

The permissions of the files within the OffsetFS are derived from the permissions of the image file. Owner and group are simply inherited. The mode of all objects is the same as that of the image file, except that any executable bits are cleared for files, while directories have their executable bits set for exactly those entities (owner, group, others) that also have read permission.


OPTIONS

general options:

-o opt,[opt...]

mount options

-h

display help about OffsetFS and about FUSE library

-V -v --version

print version

OffsetFS options:

-o step=N

increment offsets by N (default 1 byte)

-o image=NAME

another way to specify <image file>

-o strategy=N

select strategy to implement read() service, either 0:'mmap', or 1:'pread'

With the 'mmap strategy' OffsetFS performs a single mmap() call of the overall image file. Then read access are supposed to be direct and fast. However, image files larger than 4Go (i.e. 2^32 bytes) cannot be handle so. If OffsetFS cannot mmap the image file, then it tries the 'pread strategy'.

With the 'pread strategy' OffsetFS performs as much as necessary pread() calls for each read() request. This strategy is supposed to be robust to handle large image files.

FUSE options:

See offsetfs -h for a list of available options.

Note that, by default, the permissions described above are used for presentation only, not for actual permission checking. You might want to use -o default_permissions to change that, and maybe -o allow_other to actually allow others to access your OffsetFS mount.


EXAMPLE

        offsetfs my_mysterious_firmware_image.dat ./mnt/
        cd ./mnt/ ; file */*/*/*/*/*/*/*

Doing so, the file tool is able to space/time-efficiently guess interesting parts that compose my_mysterious_firmware_image.dat (e.g. a kernel image, filesystems, etc.)


SEE ALSO

FUSE, Filesystem in Userspace, http://fuse.sourceforge.net/

(Un)ChunkFS, mount arbitrary files via FUSE as a tree of chunk files, http://chunkfs.florz.de/


ACKNOWLEDGMENT

OffsetFS is based at 99% on ChunkFS 0.4 by Florian Zumbiehl

OffsetFS and ChunkFS share the same idea: the mounted file is seen by parts. However, with ChunkFS chunks define parts, and with OffsetFS offsets define parts.


AUTHOR

OffsetFS is written by Christophe Lohr

The current version is available from http://offsetfs.sourceforge.net/


COPYRIGHT

Copyright (C) 2009 Christophe Lohr

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

 OffsetFS 0.2