What does gvfs do for me on my Kubuntu machine and why is /usr/lib/gvfs/gvfs-gdu-volume-monitor eating so much CPU time?
BTW: I read https://en.wikipedia.org/wiki/GVFS and still don’t know what’s in it for me, especially on KDE / Kubuntu.
lsof shows me that thunderbird, firefox and pidgin have gvfs libraries open, but for what functionality?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
GVFS (GNOME Virtual file system) provides a layer just below the user applications you use like firefox. This layer is called a virtual filesystem and basically presents to firefox, thunderbird and pidgin a common layer that allows them to see local file resource and remote file resource as a single set of resources. Meaning your access to the resource whether on your local machine or the remote machine would be transparent to the user.
Although this layer is mostly there to make it easier for application developers to code to a single set of interfaces and not have to distinguish between local and remote file system and their low-level code.
For the user this could mean that the same file manager you use to browse your local files, could also be used to browse files on a remote server. As a simplified contrast, on Windows I can browse my local files with Explorer, but to browse files on an NFS or SFTP server I would need a separate application.
Method 2
It’s a virtual file system, not a real one, but is made to look real.
I just ran into it myself it shows 170G being used on it. But if I check with du -hc it shows 0G. So in truth there is 170G being used, but on another networked hard drive in my house not on the system I was looking on and with.
This was likely samba mounts that I copied files from or to and it shows the size from the remote location, but find /disk files shows 170G being used. Really some is being used in buffers, but only while using the files. When you drop the samba (or whatever) connection it will all disappear.
Method 3
When I had completely removed GVFS from my PC then the PCmanFM did not connected via SSH to other servers. So for this reason I had to keep GVFS.
The second reason, my daughter has a Iphone, I am quite unhappy because of it as it uses MTP to transfer documents and photos, so again she uses PCmanFM to connect to it. On the other side she has little RAM on her PC, so the GVFS daemons consume a lot of memory needed.
So I came to this solution: I block the daemons from starting and when I need them a enable them:
systemctl --user stop gvfs* # stop all services with gvfs
sudo kill $(ps -A | grep gvfs | awk '{print $1}') # to be sure GVFS is not running
sudo chmod 0000 /usr/lib/systemd/user/gvfs* # this prevent GVFS from starting
lsof | grep gvfs # but it has many open files anyway...
When I need GVFS again so i run following code and reboot for sure:
sudo chmod 0644 /usr/lib/systemd/user/gvfs* # this enables GVFS again
May be it helps you too. 🙂
It would be much better if GVFS could run without daemons – just called on demand, or exit if not needed, wouldn’t it?
Method 4
GVFS is absolutely critical to the modern workflow as it allows you to seamlessly access files and folders on remote resources. There is nothing like it in KDE: there is a partial implementation called KIO that only works for some applications. IF you would like to use remote resources like you did in Gnome, MAC, and all versions of Windows since windows 95; you will need gvfs.
gvfs allows all applications to access a remote resource like a sftp mount or a smb (windows) file share. For example: you have a multi gigabyte video file on a share that you want to play; with gvfs it will play on any player (videos, vlc, etc.) immediately. This is something that KDE cannot replicate. As a workaround you can use Nautilus (files) instead of Dolphin (which is crippled by this lack of functionality).
I would state that this may be one of the key reasons that KDE is in decline and not nearly as popular as Gnome and other environments.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0