GVfs

GVfs
Stable release 1.26.2[1] / November 9, 2015 (2015-11-09)
Development status active
Operating system Linux
Platform GNOME
Type abstraction layer for the files system
Website wiki.gnome.org/Projects/gvfs

GVfs (abbreviation for GNOME Virtual file system) is GNOME's userspace virtual filesystem designed to work with the I/O abstraction of GIO, a library available in GLib since version 2.15.1. It installs several modules that are automatically used by applications using the APIs of libgio. There is also FUSE support that allows applications not using GIO to access the GVfs filesystems.

A cause of confusion is the fact that the file system abstraction used by the Linux kernel is also called the virtual file system (VFS) layer. This is however at a lower level.

The GVfs model differs from e.g. GnomeVFS, which it replaces, in that file systems must be mounted before they are used. There is a master daemon (gvfsd) that handles coordinating mounts, and then each mount is (typically) in its own daemon process (although mounts can share daemon process).

GVfs comes with a set of back-ends, including trash support, SFTP, FTP, WebDAV, SMB, and local data via Udev integration, OBEX, MTP and others.[2]

GVfs also contains modules for GIO that implement volume monitors and the GNOME URI scheme handler configuration.

There is a set of command line programs starting with "gvfs-" that lets you run commands (like cat, ls, stat, etc.) on files in the GVfs mounts.

Attached resources are exposed via a URI syntax, for example smb://server01/gamedata or ftp://username:password@ftp.example.net/public_html, but are also mounted in the traditional manner under ~/.gvfs/ or /run/user/$USERNAME/gvfs or $XDG_RUNTIME_DIR/gvfs directory[3][4] to make them available to applications using standard POSIX commands and I/O.

Technical details

The option x-gvfs-show for the gvfs-udisks2-volume-monitor process determines whether a mounted device is shown or not[5] in GNOME Files. Screenshot of GNOME Disks.

GVfs may use FUSE,[6] and replaces the earlier GnomeVFS.[7] It consists of two parts:[8]

  1. a shared library which is loaded by applications supporting GIO
  2. GVfs itself, which contains a collection of daemons which communicate with each other and the GIO module over D-Bus.

A collection of command-line utilities (such as gvfs-mount, gvfs-less) works with VFS resources.[9]

GVfs uses libgphoto2 to expose on-camera photos to GNOME applications via a virtual filesystem.

GVfs uses udisks2. The gvfs-udisks2-volume-monitor process is responsible for the disks, media, mounts and fstab entries shown in the desktop user interface. In particular, the Desktop Shell (gnome-shell), the Files application (nautilus) as well as any other application using the GLib APIs, is using information from this process.[5]

The gvfs-udisks2-volume-monitor is distributed as part of the gvfs-daemons package.[10] It is not to be confused with udisksd and udisksctl, which are part of the udisks2 package.[11]

Hot plugging

Devices connected over eSATA or USB are supposed to be hot-pluggable. When a device is added or removed from the computer system, the Linux kernel notices and sends out an event. Systemd-udevd responds to this kind of events according to its quite comprehensive configuration. It dynamically creates and removes device nodes from the /dev filesystem, handles hotplug events and loads drivers at boot time. In case of a storage device systemd-udevd notifies udisksd, and gvfsd and gvfs-udisks2-volume-monitor.[12]

The udisks2 daemon udisksd serves as an interface to system block devices, implemented via D-Bus. It handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives. This package also provides the udisksctl utility, which can be used to trigger these operations from the command line (if permitted by PolicyKit).

See also

References

This article is issued from Wikipedia - version of the Saturday, February 06, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.