8

I have installed the Google Drive desktop app and it's available on Finder as a mounted drive, but I can't seem to access it from the terminal. For example, when I do cd 'Google Drive' I get a cd: Permission denied: 'Google Drive/' error. This happens even when I have some files stored locally.

Is there anyway to do this without explicitly downloading the entire Google Drive folder locally?

EDIT: cd /Volumes/GoogleDrive produces the same error.

johnymm
  • 221
  • 2
  • 3

2 Answers2

8

On MacOS, Google Drive is setup as network volume.

When accessing Google Drive from terminal the first time:

cd ~/Google\ Drive

It should pop-up the following:

enter image description here

Click OK and you should be able to access it normally.

If for whatever reason pop up not showing, then you have to go into System Preferences -> Security & Privacy, click on Files and Folders and add it manually:

enter image description here

You need to select(check mark) Network Volumes. This step can apply to other application too.

John Siu
  • 223
  • 2
  • 6
  • Created account on apple.stackexchange just to say thank you. Very useful answer, I was not able to solve this problem. – 0x5C91 Sep 23 '22 at 14:04
2

Google Drive is found in /Volumes/GoogleDrive. Note the lack of the space character in the name. (I have two external drives: iTunes & TMBackup, which show up in the Volumes directory, naturally.)

enter image description here

IconDaemon
  • 18,247
  • 10
  • 41
  • 57
  • Sorry, I should have mentioned that I tried there too. I get the same exact error when trying `cd /Volumes/GoogleDrive` – johnymm Apr 12 '22 at 19:46
  • As you can see from the permissions, you don't have access. As for how Google expects this to work, I can't say. I kicked Google Drive to the curb when they went to this loopback mount thing, removed the client and everything else, and went back to Dropbox. – Marc Wilson Apr 12 '22 at 19:50
  • Yes, but I don't know how to give myself permission (and it doesn't make sense since Finder has permission to access it). `chmod` doesn't seem to be working: says `Operation not permitted`. Dropbox is great, but unfortunately the free version limits you to 3 client installations. – johnymm Apr 12 '22 at 20:28
  • Finder is probably accessing it through whatever extension the application installed. Not really related, but I have no problem paying for things that actually work. I was paying for GD too, until they came up with this insane loopback mount concept that just broke things. – Marc Wilson Apr 13 '22 at 14:01
  • @MarcWilson Finder by default can access network volumes. You can check out my answer. – John Siu Jun 19 '22 at 07:21
  • @JohnSiu Of course it can. But a GD volume isn't one. Unless the extension is installed, in which case you have the bizzarro loopback mount nonsense going on. – Marc Wilson Jun 19 '22 at 19:11
  • @MarcWilson You are correct that need to install GD to have GD available. But once it is running, the GD is treated as network volume, and apps like terminal need the network volume access permission to read the content. You don't mount GD manually, that is handled by GD software. – John Siu Jun 20 '22 at 03:52