Mounting with rc 'vfsOpt={"CacheMode": 3,"DirPerms": 777,"FilePerms": 777}' but end up getting permission: dr----x--x 1 derek derek 0 Nov 5 2020 Clips

tested on both the latest release ("v1.57.0") and beta

+ rclone rc --rc-user=*** --rc-pass=*** --rc-addr=:5572 mount/mount fs=share_03: mountPoint=/mnt/share_03 'vfsOpt={"CacheMode": 3,"DirPerms": 777,"FilePerms": 777}' 'mountOpt={"AllowOther": true}'
2021/11/23 17:02:33 DEBUG : rc: "mount/mount": with parameters map[fs:share_03: mountOpt:{"AllowOther": true} mountPoint:/mnt/share_03 vfsOpt:{"CacheMode": 3,"DirPerms": 777,"FilePerms": 777}]
2021/11/23 17:02:33 DEBUG : Creating backend with remote "share_03:"
2021/11/23 17:02:33 DEBUG : Using config file from "/config/rclone/rclone.conf"
2021/11/23 17:02:33 DEBUG : share_03: detected overridden config - adding "{KkEKP}" suffix to name
2021/11/23 17:02:33 DEBUG : fs cache: renaming cache item "share_03:" to be canonical "share_03{KkEKP}:"
2021/11/23 17:02:33 DEBUG : rc: "core/stats": with parameters map[]
2021/11/23 17:02:33 DEBUG : rc: "core/stats": reply map[bytes:0 checks:0 deletedDirs:0 deletes:0 elapsedTime:4.019388347 errors:0 eta:<nil> fatalError:false renames:0 retryError:false speed:0 totalBytes:0 totalChecks:0 totalTransfers:0 transferTime:0 transfers:0]: <nil>
2021/11/23 17:02:34 DEBUG : vfs cache: root is "/cache"
2021/11/23 17:02:34 DEBUG : vfs cache: data root is "/cache/vfs/share_03{KkEKP}"
2021/11/23 17:02:34 DEBUG : vfs cache: metadata root is "/cache/vfsMeta/share_03{KkEKP}"
2021/11/23 17:02:34 DEBUG : Creating backend with remote "/cache/vfs/share_03{KkEKP}/"
2021/11/23 17:02:34 DEBUG : Creating backend with remote "/cache/vfsMeta/share_03{KkEKP}/"
2021/11/23 17:02:34 DEBUG : Google drive root '': Mounting on "/mnt/share_03"
2021/11/23 17:02:34 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item Shared/Media/SampleVideo/HDR10Plus Sample_HDR10+ HEVC 10-bit 23.976 Sample .mkv not removed, freed 0 bytes
2021/11/23 17:02:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 17.011Mi (was 17.011Mi)
2021/11/23 17:02:34 DEBUG : Mount for Google drive root '' created at /mnt/share_03 using mount
2021/11/23 17:02:34 DEBUG : rc: "mount/mount": reply map[]: <nil>
{}
2021/11/23 17:02:34 DEBUG : : Root:
2021/11/23 17:02:34 DEBUG : : >Root: node=/, err=<nil>
+ mount_mergerfs
+ mergerfs /storage:/mnt/share_03/Shared/Media /mnt/share_03_merged -o rw,use_ino,cache.files=partial,dropcacheonclose=true,allow_other,func.getattr=newest,category.action=all,category.create=ff,cache.files=auto-full
2021/11/23 17:02:34 DEBUG : /: Lookup: name="Shared"
2021/11/23 17:02:34 DEBUG : /: >Lookup: node=Shared/, err=<nil>
2021/11/23 17:02:34 DEBUG : Shared/: Attr:
2021/11/23 17:02:34 DEBUG : Shared/: >Attr: attr=valid=1s ino=0 size=0 mode=dr----x--x, err=<nil>
2021/11/23 17:02:34 DEBUG : Shared/: Lookup: name="Media"
2021/11/23 17:02:34 DEBUG : Shared/: >Lookup: node=Shared/Media/, err=<nil>
2021/11/23 17:02:34 DEBUG : Shared/Media/: Attr:
2021/11/23 17:02:34 DEBUG : Shared/Media/: >Attr: attr=valid=1s ino=0 size=0 mode=dr----x--x, err=<nil>
+ sleep 3

command i used for mounting:

