ArticleslgStudy

computer science

GVfs

GVfs is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GVfs rather than just read about it. In short: 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.

GVfs — main illustration
GVfs — illustration

Key takeaways

  • GVfs belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GVfs to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GVfs from memory before moving on to harder problems.

Reference excerpt

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. GVfs does not seem to support the Files transferred over shell protocol (FISH). GVfs also contains modules for GIO that implement volume monitors and the GNOME URI scheme handler configuration. There is a set of arguments to the command line program "gio" that lets you run commands (like cat, ls, stat, mount, 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/$UID/gvfs or $XDG_RUNTIME_DIR/gvfs directory to make them available to applications using standard POSIX commands and I/O.

Technical details

Along with generally useful APIs such as networking and D-Bus support, GIO also provides a VFS API to applications. GVfs provides implementations that go beyond that and allow to access files and storage using many protocols. GVfs provides implementations for various network file systems as loadable modules. Additionally GVfs also provides support for trash, network or recent folders, for CD burning and for monitoring interesting devices and volumes on the computer. The goal of GVfs has been to overcome the shortcomings of GnomeVFS and provide an API that is so good that developers prefer it over raw POSIX calls. Among other things that means using GObject. It also means not cloning the POSIX API, but providing higher-level, document-centric interfaces. GTK can directly use it, e.g. in the filechooser. Applications use GVfs indirectly, by means of GIO loading the GVfs module that implements the GIO extension points. The GVfs main daemon gvfsd spawns further mount daemons for each individual connection. The GVfs support for volume monitoring is included in a separate loadable module. The actual GVfs implementation is distributed over a number of processes. GVfs can use FUSE to mount its VFS directly onto the filesystem. It consists of two parts:

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.

https://developer.gnome.org/gio/stable/ch01.html#gvfs-overview

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, and gvfsd and gvfs-udisks2-volume-monitor. 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 In Debian the GVfs is packaged into four packages: gvfs, gvfs-daemons, gvfs-bin and gvfs-backends.

See also

GNOME Files, the file manager for GNOME desktops, allows users to interact with GVfs filesystems Thunar, the file manager for the Xfce desktop environment, also provides filesystem abstraction using the GVfs library KIO, a similar facility for KDE systems Archivemount, a virtual filesystem implementation specifically for accessing archive files

References

External links Official website

Worked examples

Example 1 — a first encounter with GVfs

Start with the simplest possible case. Write down what GVfs claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GVfs before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GVfs ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GVfs

In research
GVfs appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GVfs in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GVfs is common in secondary-school and first-year university syllabi. It links to neighbouring topics Applications using D-Bus, GNOME, Software that uses Meson, so understanding it makes those chapters shorter.
In everyday life
Look for GVfs outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “GVfs” →

How to study GVfs in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GVfs means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GVfs out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GVfs in simple terms?

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.

Why does GVfs matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GVfs?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GVfs.

Tags

  • Applications using D-Bus
  • GNOME
  • Software that uses Meson

Keep exploring