GVfs
Stable release | 1.26.2[1]
/ November 9, 2015 |
---|---|
Repository | |
Operating system | Linux |
Platform | GNOME |
Type | abstraction layer for the files system |
Website | wiki |
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
GVfs may use FUSE,[6] and replaces the earlier GnomeVFS.[7] It consists of two parts:[8]
- a shared library which is loaded by applications supporting GIO
- 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
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
, andgvfsd
andgvfs-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
- Archivemount
- KIO, a similar facility for KDE systems
References
- ^ "GNOME git repository of GVfs".
- ^ GNOME 2.22 Release Notes, 6.1: GVfs and GIO
- ^ "Man page: gvfsd-fuse"
- ^ http://askubuntu.com/a/281756
- ^ a b "udisks2/what-is-shown.txt"..
- ^ gvfs status report, Alexander Larsson, mail.gnome.org, February 15, 2007
- ^ GnomeVFS shortcomings
- ^ "Using GNOMEvfs to manipulate files", Linux.com
- ^ gvfs-mount, man page
- ^ "filelist of gvfs-daemons package".
- ^ "filelist of udisks2 package".
- ^ David Zeuthen (2014-05-28). "Modern Mounting with Udisks2".