Symbolic link to file stored on mounted Google Drive

I have installed a software on Fedora that stores its database on Google Drive, and I want to create a symbolic link between the database file and the location where the software expects to find it. However, the path to the Google Drive folder in the terminal is displayed with a complex filename instead of a user-friendly name. Can I still use the ln -s command to create the symbolic link, and how do I format the command to account for the complex filename?

I use a launcher with a small script like this:

URI="google-drive://my.name@gmail.com/My%20Drive/file.txt"
gio mount "${URI%/*/*}"
gio open "${URI}"

You can copy-paste the remote file from Files to Terminal or Text Editor to find its local path, or investigate the URI:

gio list -d "${URI%/*}"
gio info "${URI}"
1 Like

Thanks, I will try that.

Do you know if I want to create a symbolic link, should I use the pretty name of the Google file (My Drive/filename.txt) or the complex filename (xdirjewlfslfs/siodfowefs)?

1 Like

The file ID can change in certain cases:

  • You decide to remove and reupload the file.
  • Software rewrites the file instead of updating it.

Thank you! Just to clarify, I will be linking to a folder on Google Drive, not a file.
I have installed the software on both Windows and Mac, and link the database to the Google Drive folder.
I hope that it will be straightforward to reproduce the same thing on Fedora.

Thanks again for your help. I will report my progress on this later.

For a symbolic link, using the “complicated” file name will work provided that name does not change between reboots.

@vgaetera @ytrium
Hi all,

I feel I cannot link the database from Google Drive.
Zotero will create a database in ~/Zotero folder, and I link this folder to the one in Google Drive.

Zotero -> '../../run/user/1000/gvfs/google-drive:host=gmail.com,user=ABC/ABCDE/1EvOdBP7nnTf-JcD64B4bZIi9MmnqQAnc'

However, every time I open the software, it shows the error in the picture, and the mounted Google Drive will be unmounted automatically.

Any suggestion on how to link the folder from Google Drive?

GVFS unmounts by itself probably due to a crash, check system log for details.
If the issue persists, GVFS likely doesn’t support features required by your database.

The error message shows it is a permissions problem, it seems like the software doesn’t have permission to read the Google Drive folder and update files in that folder.
it is so difficult to reproduce the same setting in a Linux system, but in MacOS and Windows, I didn’t encounter any permission problems.

GVFS is just one of possible virtual filesystem implementations for Google Drive and it supports a limited set of features, which is not necessary compatible with other implementations such as on a different OS using the official client.

Since GVFS is not Fedora specific, you’d best to ask the GNOME devs directly, but I’m afraid the reply would be this use case is not supported and your DBMS must be built with GIO in order to properly interact with GVFS.