Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Virtual file system

Virtual file system

Overview
A virtual file system (VFS) or virtual filesystem switch is an abstraction layer on top of a more concrete file system
File system
In computing, a file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them...

. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

, Mac OS
Mac OS
Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

 and Unix
Unix
Unix is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

A VFS specifies an interface
Interface (computer science)
Interface generally refers to an abstraction that an entity provides of itself to the outside. This separates the methods of external communication from internal operation Interface generally refers to an abstraction that an entity provides of itself to the outside. This separates the methods of...

 (or a "contract") between the kernel and a concrete file system.
Discussion
Ask a question about 'Virtual file system'
Start a new discussion about 'Virtual file system'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
A virtual file system (VFS) or virtual filesystem switch is an abstraction layer on top of a more concrete file system
File system
In computing, a file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them...

. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

, Mac OS
Mac OS
Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

 and Unix
Unix
Unix is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

A VFS specifies an interface
Interface (computer science)
Interface generally refers to an abstraction that an entity provides of itself to the outside. This separates the methods of external communication from internal operation Interface generally refers to an abstraction that an entity provides of itself to the outside. This separates the methods of...

 (or a "contract") between the kernel and a concrete file system. Therefore, it is easy to add support for new file system types to the kernel simply by fulfilling the contract. The terms of the contract might change incompatibly from release to release, which would require that concrete file system support be recompiled, and possibly modified before recompilation, to allow it to work with a new release of the operating system; or the supplier of the operating system might make only backward-compatible changes to the contract, so that concrete file system support built for a given release of the operating system would work with future versions of the operating system.

Implementations


One of the first virtual file system mechanisms in Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 systems was introduced by Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. is a multinational vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982...

 in SunOS
SunOS
SunOS is a version of the Unix operating system developed by Sun Microsystems for their workstation and server computer systems. The SunOS name is usually only used to refer to versions 1.0 to 4.1.4 of SunOS...

 2.0 in 1985. It allowed Unix system calls to access local UFS
Unix File System
The Unix file system is a file system used by many Unix and Unix-like operating systems. It is also called the Berkeley Fast File System, the BSD Fast File System or FFS...

 file systems and remote NFS file systems transparently. For this reason, Unix vendors who licensed the NFS code from Sun often copied the design of Sun's VFS. Other file systems could be plugged into it also: there was an implementation of the MS-DOS
MS-DOS
MS-DOS is an operating system developed by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the main operating system for personal computers during the 1980s. It was preceded by M-DOS , designed and copyrighted by Microsoft in 1979...

 FAT
File Allocation Table
File Allocation Table or FAT is a computer file system architecture now widely used on most computer systems and most memory cards, such as those used with digital cameras.It was developed by Bill Gates and Marc McDonald during 1976–1977....

 file system developed at Sun that plugged into the SunOS VFS, although it wasn't shipped as a product until SunOS 4.1. The SunOS implementation was the basis of the VFS mechanism in System V Release 4.

John Heidemann developed a stacking VFS under SunOS 4.0 for the experimental Ficus file system. This design provided for code reuse
Code reuse
Code reuse, also called software reuse, is the use of existing software, or software knowledge, to build new software.-Overview:Ad hoc code reuse has been practiced from the earliest days of programming. Programmers have always reused sections of code, templates, functions, and procedures...

 among file system types with differing but similar semantics (e.g., an encrypting file system could reuse all of the naming and storage-management code of a non-encrypting file system). Heidemann adapted this work for use in 4.4BSD as a part of his thesis
Thesis
A dissertation or thesis is a document submitted in support of candidature for a degree or professional qualification presenting the author's research and findings...

 research; descendants of this code underpin the file system implementations in modern BSD derivatives including Mac OS X
Mac OS X
Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems...

.

Other Unix virtual file systems include the File System Switch in System V Release 3, the Generic File System in Ultrix
Ultrix
Ultrix was the brand name of Digital Equipment Corporation's native Unix systems. While ultrix is the Latin word for avenger, the name was chosen solely for its sound.-History:...

, and the VFS in Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed,...

. In OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

 and Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

