What's gvfs and why can't root access it?

Emphasized Text Heremint-desktop ~ # du -sh /home/garrett
du: cannot access `/home/garrett/.gvfs': Permission denied
73G /home/garrett

Dani AI

Generated

As already pointed out, GVfs is GNOME's userspace virtual filesystem: a set of GIO backends and daemons that let the desktop access things like SFTP, SMB, MTP, WebDAV, trash, etc. For programs that don't use GIO, GVfs exposes those mounts through a FUSE bridge (gvfsd-fuse). Modern systems mount that bridge under $XDG_RUNTIME_DIR/gvfs (e.g. /run/user/<UID>/gvfs); older setups used ~/.gvfs. GNOME GVfs project gvfsd-fuse man. (wiki.gnome.org)

Root sees "Permission denied" because FUSE-mounted filesystems are, by default, only accessible to the user who created the mount. The FUSE layer enforces that restriction; root does not magically bypass those checks for user FUSE mounts. FUSE does support mount options allow_root or allow_other, but those options are only permitted if /etc/fuse.conf enables user_allow_other. This design preserves per-user/remote-auth boundaries and avoids surprising cross-user access. mount.fuse manpage AskUbuntu discussion on allowing root access. (manpages.org)

Practical, safe choices for :

# inspect GVfs and the FUSE bridge
gio mount -l
mount | grep gvfs
ps aux | grep gvfsd-fuse
ls -ld /run/user/$(id -u garrett)/gvfs

# run the du command as the owning user
sudo -u garrett du -sh /home/garrett

gio lets you list and copy files via GVfs URIs without touching the FUSE mount directly. If you truly need root to see the FUSE tree, you can enable user_allow_other and restart gvfsd-fuse with -o allow_root / -o allow_other, but that reduces per-user isolation and is not recommended on multi-user systems—use it only with full understanding of the risks. gio man fuse config notes. (linuxcommandlibrary.com)

If this is for backups or scripting, the usual approach is to either run the backup as that user (or sudo -u) or exclude the GVfs path from the backup and use gio/rsync-style transfers for remote data. Modern GNOME uses /run/user/<UID>/gvfs; check that path rather than assuming ~/.gvfs. (linuxcommandlibrary.com)

Recommended Answers

All 2 Replies

This is part of Gnome and it's used by the system when you connect to a remote server (ftp, webdav, ssh):

userspace virtual filesystem - server
gvfs is a userspace virtual filesystem where mount runs as a separate processes which you talk to via D-Bus. It also contains a gio module that seamlessly adds gvfs support to all applications using the gio API. It also supports exposing the gvfs mounts to non-gio applications using fuse.
This package contains the gvfs server that provides gvfs mounts to all gio applications, and the minimal set of backends.

http://packages.ubuntu.com/lucid/gvfs

If you run "Connect to server" and then browse inside .gvfs through the terminal, you will find the map tree of the remote resource.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.