This post is to record the steps how I mounted my Google Drive into NextCloud running in Docker environment.
My environment is Ubuntu 18.04 and Docker / Portainer has been installed. NextCloud Docker has been deployed by Portainer in my previous post:
Tried App - External Storage Support for Google Drive
Frist thing I tried is to use External Storage Support for Google Drive app in NextCloud Apps page. You will need to search Google Drive to find it out. It is not tested app.
There is untested app in NextCloud which I installed and tested but does not work for me.
Eventually, I thought I might be able to try use rclone to mount Google drive into local and map it into NextCloud docker to add as local.
Install rclone into Ubuntu 18.04
1 There are two methods to install rclone:
- wget https://ift.tt/3p5BgGw && bash rclone_debian.sh
- apt install rclone
Either way works.
2 rclone config
1 |
n) New remote #use browser to open that link and get authentication code |
It might be a little different from above steps to configure rclone. But you should be able to use your browser to get authentication code as below and paste into configuration:
3 Mount rclone configured Google Drive gd to local folder
mkdir /home/gdrive
rclone mount gd: /home/gdrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
- mount helper error: fusermount: failed to access mountpoint /home/gd: Transport endpoint is not connected
- fusermount -u /path/which/you/want/to/mount
- fusemound -qzu /home/gdrive
root@ip-172-31-23-61:~# df -h
df: /home/gdrive: Transport endpoint is not connected
Filesystem Size Used Avail Use% Mounted on
udev 463M 0 463M 0% /dev
tmpfs 96M 1.1M 95M 2% /run
/dev/nvme0n1p1 20G 9.4G 10G 49% /
tmpfs 477M 0 477M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 477M 0 477M 0% /sys/fs/cgroup
/dev/loop0 29M 29M 0 100% /snap/amazon-ssm-agent/2333
/dev/loop2 56M 56M 0 100% /snap/core18/1932
/dev/loop1 98M 98M 0 100% /snap/core/10577
/dev/loop3 98M 98M 0 100% /snap/core/10444
/dev/loop4 56M 56M 0 100% /snap/core18/1944
/dev/loop5 33M 33M 0 100% /snap/amazon-ssm-agent/2996
overlay 20G 9.4G 10G 49% /var/lib/docker/overlay2/32dfdf96190490a5908f84d12cdfd60d35f2b8be171c91a487670ce4cb34d2c0/merged
overlay 20G 9.4G 10G 49% /var/lib/docker/overlay2/4aa862e6130c577d029ea5605d7b4b23cd02490a4a0115c15b80aca04e5642d8/merged
overlay 20G 9.4G 10G 49% /var/lib/docker/overlay2/ff4fbaeb15ec362463e5d5e6b1d9be6fe68133a381221af96c5c0f17a66355bb/merged
overlay 20G 9.4G 10G 49% /var/lib/docker/overlay2/4fd85ac15711898db3ecf7886c6f69b5bbf1e2fbccda9826f8ed874ad88ad6e2/merged
tmpfs 96M 0 96M 0% /run/user/1000
overlay 20G 9.4G 10G 49% /var/lib/docker/overlay2/b9e5ef0ed3c26fa23927412e3a0f1c2cecb2a5c65e50aad3ff627c697d28c0d2/merged
gd: 1.0P 0 1.0P 0% /home/gd
1 |
|
Start Service:
1 |
systemctl start rclone |
Enable Service once system started:
1 |
systemctl enable rclone
|
Map /home/gdrive into Docker local folder
Duplicate / Edit NextCloud docker settings. Map additional volume as show below.
- chown -R www-data:www-data /home/gdrive
- chmod 755 /home/gdrive
Install Smbclient into Docker
root@2cc6c10ad138:/var/www/html# apt update
root@2cc6c10ad138:/var/www/html# apt install smbclient
Mount local drive
References
via Blogger https://ift.tt/34tH30K
December 19, 2020 at 04:48PM Cloud