, the virtual file system mechanism is called the Installable File System
Installable File System
The Installable File System is a filesystem API in IBM OS/2 and Microsoft Windows that enables the operating system to recognize and load drivers for file systems...

.

The Filesystem in Userspace
Filesystem in Userspace
Filesystem in Userspace is a loadable kernel module for Unix-like computer operating systems, that allows non-privileged users to create their own file systems without editing the kernel code...

 (FUSE) mechanism allows userland code to plug into the virtual file system mechanism in Linux, FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via the Berkeley Software Distribution . It has been characterized as "the unknown giant among free operating systems". It is not a clone of UNIX, but works like UNIX, with UNIX-compliant internals and system APIs. FreeBSD is...

, OpenSolaris
OpenSolaris
OpenSolaris is an open source operating system based on Sun Microsystems' Solaris. It is also the name of the project initiated by Sun to build a developer and user community around it....

, and Mac OS X.

In Microsoft Windows, virtual filesystems can also be implemented through userland Shell namespace extensions; however, they do not support the lowest-level file system access application programming interface
Application programming interface
An application programming interface is an interface in computer science that defines the ways by which an application program may request services from libraries and/or operating systems. An API determines the vocabulary and calling conventions the programmer should employ to use the services...

s in Windows, so not all applications will be able to access file systems that implemented as namespace extensions. KIO
KIO
KIO is part of the KDE architecture. It provides access to files, web sites and other resources through a single consistent API. Applications, such as Konqueror which are written using this framework can operate on files stored on remote servers in exactly the same way as they operate on those...

 and the GNOME VFS
GNOME VFS
GnomeVFS is short for GNOME Virtual File System. It provides an abstraction layer for the reading, writing and execution of files. It was primarily used by the Nautilus file manager and other GNOME applications before GNOME 2.22....

 provide similar mechanisms in the KDE
KDE
KDE is a free software project based around its flagship product, a desktop environment mainly for Unix-like systems. The goal of the project is to provide basic desktop functions and applications for daily needs as well as tools and documentation for developers to write stand-alone applications...

 and GNOME
GNOME
GNOME is a desktop environment—a graphical user interface which runs on top of a computer operating system —composed entirely of free and open source software...

 desktop environments, with similar limitations, although they can be made to use FUSE techniques and therefore integrate smoothly into the system.

Single-file virtual file systems


Sometimes Virtual File System refers to a file or a bunch of files (not necessarily inside a concrete file system) that acts as a managable container which should provide the fuctionality of a concrete file system through the usage of a software. Examples of such containers are SolFS or a single-file virtual file system in an emulator like PCTask or so-called WinUAE.

The primary benefit for this type of file system is that it is centralized and easy to remove. A single-file virtual file system may include all the basic features expected of any file system (virtual or otherwise), but access to the internal structure of these file systems is often limited to programs specifically written to make use of the single-file virtual file system (instead of implementation through a driver allowing universal access). Another major drawback is that performance is relatively low when compared to other virtual file systems. Low performance is mostly due to the cost of shuffling virtual files when data is written or deleted from the virtual file system.

Implementation of single-file virtual filesystems


Direct examples of single-file virtual file systems include emulators, such as PCTask and WinUAE, which encapsulate not only the filesystem data but also emulated disk layout. This makes it easy to treat an OS installation like any other piece of software -- transferring it with removable media or over the network.

PCTask


The Amiga emulator PCTask emulated an Intel PC 8088
Intel 8088
The Intel 8088 microprocessor was a variant of the Intel 8086 and was introduced on July 1, 1979. It had an 8-bit external data bus instead of the 16-bit bus of the 8086. The 16-bit registers and the one megabyte address range were unchanged, however...

 based machine clocked at 4.77MHz (and later an 80486SX clocked at 25MHz). Users of PCTask could create a file of large size on the Amiga filesystem, and this file would be virtually accessed from the emulator as if it were a real PC Hard Disk. The file could be formatted with the FAT16 filesystem to store normal MS-DOS or Windows files.

WinUAE


The UAE for Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

, WinUAE, allows for large single files on Windows to be treated as Amiga file systems. In WinUAE this file is called a hardfile.