rclone --config=/config/rclone/rclone.conf --rc-addr=:5572 --use-mmap --user-agent rclone_mounte --tpslimit-burst 3 --size-only --no-update-modtime --drive-stop-on-download-limit --drive-stop-on-upload-limit --drive-acknowledge-abuse --cache-dir /cache --temp-dir /cache/tmp --track-renames --track-renames-strategy modtime,leaf --buffer-size=64M --progress --human-readable --exclude-from=/config/rclone/exclude.txt -vv --exclude-from=/config/rclone/exclude.txt rcd --rc-user=derek --rc-pass=*** --rc-addr=:5572 --rc-enable-metrics --rc-serve --rc-web-gui --rc-web-gui-update --rc-web-gui-no-open-browser

rclone rc --rc-user=*** --rc-pass=*** --rc-addr=:5572 options/set --json '{
    "main":{
        "Checkers": 6,
        "Transfers": 6,
        "BufferSize":16777216,
        "TrackRenames":true,
        "TrackRenamesStrategy":"modtime,leaf",
        "NoUpdateModTime":true,
        "BufferSize":67108864,
        "TPSLimitBurst":3,
        "UserAgent":"rclone_mount",
        "CutoffMode":"hard",
        "Progress":true,
        "UseMmap":true,
        "HumanReadable":true
    },
    "vfs":{
        "CacheMode":3,
        "Umask":0,
        "DirPerms": 777,
        "FilePerms": 777,
        "CacheMaxSize":322122547200,
        "CacheMaxAge":3600000000000,
        "CacheMaxSize":322122547200,
        "CachePollInterval":300000000000,
        "ChunkSize":67108864,
        "ChunkSizeLimit":536870912,
        "ReadAhead":67108864,
        "NoModTime":true,
        "NoChecksum":true,
        "WriteBack":300000000000,
        "CaseInsensitive":true,
        "ReadAhead":2147483648
    },
    "mount":{
        "AllowNonEmpty":true,
        "AllowOther":true,
        "AsyncRead":true,
        "WritebackCache":true
    }
}'

rclone rc --rc-user=derek --rc-pass=*** --rc-addr=:5572 options/set --json '{"vfs": {"GID":1000, "UID":1000}}'

rclone rc --rc-user=derek --rc-pass=*** --rc-addr=:5572 mount/mount fs=share_03: mountPoint=/mnt/share_03 'vfsOpt={"CacheMode": 3,"DirPerms": 777,"FilePerms": 777}' 'mountOpt={"AllowOther": true}'

do a ll on mounted drive, all the one from mergerfs are rwx and the ones from rclone are r----x--x

➜  share_03_merged ll
total 24K
dr----x--x 1 derek derek    0 Nov 15 02:55 Anime
dr----x--x 1 derek derek    0 Oct 28 13:44 Anime.duplicated
drwxrwxrwx 2 derek derek 4.0K Nov 23 12:21 AudioBook
drwxrwxrwx 2 derek derek 4.0K Nov 23 11:59 Book
dr----x--x 1 derek derek    0 Nov  5  2020 Clips
dr----x--x 1 derek derek    0 Oct 17  2020 Course
dr----x--x 1 derek derek    0 Oct 13 10:16 Documentary
dr----x--x 1 derek derek    0 Oct 13 10:17 Documentary.duplicated
drwxrwxrwx 6 root  root  4.0K Nov 23 16:30 _downloads
drwxrwxrwx 4 derek derek 4.0K Nov 23 13:19 Movie
dr----x--x 1 derek derek    0 Oct 24 19:38 Movie.Duplicated
dr----x--x 1 derek derek    0 Oct 13 15:53 MovieJunkYard
dr----x--x 1 derek derek    0 Oct  8 18:13 MovieList
drwxrwxrwx 2 derek derek 4.0K Nov 23 12:51 Music
dr----x--x 1 derek derek    0 Oct 23  2020 SampleVideo
drwxrwxrwx 5 derek derek 4.0K Nov 23 16:40 TVShow
dr----x--x 1 derek derek    0 Oct 14 12:24 TVShow.duplicated
dr----x--x 1 derek derek    0 Nov 16 00:10 TVShow.Graveyard
dr----x--x 1 derek derek    0 Oct  7 02:44 TVShowList
dr----x--x 1 derek derek    0 Nov 10 21:34 TVShow.Sonarr
dr----x--x 1 derek derek    0 Nov 10 16:16 Youtube-dl
-r----x--x 1 derek derek 94M Nov  5  2020 'Videos With Unexpected Endings _ Unexpected Memes Compilation 3-craPRqcdb18.mp4'

if you're interested in the whole script, you can find it here

i seem to know what happend

however I'm still now sure what to send in the json payload to indicate 0777, more specifically how should i quote it. cuz if i double quote it ends up in error

