all & Setup rclone (Ubuntu/Debian)
there is also a Script to Mount the Drive email [email protected] for that
1. To install rclone type the following into your SSH terminal(PuTTY):
sudo apt install golang -y && curl https://rclone.org/install.sh | sudo bash
2. Now we will make sure fusefs can use the –allow-other flag by typing the following:
sudo nano /etc/fuse.conf
3. Once you have the fuse.conf file open make sure you remove the # before the word user_allow_other once you have done this press Ctrl+x then press y to save. Your file should look similar to the image below:
rclone Remote Setup
Step 2: Type: n Press: Enter
Step 3: Type: TeamDrive Press: Enter
Step 4: Type: drive Press: Enter
Step 5: Paste you client_id and client_secret which you can create by following this guide: How to: Google Drive API Client ID and Client Secret
(To paste in PuTTY simply right click, to copy in PuTTY simply highlight the text. Do not press Ctrl+C or Ctrl+V)
Step 6: Type: drive Press: Enter
Step 7: Press: Enter
Step 8: Press: Enter
Step 9: Type: n Press: Enter
Step 10: Type: n Press: Enter
Step 11: Highlight the link with your mouse (Do not press Ctrl+C if you are using PuTTY, highlighting the text with your mouse will copy it.) and then paste the link into a browser window, login with your Google account and press Allow. It will give you a code copy that code and paste it back into the PuTTY window using right click. Press: Enter
Step 12: Type: y Press: Enter
Step 13: Look in the list for the Team Drive called “TeamDrive” type the number next to this Team Drive. If this is the only Team Drive in your account it will be the number 1 so Type: 1 Press: Enter
Step 14: Type: y Press: Enter
Step 15: Type: q Press: Enter
Mounting the Team Drive with screen
1. First we need to make a folder in your mnt directory to mount the Team Drive in. Lets call it TeamDrive. To do this type:
sudo mkdir ~/TeamDrive
2. To create a screen instance called mount we will type the following into the terminal:
screen -S mount
3. Now it is time to mount the Google Team Drive by pasting the follow mount command into the terminal window:
rclone mount TeamDrive:/Media ~/TeamDrive --timeout 1h --dir-cache-time 1000h --poll-interval 1m --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit=2048M --buffer-size 64M --drive-chunk-size 64M
4. Now you can de-attach from the screen instance by pressing and holding Ctrl+A, then the letter D.
You can now check to see if the media files are mounted by typing: /mnt/TeamDrive and then typing ls if you see Movies and TV folders it looks like everything is mounted correctly.
Systemd Daemon Service
If you have root access you can create daemon service to run on startup so your Team Drive mount runs in the background and automatically re-mounts on reboot.
1. First we need to make a folder in your mnt directory to mount the TeamDrive in. Lets call it TeamDrive and the setup the correct ownership/permissions To do this type:
sudo mkdir /mnt/TeamDrive sudo chmod 775 /mnt/TeamDrive
2. First we need to create the TeamDrive.service file by typing the following:
sudo nano /etc/systemd/system/TeamDrive.service
3. Now edit and paste the following text into your terminal window by right clicking. Remember to replace the word TeamDrive in the text below with your own user.
[Unit] Description=TeamDrive mount After=network-online.target Wants=network-online.target [Service] Type=simple User=0 Group=0 ExecStart=/usr/bin/rclone mount TeamDrive:/Media /mnt/TeamDrive \ --config /home/HHS/.config/rclone/rclone.conf \ --allow-other \ --uid=1000 \ --gid=1000 \ --umask 002 \ --timeout 1h \ --dir-cache-time 1000h \ --poll-interval 1m \
--vfs-read-chunk-size 64M \ --vfs-read-chunk-size-limit 2048M \ --buffer-size 64M \ --drive-chunk-size 64M \ --rc \ --rc-addr=localhost:5572 ExecStop=/bin/fusermount -uz /mnt/TeamDrive TimeoutStopSec=20 KillMode=process RemainAfterExit=yes [Install] WantedBy=multi-user.target
4. Now press Ctrl+X and then press y to save the file.
5. Now lets enable and start the daemon, by typing the following 1 line at a time:
sudo systemctl daemon-reload
sudo systemctl enable TeamDrive.service
sudo systemctl start TeamDrive.service
Check to see if the service is running by typing: (Make sure its green and says active (running)
systemctl status TeamDrive
You can now check to see if the media files are mounted by typing: cd /mnt/TeamDrive and then typing ls if you see Movies and TV folders it looks like everything is mounted correctly.
To pre-build the directory cache run this command and wait:
rclone rc vfs/refresh recursive=true --timeout=1h --rc-addr=localhost:5572