github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/commands/rclone_mount.md (about) 1 --- 2 date: 2019-06-20T16:09:42+01:00 3 title: "rclone mount" 4 slug: rclone_mount 5 url: /commands/rclone_mount/ 6 --- 7 ## rclone mount 8 9 Mount the remote as file system on a mountpoint. 10 11 ### Synopsis 12 13 14 rclone mount allows Linux, FreeBSD, macOS and Windows to 15 mount any of Rclone's cloud storage systems as a file system with 16 FUSE. 17 18 First set up your remote using `rclone config`. Check it works with `rclone ls` etc. 19 20 Start the mount like this 21 22 rclone mount remote:path/to/files /path/to/local/mount 23 24 Or on Windows like this where X: is an unused drive letter 25 26 rclone mount remote:path/to/files X: 27 28 When the program ends, either via Ctrl+C or receiving a SIGINT or SIGTERM signal, 29 the mount is automatically stopped. 30 31 The umount operation can fail, for example when the mountpoint is busy. 32 When that happens, it is the user's responsibility to stop the mount manually with 33 34 # Linux 35 fusermount -u /path/to/local/mount 36 # OS X 37 umount /path/to/local/mount 38 39 ### Installing on Windows 40 41 To run rclone mount on Windows, you will need to 42 download and install [WinFsp](http://www.secfs.net/winfsp/). 43 44 WinFsp is an [open source](https://github.com/billziss-gh/winfsp) 45 Windows File System Proxy which makes it easy to write user space file 46 systems for Windows. It provides a FUSE emulation layer which rclone 47 uses combination with 48 [cgofuse](https://github.com/billziss-gh/cgofuse). Both of these 49 packages are by Bill Zissimopoulos who was very helpful during the 50 implementation of rclone mount for Windows. 51 52 #### Windows caveats 53 54 Note that drives created as Administrator are not visible by other 55 accounts (including the account that was elevated as 56 Administrator). So if you start a Windows drive from an Administrative 57 Command Prompt and then try to access the same drive from Explorer 58 (which does not run as Administrator), you will not be able to see the 59 new drive. 60 61 The easiest way around this is to start the drive from a normal 62 command prompt. It is also possible to start a drive from the SYSTEM 63 account (using [the WinFsp.Launcher 64 infrastructure](https://github.com/billziss-gh/winfsp/wiki/WinFsp-Service-Architecture)) 65 which creates drives accessible for everyone on the system or 66 alternatively using [the nssm service manager](https://nssm.cc/usage). 67 68 ### Limitations 69 70 Without the use of "--vfs-cache-mode" this can only write files 71 sequentially, it can only seek when reading. This means that many 72 applications won't work with their files on an rclone mount without 73 "--vfs-cache-mode writes" or "--vfs-cache-mode full". See the [File 74 Caching](#file-caching) section for more info. 75 76 The bucket based remotes (eg Swift, S3, Google Compute Storage, B2, 77 Hubic) won't work from the root - you will need to specify a bucket, 78 or a path within the bucket. So `swift:` won't work whereas 79 `swift:bucket` will as will `swift:bucket/path`. 80 None of these support the concept of directories, so empty 81 directories will have a tendency to disappear once they fall out of 82 the directory cache. 83 84 Only supported on Linux, FreeBSD, OS X and Windows at the moment. 85 86 ### rclone mount vs rclone sync/copy 87 88 File systems expect things to be 100% reliable, whereas cloud storage 89 systems are a long way from 100% reliable. The rclone sync/copy 90 commands cope with this with lots of retries. However rclone mount 91 can't use retries in the same way without making local copies of the 92 uploads. Look at the [file caching](#file-caching) 93 for solutions to make mount more reliable. 94 95 ### Attribute caching 96 97 You can use the flag --attr-timeout to set the time the kernel caches 98 the attributes (size, modification time etc) for directory entries. 99 100 The default is "1s" which caches files just long enough to avoid 101 too many callbacks to rclone from the kernel. 102 103 In theory 0s should be the correct value for filesystems which can 104 change outside the control of the kernel. However this causes quite a 105 few problems such as 106 [rclone using too much memory](https://github.com/ncw/rclone/issues/2157), 107 [rclone not serving files to samba](https://forum.rclone.org/t/rclone-1-39-vs-1-40-mount-issue/5112) 108 and [excessive time listing directories](https://github.com/ncw/rclone/issues/2095#issuecomment-371141147). 109 110 The kernel can cache the info about a file for the time given by 111 "--attr-timeout". You may see corruption if the remote file changes 112 length during this window. It will show up as either a truncated file 113 or a file with garbage on the end. With "--attr-timeout 1s" this is 114 very unlikely but not impossible. The higher you set "--attr-timeout" 115 the more likely it is. The default setting of "1s" is the lowest 116 setting which mitigates the problems above. 117 118 If you set it higher ('10s' or '1m' say) then the kernel will call 119 back to rclone less often making it more efficient, however there is 120 more chance of the corruption issue above. 121 122 If files don't change on the remote outside of the control of rclone 123 then there is no chance of corruption. 124 125 This is the same as setting the attr_timeout option in mount.fuse. 126 127 ### Filters 128 129 Note that all the rclone filters can be used to select a subset of the 130 files to be visible in the mount. 131 132 ### systemd 133 134 When running rclone mount as a systemd service, it is possible 135 to use Type=notify. In this case the service will enter the started state 136 after the mountpoint has been successfully set up. 137 Units having the rclone mount service specified as a requirement 138 will see all files and folders immediately in this mode. 139 140 ### chunked reading ### 141 142 --vfs-read-chunk-size will enable reading the source objects in parts. 143 This can reduce the used download quota for some remotes by requesting only chunks 144 from the remote that are actually read at the cost of an increased number of requests. 145 146 When --vfs-read-chunk-size-limit is also specified and greater than --vfs-read-chunk-size, 147 the chunk size for each open file will get doubled for each chunk read, until the 148 specified value is reached. A value of -1 will disable the limit and the chunk size will 149 grow indefinitely. 150 151 With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following 152 parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. 153 When --vfs-read-chunk-size-limit 500M is specified, the result would be 154 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. 155 156 Chunked reading will only work with --vfs-cache-mode < full, as the file will always 157 be copied to the vfs cache before opening with --vfs-cache-mode full. 158 159 ### Directory Cache 160 161 Using the `--dir-cache-time` flag, you can set how long a 162 directory should be considered up to date and not refreshed from the 163 backend. Changes made locally in the mount may appear immediately or 164 invalidate the cache. However, changes done on the remote will only 165 be picked up once the cache expires. 166 167 Alternatively, you can send a `SIGHUP` signal to rclone for 168 it to flush all directory caches, regardless of how old they are. 169 Assuming only one rclone instance is running, you can reset the cache 170 like this: 171 172 kill -SIGHUP $(pidof rclone) 173 174 If you configure rclone with a [remote control](/rc) then you can use 175 rclone rc to flush the whole directory cache: 176 177 rclone rc vfs/forget 178 179 Or individual files or directories: 180 181 rclone rc vfs/forget file=path/to/file dir=path/to/dir 182 183 ### File Buffering 184 185 The `--buffer-size` flag determines the amount of memory, 186 that will be used to buffer data in advance. 187 188 Each open file descriptor will try to keep the specified amount of 189 data in memory at all times. The buffered data is bound to one file 190 descriptor and won't be shared between multiple open file descriptors 191 of the same file. 192 193 This flag is a upper limit for the used memory per file descriptor. 194 The buffer will only use memory for data that is downloaded but not 195 not yet read. If the buffer is empty, only a small amount of memory 196 will be used. 197 The maximum memory used by rclone for buffering can be up to 198 `--buffer-size * open files`. 199 200 ### File Caching 201 202 These flags control the VFS file caching options. The VFS layer is 203 used by rclone mount to make a cloud storage system work more like a 204 normal file system. 205 206 You'll need to enable VFS caching if you want, for example, to read 207 and write simultaneously to a file. See below for more details. 208 209 Note that the VFS cache works in addition to the cache backend and you 210 may find that you need one or the other or both. 211 212 --cache-dir string Directory rclone will use for caching. 213 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 214 --vfs-cache-mode string Cache mode off|minimal|writes|full (default "off") 215 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 216 --vfs-cache-max-size int Max total size of objects in the cache. (default off) 217 218 If run with `-vv` rclone will print the location of the file cache. The 219 files are stored in the user cache file area which is OS dependent but 220 can be controlled with `--cache-dir` or setting the appropriate 221 environment variable. 222 223 The cache has 4 different modes selected by `--vfs-cache-mode`. 224 The higher the cache mode the more compatible rclone becomes at the 225 cost of using disk space. 226 227 Note that files are written back to the remote only when they are 228 closed so if rclone is quit or dies with open files then these won't 229 get written back to the remote. However they will still be in the on 230 disk cache. 231 232 If using --vfs-cache-max-size note that the cache may exceed this size 233 for two reasons. Firstly because it is only checked every 234 --vfs-cache-poll-interval. Secondly because open files cannot be 235 evicted from the cache. 236 237 #### --vfs-cache-mode off 238 239 In this mode the cache will read directly from the remote and write 240 directly to the remote without caching anything on disk. 241 242 This will mean some operations are not possible 243 244 * Files can't be opened for both read AND write 245 * Files opened for write can't be seeked 246 * Existing files opened for write must have O_TRUNC set 247 * Files open for read with O_TRUNC will be opened write only 248 * Files open for write only will behave as if O_TRUNC was supplied 249 * Open modes O_APPEND, O_TRUNC are ignored 250 * If an upload fails it can't be retried 251 252 #### --vfs-cache-mode minimal 253 254 This is very similar to "off" except that files opened for read AND 255 write will be buffered to disks. This means that files opened for 256 write will be a lot more compatible, but uses the minimal disk space. 257 258 These operations are not possible 259 260 * Files opened for write only can't be seeked 261 * Existing files opened for write must have O_TRUNC set 262 * Files opened for write only will ignore O_APPEND, O_TRUNC 263 * If an upload fails it can't be retried 264 265 #### --vfs-cache-mode writes 266 267 In this mode files opened for read only are still read directly from 268 the remote, write only and read/write files are buffered to disk 269 first. 270 271 This mode should support all normal file system operations. 272 273 If an upload fails it will be retried up to --low-level-retries times. 274 275 #### --vfs-cache-mode full 276 277 In this mode all reads and writes are buffered to and from disk. When 278 a file is opened for read it will be downloaded in its entirety first. 279 280 This may be appropriate for your needs, or you may prefer to look at 281 the cache backend which does a much more sophisticated job of caching, 282 including caching directory hierarchies and chunks of files. 283 284 In this mode, unlike the others, when a file is written to the disk, 285 it will be kept on the disk after it is written to the remote. It 286 will be purged on a schedule according to `--vfs-cache-max-age`. 287 288 This mode should support all normal file system operations. 289 290 If an upload or download fails it will be retried up to 291 --low-level-retries times. 292 293 294 ``` 295 rclone mount remote:path /path/to/mountpoint [flags] 296 ``` 297 298 ### Options 299 300 ``` 301 --allow-non-empty Allow mounting over a non-empty directory. 302 --allow-other Allow access to other users. 303 --allow-root Allow access to root user. 304 --attr-timeout duration Time for which file/directory attributes are cached. (default 1s) 305 --daemon Run mount as a daemon (background mode). 306 --daemon-timeout duration Time limit for rclone to respond to kernel (not supported by all OSes). 307 --debug-fuse Debug the FUSE internals - needs -v. 308 --default-permissions Makes kernel enforce access control based on the file mode. 309 --dir-cache-time duration Time to cache directory entries for. (default 5m0s) 310 --dir-perms FileMode Directory permissions (default 0777) 311 --file-perms FileMode File permissions (default 0666) 312 --fuse-flag stringArray Flags or arguments to be passed direct to libfuse/WinFsp. Repeat if required. 313 --gid uint32 Override the gid field set by the filesystem. (default 1000) 314 -h, --help help for mount 315 --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads. (default 128k) 316 --no-checksum Don't compare checksums on up/download. 317 --no-modtime Don't read/write the modification time (can speed things up). 318 --no-seek Don't allow seeking in files. 319 -o, --option stringArray Option for libfuse/WinFsp. Repeat if required. 320 --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable. (default 1m0s) 321 --read-only Mount read-only. 322 --uid uint32 Override the uid field set by the filesystem. (default 1000) 323 --umask int Override the permission bits set by the filesystem. 324 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 325 --vfs-cache-max-size SizeSuffix Max total size of objects in the cache. (default off) 326 --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) 327 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 328 --vfs-read-chunk-size SizeSuffix Read the source objects in chunks. (default 128M) 329 --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached. 'off' is unlimited. (default off) 330 --volname string Set the volume name (not supported by all OSes). 331 --write-back-cache Makes kernel buffer writes before sending them to rclone. Without this, writethrough caching is used. 332 ``` 333 334 See the [global flags page](/flags/) for global options not listed here. 335 336 ### SEE ALSO 337 338 * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. 339