GVfs

From Wikipedia, the free encyclopedia
  (Redirected from GVFS)
Jump to: navigation, search
GVfs
Stable release 1.26.2[1] / November 9, 2015; 8 months ago (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[edit]

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]

Daemon location on Debian 9 task
gvfsd /usr/lib/gvfs/gvfsd
gvfsd-burn /usr/lib/gvfs/gvfsd-burn Burning optical disks
gvfsd-fuse /usr/lib/gvfs/gvfsd-fuse Support for Filesystem in Userspace
gvfsd-metadata /usr/lib/gvfs/gvfsd-metadata
gvfsd-trash /usr/lib/gvfs/gvfsd-trash
gvfs-goa-volume-monitor /usr/lib/gvfs/gvfs-goa-volume-monitor support for GNOME Online Accounts
gfvs-gphoto2-volume-monitor /usr/lib/gvfs/gvfs-gphoto2-volume-monitor support for the Picture Transfer Protocol as implemented in gPhoto
gvfs-mtp-volume-monitor /usr/lib/gvfs/gvfs-mtp-volume-monitor support for the Media Transfer Protocol
gvfs-udisks2-volume-monitor /usr/lib/gvfs/gvfs-udisks2-volume-monitor udisks: The udisks daemon 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.
gvfs-afc-volume-monitor /usr/lib/gvfs/gvfs-afc-volume-monitor support for Apple File Conduit

Please refer to https://wiki.gnome.org/Projects/gvfs/backends for the official documentation.

Hot plugging[edit]

Devices connected over eSATA or USB are (supposed to be) physically hot-pluggable. When a device is physically connected to or physically removed from the computer system, the Linux kernel notices and sends out an event to user-space. systemd-udevd receives such events and responds to them according to its quite comprehensive configuration:

  • manages the special file system devfs mounted to /dev, hence systemd-udevd dynamically creates and removes device nodes from /dev, it also loads drivers as necessary at boot time
  • in case of a block 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).

Packaging[edit]

In Debian the GVfs is packaged into three packages: gvfs, gvfs-daemons and gvfs-backends.

See also[edit]

References[edit]