it’s been mentioned everywhere already - it’s not advisable to write/copy using a mount. The suggested method is to read from those mounts, but use rclone copy/rclone move/rclone sync to copy data there.
Create a samba share to a local directory on the system and have a crontab that picks those files up every so often and uploads them.
I too have tested this very thing, but I didn’t have any issue writing to the mount. Windows reported the available space as being 1 petabyte. It’s worth noting that I was using the latest rclone beta, perhaps you should try that out.
OS: Ubuntu 16.04 LTS server
Default samba installation and only added two shares in config.
[GoogleDrive]
comment = GoogleDrive Mount
path = /home/administrator/googledrive
browsable = yes
writable = yes
read only = no
guest ok = no
write list = administrator
read list = administrator
valid users = administrator
[Download]
comment = GoogleDrive Mount
path = /home/administrator/download
browsable = yes
writable = yes
read only = no
guest ok = no
write list = administrator
read list = administrator
valid users = administrator
If i try to write in existing text file i will get IO error. Cant copy files to drive, however browsing and copy and delete works.
p.s. The Download share is just for testing so I could check that samba works ok.
Where are the rclone logs stored ?
I tried adding log in mount command but nothing is being recorded.
rclone mount --allow-other --log-file=/var/log/rclonemount.log googledrive:/ /home/administrator/googledrive
874 /*
874 * Actually do the open - if O_TRUNC is needed handle it
875 * below under the share mode lock.
876 */
877 status = fd_open_atomic(conn, fsp, local_flags & ~O_TRUNC,
878 unx_mode, p_file_created);
879 if (!NT_STATUS_IS_OK(status)) {
880 DEBUG(3,("Error opening file %s (%s) (local_flags=%d) "
881 "(flags=%d)\n", smb_fname_str_dbg(smb_fname),
882 nt_errstr(status),local_flags,flags));
883 return status;
884 }
flags=578 is 0x242 which means that samba opened the file in O_RDWR | O_CREATE | O_TRUNCATE
This isn’t something rclone supports (or can ever support) since none of the cloud providers allow that both reading and writing to files at the same time.
However I could work-around it in rclone by opening files that were opened in O_RDWR | O_TRUNCATE | O_CREATE and ignore the read part. If I return a write file handle then the user would get an error on reading.
You could try putting a layer between rclone and your mount like unionfs. That might help samba. Writes would go to a local file system and reads would continue down to the bottom layer.
Yea but for that I would need to have a lot of disk space that would act as buffer (while moving them with cron) and there would be problems if users started to edit files that would be uploading at same time.
The point would be to have infinity drive that would directly write to cloud.
Yes… I do similar and then I just periodically push the changes down from local to cloud. But yes, you would need space for writes until the next push.