0x00
The first to see this article https://www.freehao123.com/google-drive/the Google-drive-ocamlfuse installation tutorial, which says three installation method environment.
Method Environment One: Ubuntu 15.04, 14.10, 14.04
Method Environment Two: ArchLinux
Method Environment Three: other
Because I use Ubuntu 16.04, method one did not try, I choose to use three other methods.
0x01: Install the required environment
# sudo apt-get install OCaml Camlp4-extra install M4 Libcurl4-gnutls-dev Libfuse-dev Libsqlite3-dev
0x02: Download Opam, (Clone command is required for your system to install GIT, if not installed, the URL copy browser manually download)
# git clone https://github.com/OCamlPro/opam.git
0X03: Check, compile, install Opam (Make prompt error is because the library is missing, see this article: workaround )
# CD opam#./configure# make# sudo make install
0X04: Update OPMA after installation
# opam init# opam Update
0x06: Install Google-drive-ocamlfuse with OPMA
# Opam Install Google-drive-ocamlfuse
0x07: Adding users to the Fuse group (fuse is a disk system, note that root is modified to the current user you installed the software).
sudo usermod-a-g fuse Root
0x08: Apply for Google API.
First, you need to have a Google account, and then open the Access https://code.google.com/apis/console/page and refer to the application API.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/99/93/wKiom1lJ586DDX2aAAErsg9BtKs480.png "style=" width : 500px;height:510px; "title=" Googledrive_0.png "width=" "height=" 510 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1lj586ddx2aaaersg9btks480.png "/>
First application requires "OAuth consent screen"
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/93/wKioL1lJ586C8myGAACugMedcNk532.png "style=" width : 500px;height:266px; "title=" Googledrive_01.png "width=" "height=" 266 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1lj586c8mygaacugmedcnk532.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/93/wKiom1lJ58_T6fXuAADya4LrsHs456.png "style=" width : 500px;height:244px; "title=" Googledrive_02.png "width=" "height=" 244 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1lj58_t6fxuaadya4lrshs456.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/93/wKioL1lJ58-jf4YXAAB8wlfSn_c824.png "style=" width : 500px;height:459px; "title=" Googledrive_03.png "width=" "height=" 459 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1lj58-jf4yxaab8wlfsn_c824.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/93/wKiom1lJ59DBnmP0AABWZzaR6C4838.png "style=" width : 500px;height:226px; "title=" Googledrive_04.png "width=" "height=" 226 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1lj59dbnmp0aabwzzar6c4838.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/93/wKioL1lJ59DQyJIBAACxxswK0vU587.png "style=" width : 500px;height:149px; "title=" Googledrive_05.png "width=" "height=" 149 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1lj59dqyjibaacxxswk0vu587.png "/>
This is the key, which will be used for a while.
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/93/wKioL1lJ59GhyfUaAACE5LD4ZUY283.png "style=" width : 500px;height:239px; "title=" Googledrive_06.png "width=" "height=" 239 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1lj59ghyfuaaace5ld4zuy283.png "/>
0x09:google-drive-ocamlfuse single-user creation.
Now go back to the system and execute the following command, replacing the "Client ID" and "client key" with your application in the API.
#google-drive-ocamlfuse-headless client Id-secret client key
0x0A: After executing the command, the system will generate a Web address, which is accessed by the browser. Copy the HTTPS to =force at all, and open it to the browser. A code is displayed, and after the copy is posted to the following "Please enter the verification code:" Back, enter.
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/99/94/wKioL1lJ6zWRkOFHAAAj_-EVEYw589.png "title=" Googledrive_07.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:38px; "alt=" Wkiol1lj6zwrkofhaaaj_-eveyw589.png "/>
0x0B: Edit the Google-drive-ocamlfuse user profile.
New user creation defaults to creating a hidden folder ". Gdfuse" in the current user's home directory, to put the code above into a configuration file.
# CD. GDFUSE/DEFAULTVI Config
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/94/wKiom1lJ7QrggbZ6AAAsUsX9k-c354.png "title=" Googledrive_08.png "width=" "height=" 223 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:223px; "alt=" Wkiom1lj7qrggbz6aaasusx9k-c354.png "/>
0x0C: Mount Google-drive. Create a mount point first, and mount the disc like the name of a random.
#mkdir ~/googledrive#google-drive-ocamlfuse ~/googledrive
0x0D: Use Df-h to see if the mount is successful.
The list "Google-drive-ocamlfuse 15G 160K 15G 1%/home/roott/google-drive" is mounted successfully and the relevant disk information is displayed. You can put the file in and wait for the upload to complete.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/97/wKiom1lKDMKyITnkAAAetyBmOic583.png "title=" Googledrive_09.png "width=" "height=" 139 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:500PX;HEIGHT:139PX; "alt=" Wkiom1lkdmkyitnkaaaetybmoic583.png "/>
0x0E: Multi-user mount.
method, like a single user, just mounts a few and executes several commands.
Grammar:
Google-drive-ocamlfuse-label label [Mountpoint]
Parameters:
-label//Specify label. This name can be random, the system defaults to the first default tag, created in the current user home directory to create a folder to error related configuration.
Mountpoint//mount point
-O nonempty//non-empty directory mount when the parameter must be mounted after the original directory file cannot be accessed, only the mounted file can be accessed.
Perform:
# Google-drive-ocamlfuse-label Testgoogle ~/google-drive
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/98/wKiom1lKE3CQsNWqAAAOhvCZwPE246.png "title=" Googledrive_10.png "alt=" Wkiom1lke3cqsnwqaaaohvczwpe246.png "/>
0x0F: uninstalling Umount
# Fusermount-u ~/google-drive
0x10: Repeat mount.
I found in the operation time, the same mount command can be executed more than once, then you repeatedly execute the uninstall command, until the normal folder is displayed, the Operation folder has been properly accessed.
0x11: other issues.
1. Checking, compiling, installing opam,make is a hint error because the library is missing. Click to view the workaround
2. Mount folder permissions, user, user group question mark "? ”。 Click to view the workaround
Reference article:
Http://www.tuicool.com/articles/QRJF7vN
Http://os.51cto.com/art/201607/515103.htm
This article is from the "Enlightened Grocery store" blog, please be sure to keep this source http://wutou.blog.51cto.com/615096/1940580
Google-drive-ocamlfuse on Linux mount "verbose edition"