UAE could also treat a directory on the host filesystem -- (Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

, Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed,...

, Mac OS
Mac OS
Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

, AmigaOS
AmigaOS
AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000...

) -- as an Amiga filesystem.

whefs


whefs (http://fossil.wanderinghorse.net/repos/whefs/) is an Open Source
Open source
Open source is an approach to the design, development, and distribution of software, offering practical accessibility to a software's source code. Some consider open source as one of various possible design approaches, while others consider it a critical strategic element of their operations...

 C library for POSIX
POSIX
POSIX or "Portable Operating System Interface [for Unix"] is the name of a family of related standards specified by the IEEE to define the application programming interface , along with shell and utilities interfaces for software compatible with variants of the Unix operating system, although the...

-compliant operating systems which provides features for accessing and manipulating a single-file virtual file system from within C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and C++ applications.

See also

  • 9P
    9P
    9P is a network protocol developed for the Plan 9 from Bell Labs distributed operating system as the means of connecting the components of a Plan 9 system. Files are key objects in Plan 9. They represent windows, network connections, processes, and almost anything else available in the operating...

     - Distributed file system protocol that maps directly to the Plan 9 from Bell Labs
    Plan 9 from Bell Labs
    Plan 9 from Bell Labs is a distributed operating system, primarily used for research. It was developed as the research successor to Unix by the Computing Sciences Research Center at Bell Labs between the mid-1980s and 2002...

     VFS layer making all file system access network transparent.
  • Toronto Virtual File System, a VFS for OS/2
    OS/2
    OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

     developed by IBM Toronto that allows mounting diverse filesystems under a common structure.

External links

  • Embedded File System (EFS) - Open Source cross-platform C++ implementation of Virtual File System
  • AVFS - A Virtual File System for mounting compressed or remote files
  • fs-driver Ext2 Installable File System for Microsoft Windows
  • Anatomy of the Linux file system by M. Tim Jones
  • BoxedApp SDK - a solution to create a private virtual file system
  • Solid File System - (SolFS) cross-platform single-file virtual file system with encryption and compression
  • Callback File System - SDK that lets developers create virtual file systems for Windows in user mode
  • FUSE - Filesystem in Userspace - virtual filesystem for Linux.
  • LUFS - Linux Userland FileSystem - virtual filesystem with support of localfs, ssh
    Secure Shell
    Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells, which send...

    fs , ftpfs, gnutella
    Gnutella
    Gnutella is a file sharing network. In late 2007, it was the most popular file sharing network on the Internet with an estimated market share of more than 40%...

    fs, locasefs, gvfs
    GVFS
    GVFS is a replacement for GnomeVFS, the GNOME Virtual File System. GVFS optionally allows supported virtual file systems to be mounted through FUSE....

    , cardfs, cefs and more. Latest file release: 2003-10-29
  • Commons VFS - virtual filesystem for Java, with support for Cifs, ftp, http, Zip (file format)
    ZIP (file format)
    The ZIP file format is a data compression and archive format. A ZIP file contains one or more files that have been compressed to reduce file size, or stored as-is...

    , Tar (file format)
    Tar (file format)
    In computing, tar is both a file format and the name of a program used to handle such files...

    , gzip
    Gzip
    gzip is a software application used for file compression. gzip is short for GNU zip; the program is a free software replacement for the compress program used in early Unix systems, intended for use by the GNU Project....

    , bzip2
    Bzip2
    bzip2 is a free and open source lossless data compression algorithm and program developed by Julian Seward. Seward made the first public release of bzip2, version 0.15, in July 1996...

    , and more.
  • MillScript VFS - virtual filesystem for Java, influenced by the KIO subsystem in KDE, Steve Leach's work on a VFS in JSpice and to a limited extent the Apache Commons VFS.
  • KIO - (KDE
    KDE
    KDE is a free software project based around its flagship product, a desktop environment mainly for Unix-like systems. The goal of the project is to provide basic desktop functions and applications for daily needs as well as tools and documentation for developers to write stand-alone applications...

     IO
    Input/output
    In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world – possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

    ) - a network-enabled file management system
  • flipcode - Programming a Virtual File System
  • ZX-VFS - A free and open source single-file virtual filesystem for Java.