ericvlog / note

6 stars 1 forks source link

Mount Google Drive on Ubuntu/Debian and Upload Files -ocamlfuse #19

Open ericvlog opened 2 years ago

ericvlog commented 2 years ago

Google Drive is a fantastic cloud storage service that allows you to upload, share, and sync data across several computers. Other sub-services that are part of an office suite, such as Google Docs, Google Sheets, and Google Slides, are included in Google Drive. The cloud storage is free up to 15 Gigabytes (GB), but there are additional premium alternatives open up to 30 Terabytes (TB).

On the other hand, google-drive-ocamlfuse is an OCaml-based FUSE-based file system for Google Drive. It allows you to access your Google Drive from a Linux computer. The project is maintained on GitHub, where the most recent development version can be found.

In this brief tutorial I will demonstrate How To Mount Google Drive on Ubuntu / Debian Linux and Upload files or Directories to the drive.

Features of google-drive-ocamlfuse

google-drive-ocamlfuse features include the following:

Install google-drive-ocamlfuse on Ubuntu / Debian Linux

We will install google-drive-ocamlfuse on different Linux distributions.

Install google-drive-ocamlfuse on Ubuntu

Run the following command to install google-drive-ocamlfuse on Ubuntu:

sudo add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse

Install google-drive-ocamlfuse on Debian

On Debian we will install Install google-drive-ocamlfuse as follows:

sudo apt install -y software-properties-common dirmngr

sudo cat > /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list << EOF
deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
EOF

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AD5F235DF639B041
sudo apt update
sudo apt install -y google-drive-ocamlfuse

Install google-drive-ocamlfuse on Arch (Bonus)

Use the following command to install google-drive-ocamlfuse on Arch Linux:

$ yaourt -S google-drive-ocamlfuse

Mounting Google Drive on Ubuntu / Debian Linux

Launch google-drive-ocamlfuse to set your Google drive folder.

$ google-drive-ocamlfuse

When you Launch google-drive-ocamlfuse it will launch your regular browser and prompt you to log in to your Google account.

Go through the process of logging in. You’ll receive a success message if it’s successful. The browser can now be closed.

Create a mount point for Google Drive

Let’s make a subdirectory under the home folder.

mkdir ~/MyGDrive

To inform google-drive-ocamlfuse to mount your Google Drive folder at the specified location, run the following command.

google-drive-ocamlfuse ~/MyGDrive 

Check if the directory is mounted:

$ **df -h**
Filesystem              Size  Used Avail Use% Mounted on
udev                    7.8G     0  7.8G   0% /dev
tmpfs                   1.6G  2.0M  1.6G   1% /run
/dev/nvme0n1p2          234G  187G   35G  85% /
tmpfs                   7.8G  214M  7.6G   3% /dev/shm
tmpfs                   5.0M  4.0K  5.0M   1% /run/lock
tmpfs                   7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/loop1               56M   56M     0 100% /snap/core18/2246
/dev/loop2              101M  101M     0 100% /snap/dukto/16
/dev/loop3               56M   56M     0 100% /snap/core18/2253
/dev/loop0              128K  128K     0 100% /snap/bare/5
/dev/loop5              165M  165M     0 100% /snap/gnome-3-28-1804/161
/dev/loop4               62M   62M     0 100% /snap/core20/1242
/dev/loop6              219M  219M     0 100% /snap/gnome-3-34-1804/77
/dev/loop7              248M  248M     0 100% /snap/gnome-3-38-2004/87
/dev/loop8               66M   66M     0 100% /snap/gtk-common-themes/1519
/dev/loop9               63M   63M     0 100% /snap/gtk-common-themes/1506
/dev/loop10              33M   33M     0 100% /snap/snapd/13640
/dev/loop12             219M  219M     0 100% /snap/gnome-3-34-1804/72
/dev/loop11              51M   51M     0 100% /snap/snap-store/547
/dev/nvme0n1p1          511M  5.3M  506M   2% /boot/efi
/dev/loop13             261M  261M     0 100% /snap/kde-frameworks-5-core18/32
/dev/loop15              55M   55M     0 100% /snap/snap-store/558
/dev/loop16             140M  140M     0 100% /snap/skype/190
/dev/loop17              43M   43M     0 100% /snap/snapd/14066
tmpfs                   1.6G   28K  1.6G   1% /run/user/1000
/dev/loop18             135M  135M     0 100% /snap/skype/194
**google-drive-ocamlfuse   15G   62M   15G   1% /home/frank/MyGDrive**

Now, check how well the synchronization works. In the following screen-shot you see that the files in My Google Drive has been synced to my Computer Locally.

Upload Files to Google Drive mounted on Linux

To upload files to Google Drive, Drag and drop file to ~/MyGDrive folder:

Here are the files we drag and drop in ~MyGDrive:

Now we can confirm if they have been uploaded to Google Drive:

As you can see in the screen-shot above that upload is successful

Conclusion

Our tutorial on How To Mount Google Drive on Ubuntu and Upload Files has come to a conclusion. We hope you found this information helpful. Cheers!

More Guides:

Your support is our everlasting motivation,

that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

https://techviewleo.com/mount-google-drive-on-ubuntu-debian-and-upload-files/