masonr / PLEXiDRIVE

Scripts to facilitate the use of cloud storage (such as Google Drive) as storage for Plex media server
MIT License
145 stars 19 forks source link

remote gdrive folders don't appear in the /mnt/gdrive-main #8

Closed goodpunk6 closed 7 years ago

goodpunk6 commented 7 years ago

It seems that I can use rclone to lsd and ls and copy files. But the remote folders themselves don't appear in /mnt/gdrive-main. Are they supposed to appear somewhere else? according to the command -

sudo rclone mount --allow-non-empty --allow-other the_domain:/ /mnt/gdrive-main

"the_domain" should mount to /mnt/gdrive-main. here's a pic - https://dl.dropboxusercontent.com/s/rsyolrg0vzblsam/TeamViewer_2017-05-31_11-09-17.png

masonr commented 7 years ago

No, that's where your remote files should show up. Try doing this --

  1. Take out that gdrive-directory file and move it back to your ~/PLEXiDRIVE directory so the mount directory is completely empty. It's possible the mount is failing since you have already have files in the mount path.

  2. Unmount the drive: sudo fusermount -u /mnt/gdrive-main

  3. Remount the drive with your rclone mount command (don't use an ampersand at the end so you can see any output in your terminal): sudo rclone mount --allow-non-empty --allow-other the_domain:/ /mnt/gdrive-main

  4. Check the /mnt/gdrive-main directory to see if any files are in the folder.

  5. If all goes well, Ctrl+c your terminal and repeat 2-4 above, but use an ampersand (&) at the end of your rclone mount command.

Let me know how that goes.

goodpunk6 commented 7 years ago

perfect! That worked. In order to make this mount automatically on boot, can I just add the mount command to the end of the rc local?

masonr commented 7 years ago

Yupp! You should be able to throw the command in your /etc/rc.local file and that'll mount the drive on startup.

goodpunk6 commented 7 years ago

Apparently that doesn't work. When I add the mount command to the RC local file it doesn't actually execute. Meaning Google Drive folders don't appear at the mount point. So I went ahead and I removed the command from RC local and now I'm having trouble mounting the Google Drive when I run the command for the first time. I am able to run the unmount command and after that Rerun the mount command and then it works. This all started happening after I added the mount command to the RC local file and removed it.

On Jun 2, 2017 8:11 PM, "Mason R" notifications@github.com wrote:

Yupp! You should be able to throw the command in your /etc/rc.local file and that'll mount the drive on startup.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/masonr/PLEXiDRIVE/issues/8#issuecomment-305933211, or mute the thread https://github.com/notifications/unsubscribe-auth/AOZD5fbFUjSJZ60Mbe8ggybHtc15QdI4ks5sAJ8IgaJpZM4Nrxqv .

masonr commented 7 years ago

Now that you say that, I think I ran into the same issue. At least with the command in rc.local not working.

You could probably make some script to check your mount to see if it is connected and if not, run your mount command. Create a script along these lines:

#!/bin/bash

check=`ls /mnt/gdrive-main | wc -l`
if [ "$check" -lt 1 ]
then
    echo "Gdrive not mounted, running rclone mount command..."
    sudo fusermount -u /mnt/gdrive-main
    sudo rclone mount --allow-non-empty --allow-other the_domain:/ /mnt/gdrive-main &
done

And just add a command that calls that script every x minutes to the root crontab -- sudo crontab -e. That would also handle if the drive gets disconnected for whatever reason.