2021/11/23 19:13:12 DEBUG : rc: "options/set": with parameters map[main:map[BufferSize:6.7108864e+07 Checkers:6 CutoffMode:hard HumanReadable:true NoUpdateModTime:true Progress:true TPSLimitBurst:3 TrackRenames:true TrackRenamesStrategy:modtime,leaf Transfers:6 UseMmap:true UserAgent:rclone_mount] mount:map[AllowNonEmpty:true AllowOther:true AsyncRead:true WritebackCache:true] vfs:map[CacheMaxAge:3.6e+12 CacheMaxSize:3.221225472e+11 CacheMode:3 CachePollInterval:3e+11 CaseInsensitive:true ChunkSize:6.7108864e+07 ChunkSizeLimit:5.36870912e+08 DirPerms:0777 FilePerms:0777 NoChecksum:true NoModTime:true ReadAhead:2.147483648e+09 Umask:0 WriteBack:3e+11]]
2021/11/23 19:13:12 ERROR : rc: "options/set": error: failed to write options from block "vfs": Reshape failed to Unmarshal: json: cannot unmarshal string into Go struct field Options.DirPerms of type fs.FileMode
2021/11/23 19:13:12 Failed to rc: Failed to read rc response: 500 Internal Server Error: {
	"error": "failed to write options from block \"vfs\": Reshape failed to Unmarshal: json: cannot unmarshal string into Go struct field Options.DirPerms of type fs.FileMode",
	"input": {
		"main": {
			"BufferSize": 67108864,
			"Checkers": 6,
			"CutoffMode": "hard",
			"HumanReadable": true,
			"NoUpdateModTime": true,
			"Progress": true,
			"TPSLimitBurst": 3,
			"TrackRenames": true,
			"TrackRenamesStrategy": "modtime,leaf",
			"Transfers": 6,
			"UseMmap": true,
			"UserAgent": "rclone_mount"
		},
		"mount": {
			"AllowNonEmpty": true,
			"AllowOther": true,
			"AsyncRead": true,
			"WritebackCache": true
		},
		"vfs": {
			"CacheMaxAge": 3600000000000,
			"CacheMaxSize": 322122547200,
			"CacheMode": 3,
			"CachePollInterval": 300000000000,
			"CaseInsensitive": true,
			"ChunkSize": 67108864,
			"ChunkSizeLimit": 536870912,
			"DirPerms": "0777",
			"FilePerms": "0777",
			"NoChecksum": true,
			"NoModTime": true,
			"ReadAhead": 2147483648,
			"Umask": 0,
			"WriteBack": 300000000000
		}
	},
	"path": "options/set",
	"status": 500
}
+ rclone rc --rc-user=derek --rc-pass=*** --rc-addr=:5572 options/set --json '{"vfs": {"GID":1000, "UID":1000}}'
2021/11/23 19:13:12 DEBUG : rc: "options/set": with parameters map[vfs:map[GID:1000 UID:1000]]
2021/11/23 19:13:12 DEBUG : rc: "options/set": reply map[]: <nil>
{}
+ rclone rc --rc-user=derek --rc-pass=*** --rc-addr=:5572 mount/mount fs=share_03: mountPoint=/mnt/share_03 'vfsOpt={"CacheMode": 3,"DirPerms": "0777","FilePerms": "0777"}' 'mountOpt={"AllowOther": true}'
2021/11/23 19:13:12 DEBUG : rc: "mount/mount": with parameters map[fs:share_03: mountOpt:{"AllowOther": true} mountPoint:/mnt/share_03 vfsOpt:{"CacheMode": 3,"DirPerms": "0777","FilePerms": "0777"}]
2021/11/23 19:13:12 ERROR : rc: "mount/mount": error: key "vfsOpt": json: cannot unmarshal string into Go struct field Options.DirPerms of type fs.FileMode
2021/11/23 19:13:12 Failed to rc: Failed to read rc response: 400 Bad Request: {
	"error": "key \"vfsOpt\": json: cannot unmarshal string into Go struct field Options.DirPerms of type fs.FileMode",
	"input": {
		"fs": "share_03:",
		"mountOpt": "{\"AllowOther\": true}",
		"mountPoint": "/mnt/share_03",
		"vfsOpt": "{\"CacheMode\": 3,\"DirPerms\": \"0777\",\"FilePerms\": \"0777\"}"
	},
	"path": "mount/mount",
	"status": 400
}

update: changing it to 511 resulted in -rwxrwxrwx which is what i wanted

511 (decimal) -> 0777 (octal)

I don't think JSON supports octal officially, so your decimal answer is the best you can do unfortunately.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.