github.com/artpar/rclone@v1.67.3/docs/content/commands/rclone_mount.md (about) 1 --- 2 title: "rclone mount" 3 description: "Mount the remote as file system on a mountpoint." 4 slug: rclone_mount 5 url: /commands/rclone_mount/ 6 groups: Filter 7 versionIntroduced: v1.33 8 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/mount/ and as part of making a release run "make commanddocs" 9 --- 10 # rclone mount 11 12 Mount the remote as file system on a mountpoint. 13 14 ## Synopsis 15 16 rclone mount allows Linux, FreeBSD, macOS and Windows to 17 mount any of Rclone's cloud storage systems as a file system with 18 FUSE. 19 20 First set up your remote using `rclone config`. Check it works with `rclone ls` etc. 21 22 On Linux and macOS, you can run mount in either foreground or background (aka 23 daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag 24 to force background mode. On Windows you can run mount in foreground only, 25 the flag is ignored. 26 27 In background mode rclone acts as a generic Unix mount program: the main 28 program starts, spawns background rclone process to setup and maintain the 29 mount, waits until success or timeout and exits with appropriate code 30 (killing the child process if it fails). 31 32 On Linux/macOS/FreeBSD start the mount like this, where `/path/to/local/mount` 33 is an **empty** **existing** directory: 34 35 rclone mount remote:path/to/files /path/to/local/mount 36 37 On Windows you can start a mount in different ways. See [below](#mounting-modes-on-windows) 38 for details. If foreground mount is used interactively from a console window, 39 rclone will serve the mount and occupy the console so another window should be 40 used to work with the mount until rclone is interrupted e.g. by pressing Ctrl-C. 41 42 The following examples will mount to an automatically assigned drive, 43 to specific drive letter `X:`, to path `C:\path\parent\mount` 44 (where parent directory or drive must exist, and mount must **not** exist, 45 and is not supported when [mounting as a network drive](#mounting-modes-on-windows)), and 46 the last example will mount as network share `\\cloud\remote` and map it to an 47 automatically assigned drive: 48 49 rclone mount remote:path/to/files * 50 rclone mount remote:path/to/files X: 51 rclone mount remote:path/to/files C:\path\parent\mount 52 rclone mount remote:path/to/files \\cloud\remote 53 54 When the program ends while in foreground mode, either via Ctrl+C or receiving 55 a SIGINT or SIGTERM signal, the mount should be automatically stopped. 56 57 When running in background mode the user will have to stop the mount manually: 58 59 # Linux 60 fusermount -u /path/to/local/mount 61 # OS X 62 umount /path/to/local/mount 63 64 The umount operation can fail, for example when the mountpoint is busy. 65 When that happens, it is the user's responsibility to stop the mount manually. 66 67 The size of the mounted file system will be set according to information retrieved 68 from the remote, the same as returned by the [rclone about](https://rclone.org/commands/rclone_about/) 69 command. Remotes with unlimited storage may report the used size only, 70 then an additional 1 PiB of free space is assumed. If the remote does not 71 [support](https://rclone.org/overview/#optional-features) the about feature 72 at all, then 1 PiB is set as both the total and the free size. 73 74 ## Installing on Windows 75 76 To run rclone mount on Windows, you will need to 77 download and install [WinFsp](http://www.secfs.net/winfsp/). 78 79 [WinFsp](https://github.com/winfsp/winfsp) is an open-source 80 Windows File System Proxy which makes it easy to write user space file 81 systems for Windows. It provides a FUSE emulation layer which rclone 82 uses combination with [cgofuse](https://github.com/winfsp/cgofuse). 83 Both of these packages are by Bill Zissimopoulos who was very helpful 84 during the implementation of rclone mount for Windows. 85 86 ### Mounting modes on windows 87 88 Unlike other operating systems, Microsoft Windows provides a different filesystem 89 type for network and fixed drives. It optimises access on the assumption fixed 90 disk drives are fast and reliable, while network drives have relatively high latency 91 and less reliability. Some settings can also be differentiated between the two types, 92 for example that Windows Explorer should just display icons and not create preview 93 thumbnails for image and video files on network drives. 94 95 In most cases, rclone will mount the remote as a normal, fixed disk drive by default. 96 However, you can also choose to mount it as a remote network drive, often described 97 as a network share. If you mount an rclone remote using the default, fixed drive mode 98 and experience unexpected program errors, freezes or other issues, consider mounting 99 as a network drive instead. 100 101 When mounting as a fixed disk drive you can either mount to an unused drive letter, 102 or to a path representing a **nonexistent** subdirectory of an **existing** parent 103 directory or drive. Using the special value `*` will tell rclone to 104 automatically assign the next available drive letter, starting with Z: and moving backward. 105 Examples: 106 107 rclone mount remote:path/to/files * 108 rclone mount remote:path/to/files X: 109 rclone mount remote:path/to/files C:\path\parent\mount 110 rclone mount remote:path/to/files X: 111 112 Option `--volname` can be used to set a custom volume name for the mounted 113 file system. The default is to use the remote name and path. 114 115 To mount as network drive, you can add option `--network-mode` 116 to your mount command. Mounting to a directory path is not supported in 117 this mode, it is a limitation Windows imposes on junctions, so the remote must always 118 be mounted to a drive letter. 119 120 rclone mount remote:path/to/files X: --network-mode 121 122 A volume name specified with `--volname` will be used to create the network share path. 123 A complete UNC path, such as `\\cloud\remote`, optionally with path 124 `\\cloud\remote\madeup\path`, will be used as is. Any other 125 string will be used as the share part, after a default prefix `\\server\`. 126 If no volume name is specified then `\\server\share` will be used. 127 You must make sure the volume name is unique when you are mounting more than one drive, 128 or else the mount command will fail. The share name will treated as the volume label for 129 the mapped drive, shown in Windows Explorer etc, while the complete 130 `\\server\share` will be reported as the remote UNC path by 131 `net use` etc, just like a normal network drive mapping. 132 133 If you specify a full network share UNC path with `--volname`, this will implicitly 134 set the `--network-mode` option, so the following two examples have same result: 135 136 rclone mount remote:path/to/files X: --network-mode 137 rclone mount remote:path/to/files X: --volname \\server\share 138 139 You may also specify the network share UNC path as the mountpoint itself. Then rclone 140 will automatically assign a drive letter, same as with `*` and use that as 141 mountpoint, and instead use the UNC path specified as the volume name, as if it were 142 specified with the `--volname` option. This will also implicitly set 143 the `--network-mode` option. This means the following two examples have same result: 144 145 rclone mount remote:path/to/files \\cloud\remote 146 rclone mount remote:path/to/files * --volname \\cloud\remote 147 148 There is yet another way to enable network mode, and to set the share path, 149 and that is to pass the "native" libfuse/WinFsp option directly: 150 `--fuse-flag --VolumePrefix=\server\share`. Note that the path 151 must be with just a single backslash prefix in this case. 152 153 154 *Note:* In previous versions of rclone this was the only supported method. 155 156 [Read more about drive mapping](https://en.wikipedia.org/wiki/Drive_mapping) 157 158 See also [Limitations](#limitations) section below. 159 160 ### Windows filesystem permissions 161 162 The FUSE emulation layer on Windows must convert between the POSIX-based 163 permission model used in FUSE, and the permission model used in Windows, 164 based on access-control lists (ACL). 165 166 The mounted filesystem will normally get three entries in its access-control list (ACL), 167 representing permissions for the POSIX permission scopes: Owner, group and others. 168 By default, the owner and group will be taken from the current user, and the built-in 169 group "Everyone" will be used to represent others. The user/group can be customized 170 with FUSE options "UserName" and "GroupName", 171 e.g. `-o UserName=user123 -o GroupName="Authenticated Users"`. 172 The permissions on each entry will be set according to [options](#options) 173 `--dir-perms` and `--file-perms`, which takes a value in traditional Unix 174 [numeric notation](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation). 175 176 The default permissions corresponds to `--file-perms 0666 --dir-perms 0777`, 177 i.e. read and write permissions to everyone. This means you will not be able 178 to start any programs from the mount. To be able to do that you must add 179 execute permissions, e.g. `--file-perms 0777 --dir-perms 0777` to add it 180 to everyone. If the program needs to write files, chances are you will 181 have to enable [VFS File Caching](#vfs-file-caching) as well (see also 182 [limitations](#limitations)). Note that the default write permission have 183 some restrictions for accounts other than the owner, specifically it lacks 184 the "write extended attributes", as explained next. 185 186 The mapping of permissions is not always trivial, and the result you see in 187 Windows Explorer may not be exactly like you expected. For example, when setting 188 a value that includes write access for the group or others scope, this will be 189 mapped to individual permissions "write attributes", "write data" and 190 "append data", but not "write extended attributes". Windows will then show this 191 as basic permission "Special" instead of "Write", because "Write" also covers 192 the "write extended attributes" permission. When setting digit 0 for group or 193 others, to indicate no permissions, they will still get individual permissions 194 "read attributes", "read extended attributes" and "read permissions". This is 195 done for compatibility reasons, e.g. to allow users without additional 196 permissions to be able to read basic metadata about files like in Unix. 197 198 WinFsp 2021 (version 1.9) introduced a new FUSE option "FileSecurity", 199 that allows the complete specification of file security descriptors using 200 [SDDL](https://docs.microsoft.com/en-us/windows/win32/secauthz/security-descriptor-string-format). 201 With this you get detailed control of the resulting permissions, compared 202 to use of the POSIX permissions described above, and no additional permissions 203 will be added automatically for compatibility with Unix. Some example use 204 cases will following. 205 206 If you set POSIX permissions for only allowing access to the owner, 207 using `--file-perms 0600 --dir-perms 0700`, the user group and the built-in 208 "Everyone" group will still be given some special permissions, as described 209 above. Some programs may then (incorrectly) interpret this as the file being 210 accessible by everyone, for example an SSH client may warn about "unprotected 211 private key file". You can work around this by specifying 212 `-o FileSecurity="D:P(A;;FA;;;OW)"`, which sets file all access (FA) to the 213 owner (OW), and nothing else. 214 215 When setting write permissions then, except for the owner, this does not 216 include the "write extended attributes" permission, as mentioned above. 217 This may prevent applications from writing to files, giving permission denied 218 error instead. To set working write permissions for the built-in "Everyone" 219 group, similar to what it gets by default but with the addition of the 220 "write extended attributes", you can specify 221 `-o FileSecurity="D:P(A;;FRFW;;;WD)"`, which sets file read (FR) and file 222 write (FW) to everyone (WD). If file execute (FX) is also needed, then change 223 to `-o FileSecurity="D:P(A;;FRFWFX;;;WD)"`, or set file all access (FA) to 224 get full access permissions, including delete, with 225 `-o FileSecurity="D:P(A;;FA;;;WD)"`. 226 227 ### Windows caveats 228 229 Drives created as Administrator are not visible to other accounts, 230 not even an account that was elevated to Administrator with the 231 User Account Control (UAC) feature. A result of this is that if you mount 232 to a drive letter from a Command Prompt run as Administrator, and then try 233 to access the same drive from Windows Explorer (which does not run as 234 Administrator), you will not be able to see the mounted drive. 235 236 If you don't need to access the drive from applications running with 237 administrative privileges, the easiest way around this is to always 238 create the mount from a non-elevated command prompt. 239 240 To make mapped drives available to the user account that created them 241 regardless if elevated or not, there is a special Windows setting called 242 [linked connections](https://docs.microsoft.com/en-us/troubleshoot/windows-client/networking/mapped-drives-not-available-from-elevated-command#detail-to-configure-the-enablelinkedconnections-registry-entry) 243 that can be enabled. 244 245 It is also possible to make a drive mount available to everyone on the system, 246 by running the process creating it as the built-in SYSTEM account. 247 There are several ways to do this: One is to use the command-line 248 utility [PsExec](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec), 249 from Microsoft's Sysinternals suite, which has option `-s` to start 250 processes as the SYSTEM account. Another alternative is to run the mount 251 command from a Windows Scheduled Task, or a Windows Service, configured 252 to run as the SYSTEM account. A third alternative is to use the 253 [WinFsp.Launcher infrastructure](https://github.com/winfsp/winfsp/wiki/WinFsp-Service-Architecture)). 254 Read more in the [install documentation](https://rclone.org/install/). 255 Note that when running rclone as another user, it will not use 256 the configuration file from your profile unless you tell it to 257 with the [`--config`](https://rclone.org/docs/#config-config-file) option. 258 Note also that it is now the SYSTEM account that will have the owner 259 permissions, and other accounts will have permissions according to the 260 group or others scopes. As mentioned above, these will then not get the 261 "write extended attributes" permission, and this may prevent writing to 262 files. You can work around this with the FileSecurity option, see 263 example above. 264 265 Note that mapping to a directory path, instead of a drive letter, 266 does not suffer from the same limitations. 267 268 ## Mounting on macOS 269 270 Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) 271 (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional 272 FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system 273 which "mounts" via an NFSv4 local server. 274 275 #### Unicode Normalization 276 277 It is highly recommended to keep the default of `--no-unicode-normalization=false` 278 for all `mount` and `serve` commands on macOS. For details, see [vfs-case-sensitivity](https://rclone.org/commands/rclone_mount/#vfs-case-sensitivity). 279 280 ### NFS mount 281 282 This method spins up an NFS server using [serve nfs](/commands/rclone_serve_nfs/) command and mounts 283 it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to 284 send SIGTERM signal to the rclone process using |kill| command to stop the mount. 285 286 Note that `--nfs-cache-handle-limit` controls the maximum number of cached file handles stored by the `nfsmount` caching handler. 287 This should not be set too low or you may experience errors when trying to access files. The default is 1000000, 288 but consider lowering this limit if the server's system resource usage causes problems. 289 290 ### macFUSE Notes 291 292 If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from 293 the website, rclone will locate the macFUSE libraries without any further intervention. 294 If however, macFUSE is installed using the [macports](https://www.macports.org/) package manager, 295 the following addition steps are required. 296 297 sudo mkdir /usr/local/lib 298 cd /usr/local/lib 299 sudo ln -s /opt/local/lib/libfuse.2.dylib 300 301 ### FUSE-T Limitations, Caveats, and Notes 302 303 There are some limitations, caveats, and notes about how it works. These are current as 304 of FUSE-T version 1.0.14. 305 306 #### ModTime update on read 307 308 As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats): 309 310 > File access and modification times cannot be set separately as it seems to be an 311 > issue with the NFS client which always modifies both. Can be reproduced with 312 > 'touch -m' and 'touch -a' commands 313 314 This means that viewing files with various tools, notably macOS Finder, will cause rlcone 315 to update the modification time of the file. This may make rclone upload a full new copy 316 of the file. 317 318 #### Read Only mounts 319 320 When mounting with `--read-only`, attempts to write to files will fail *silently* as 321 opposed to with a clear warning as in macFUSE. 322 323 ## Limitations 324 325 Without the use of `--vfs-cache-mode` this can only write files 326 sequentially, it can only seek when reading. This means that many 327 applications won't work with their files on an rclone mount without 328 `--vfs-cache-mode writes` or `--vfs-cache-mode full`. 329 See the [VFS File Caching](#vfs-file-caching) section for more info. 330 When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| 331 the mount point will be read-only. 332 333 The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) 334 do not support the concept of empty directories, so empty 335 directories will have a tendency to disappear once they fall out of 336 the directory cache. 337 338 When `rclone mount` is invoked on Unix with `--daemon` flag, the main rclone 339 program will wait for the background mount to become ready or until the timeout 340 specified by the `--daemon-wait` flag. On Linux it can check mount status using 341 ProcFS so the flag in fact sets **maximum** time to wait, while the real wait 342 can be less. On macOS / BSD the time to wait is constant and the check is 343 performed only at the end. We advise you to set wait time on macOS reasonably. 344 345 Only supported on Linux, FreeBSD, OS X and Windows at the moment. 346 347 ## rclone mount vs rclone sync/copy 348 349 File systems expect things to be 100% reliable, whereas cloud storage 350 systems are a long way from 100% reliable. The rclone sync/copy 351 commands cope with this with lots of retries. However rclone mount 352 can't use retries in the same way without making local copies of the 353 uploads. Look at the [VFS File Caching](#vfs-file-caching) 354 for solutions to make mount more reliable. 355 356 ## Attribute caching 357 358 You can use the flag `--attr-timeout` to set the time the kernel caches 359 the attributes (size, modification time, etc.) for directory entries. 360 361 The default is `1s` which caches files just long enough to avoid 362 too many callbacks to rclone from the kernel. 363 364 In theory 0s should be the correct value for filesystems which can 365 change outside the control of the kernel. However this causes quite a 366 few problems such as 367 [rclone using too much memory](https://github.com/artpar/artpar/issues/2157), 368 [rclone not serving files to samba](https://forum.rclone.org/t/rclone-1-39-vs-1-40-mount-issue/5112) 369 and [excessive time listing directories](https://github.com/artpar/artpar/issues/2095#issuecomment-371141147). 370 371 The kernel can cache the info about a file for the time given by 372 `--attr-timeout`. You may see corruption if the remote file changes 373 length during this window. It will show up as either a truncated file 374 or a file with garbage on the end. With `--attr-timeout 1s` this is 375 very unlikely but not impossible. The higher you set `--attr-timeout` 376 the more likely it is. The default setting of "1s" is the lowest 377 setting which mitigates the problems above. 378 379 If you set it higher (`10s` or `1m` say) then the kernel will call 380 back to rclone less often making it more efficient, however there is 381 more chance of the corruption issue above. 382 383 If files don't change on the remote outside of the control of rclone 384 then there is no chance of corruption. 385 386 This is the same as setting the attr_timeout option in mount.fuse. 387 388 ## Filters 389 390 Note that all the rclone filters can be used to select a subset of the 391 files to be visible in the mount. 392 393 ## systemd 394 395 When running rclone mount as a systemd service, it is possible 396 to use Type=notify. In this case the service will enter the started state 397 after the mountpoint has been successfully set up. 398 Units having the rclone mount service specified as a requirement 399 will see all files and folders immediately in this mode. 400 401 Note that systemd runs mount units without any environment variables including 402 `PATH` or `HOME`. This means that tilde (`~`) expansion will not work 403 and you should provide `--config` and `--cache-dir` explicitly as absolute 404 paths via rclone arguments. 405 Since mounting requires the `fusermount` program, rclone will use the fallback 406 PATH of `/bin:/usr/bin` in this scenario. Please ensure that `fusermount` 407 is present on this PATH. 408 409 ## Rclone as Unix mount helper 410 411 The core Unix program `/bin/mount` normally takes the `-t FSTYPE` argument 412 then runs the `/sbin/mount.FSTYPE` helper program passing it mount options 413 as `-o key=val,...` or `--opt=...`. Automount (classic or systemd) behaves 414 in a similar way. 415 416 rclone by default expects GNU-style flags `--key val`. To run it as a mount 417 helper you should symlink rclone binary to `/sbin/mount.rclone` and optionally 418 `/usr/bin/rclonefs`, e.g. `ln -s /usr/bin/rclone /sbin/mount.rclone`. 419 rclone will detect it and translate command-line arguments appropriately. 420 421 Now you can run classic mounts like this: 422 ``` 423 mount sftp1:subdir /mnt/data -t rclone -o vfs_cache_mode=writes,sftp_key_file=/path/to/pem 424 ``` 425 426 or create systemd mount units: 427 ``` 428 # /etc/systemd/system/mnt-data.mount 429 [Unit] 430 Description=Mount for /mnt/data 431 [Mount] 432 Type=rclone 433 What=sftp1:subdir 434 Where=/mnt/data 435 Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone 436 ``` 437 438 optionally accompanied by systemd automount unit 439 ``` 440 # /etc/systemd/system/mnt-data.automount 441 [Unit] 442 Description=AutoMount for /mnt/data 443 [Automount] 444 Where=/mnt/data 445 TimeoutIdleSec=600 446 [Install] 447 WantedBy=multi-user.target 448 ``` 449 450 or add in `/etc/fstab` a line like 451 ``` 452 sftp1:subdir /mnt/data rclone rw,noauto,nofail,_netdev,x-systemd.automount,args2env,vfs_cache_mode=writes,config=/etc/rclone.conf,cache_dir=/var/cache/rclone 0 0 453 ``` 454 455 or use classic Automountd. 456 Remember to provide explicit `config=...,cache-dir=...` as a workaround for 457 mount units being run without `HOME`. 458 459 Rclone in the mount helper mode will split `-o` argument(s) by comma, replace `_` 460 by `-` and prepend `--` to get the command-line flags. Options containing commas 461 or spaces can be wrapped in single or double quotes. Any inner quotes inside outer 462 quotes of the same type should be doubled. 463 464 Mount option syntax includes a few extra options treated specially: 465 466 - `env.NAME=VALUE` will set an environment variable for the mount process. 467 This helps with Automountd and Systemd.mount which don't allow setting 468 custom environment for mount helpers. 469 Typically you will use `env.HTTPS_PROXY=proxy.host:3128` or `env.HOME=/root` 470 - `command=cmount` can be used to run `cmount` or any other rclone command 471 rather than the default `mount`. 472 - `args2env` will pass mount options to the mount helper running in background 473 via environment variables instead of command line arguments. This allows to 474 hide secrets from such commands as `ps` or `pgrep`. 475 - `vv...` will be transformed into appropriate `--verbose=N` 476 - standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike 477 are intended only for Automountd and ignored by rclone. 478 479 ## VFS - Virtual File System 480 481 This command uses the VFS layer. This adapts the cloud storage objects 482 that rclone uses into something which looks much more like a disk 483 filing system. 484 485 Cloud storage objects have lots of properties which aren't like disk 486 files - you can't extend them or write to the middle of them, so the 487 VFS layer has to deal with that. Because there is no one right way of 488 doing this there are various options explained below. 489 490 The VFS layer also implements a directory cache - this caches info 491 about files and directories (but not the data) in memory. 492 493 ## VFS Directory Cache 494 495 Using the `--dir-cache-time` flag, you can control how long a 496 directory should be considered up to date and not refreshed from the 497 backend. Changes made through the VFS will appear immediately or 498 invalidate the cache. 499 500 --dir-cache-time duration Time to cache directory entries for (default 5m0s) 501 --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) 502 503 However, changes made directly on the cloud storage by the web 504 interface or a different copy of rclone will only be picked up once 505 the directory cache expires if the backend configured does not support 506 polling for changes. If the backend supports polling, changes will be 507 picked up within the polling interval. 508 509 You can send a `SIGHUP` signal to rclone for it to flush all 510 directory caches, regardless of how old they are. Assuming only one 511 rclone instance is running, you can reset the cache like this: 512 513 kill -SIGHUP $(pidof rclone) 514 515 If you configure rclone with a [remote control](/rc) then you can use 516 rclone rc to flush the whole directory cache: 517 518 rclone rc vfs/forget 519 520 Or individual files or directories: 521 522 rclone rc vfs/forget file=path/to/file dir=path/to/dir 523 524 ## VFS File Buffering 525 526 The `--buffer-size` flag determines the amount of memory, 527 that will be used to buffer data in advance. 528 529 Each open file will try to keep the specified amount of data in memory 530 at all times. The buffered data is bound to one open file and won't be 531 shared. 532 533 This flag is a upper limit for the used memory per open file. The 534 buffer will only use memory for data that is downloaded but not not 535 yet read. If the buffer is empty, only a small amount of memory will 536 be used. 537 538 The maximum memory used by rclone for buffering can be up to 539 `--buffer-size * open files`. 540 541 ## VFS File Caching 542 543 These flags control the VFS file caching options. File caching is 544 necessary to make the VFS layer appear compatible with a normal file 545 system. It can be disabled at the cost of some compatibility. 546 547 For example you'll need to enable VFS caching if you want to read and 548 write simultaneously to a file. See below for more details. 549 550 Note that the VFS cache is separate from the cache backend and you may 551 find that you need one or the other or both. 552 553 --cache-dir string Directory rclone will use for caching. 554 --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) 555 --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) 556 --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) 557 --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) 558 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) 559 --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) 560 561 If run with `-vv` rclone will print the location of the file cache. The 562 files are stored in the user cache file area which is OS dependent but 563 can be controlled with `--cache-dir` or setting the appropriate 564 environment variable. 565 566 The cache has 4 different modes selected by `--vfs-cache-mode`. 567 The higher the cache mode the more compatible rclone becomes at the 568 cost of using disk space. 569 570 Note that files are written back to the remote only when they are 571 closed and if they haven't been accessed for `--vfs-write-back` 572 seconds. If rclone is quit or dies with files that haven't been 573 uploaded, these will be uploaded next time rclone is run with the same 574 flags. 575 576 If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note 577 that the cache may exceed these quotas for two reasons. Firstly 578 because it is only checked every `--vfs-cache-poll-interval`. Secondly 579 because open files cannot be evicted from the cache. When 580 `--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, 581 rclone will attempt to evict the least accessed files from the cache 582 first. rclone will start with files that haven't been accessed for the 583 longest. This cache flushing strategy is efficient and more relevant 584 files are likely to remain cached. 585 586 The `--vfs-cache-max-age` will evict files from the cache 587 after the set time since last access has passed. The default value of 588 1 hour will start evicting files from cache that haven't been accessed 589 for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 590 and will wait for 1 more hour before evicting. Specify the time with 591 standard notation, s, m, h, d, w . 592 593 You **should not** run two copies of rclone using the same VFS cache 594 with the same or overlapping remotes if using `--vfs-cache-mode > off`. 595 This can potentially cause data corruption if you do. You can work 596 around this by giving each rclone its own cache hierarchy with 597 `--cache-dir`. You don't need to worry about this if the remotes in 598 use don't overlap. 599 600 ### --vfs-cache-mode off 601 602 In this mode (the default) the cache will read directly from the remote and write 603 directly to the remote without caching anything on disk. 604 605 This will mean some operations are not possible 606 607 * Files can't be opened for both read AND write 608 * Files opened for write can't be seeked 609 * Existing files opened for write must have O_TRUNC set 610 * Files open for read with O_TRUNC will be opened write only 611 * Files open for write only will behave as if O_TRUNC was supplied 612 * Open modes O_APPEND, O_TRUNC are ignored 613 * If an upload fails it can't be retried 614 615 ### --vfs-cache-mode minimal 616 617 This is very similar to "off" except that files opened for read AND 618 write will be buffered to disk. This means that files opened for 619 write will be a lot more compatible, but uses the minimal disk space. 620 621 These operations are not possible 622 623 * Files opened for write only can't be seeked 624 * Existing files opened for write must have O_TRUNC set 625 * Files opened for write only will ignore O_APPEND, O_TRUNC 626 * If an upload fails it can't be retried 627 628 ### --vfs-cache-mode writes 629 630 In this mode files opened for read only are still read directly from 631 the remote, write only and read/write files are buffered to disk 632 first. 633 634 This mode should support all normal file system operations. 635 636 If an upload fails it will be retried at exponentially increasing 637 intervals up to 1 minute. 638 639 ### --vfs-cache-mode full 640 641 In this mode all reads and writes are buffered to and from disk. When 642 data is read from the remote this is buffered to disk as well. 643 644 In this mode the files in the cache will be sparse files and rclone 645 will keep track of which bits of the files it has downloaded. 646 647 So if an application only reads the starts of each file, then rclone 648 will only buffer the start of the file. These files will appear to be 649 their full size in the cache, but they will be sparse files with only 650 the data that has been downloaded present in them. 651 652 This mode should support all normal file system operations and is 653 otherwise identical to `--vfs-cache-mode` writes. 654 655 When reading a file rclone will read `--buffer-size` plus 656 `--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory 657 whereas the `--vfs-read-ahead` is buffered on disk. 658 659 When using this mode it is recommended that `--buffer-size` is not set 660 too large and `--vfs-read-ahead` is set large if required. 661 662 **IMPORTANT** not all file systems support sparse files. In particular 663 FAT/exFAT do not. Rclone will perform very badly if the cache 664 directory is on a filesystem which doesn't support sparse files and it 665 will log an ERROR message if one is detected. 666 667 ### Fingerprinting 668 669 Various parts of the VFS use fingerprinting to see if a local file 670 copy has changed relative to a remote file. Fingerprints are made 671 from: 672 673 - size 674 - modification time 675 - hash 676 677 where available on an object. 678 679 On some backends some of these attributes are slow to read (they take 680 an extra API call per object, or extra work per object). 681 682 For example `hash` is slow with the `local` and `sftp` backends as 683 they have to read the entire file and hash it, and `modtime` is slow 684 with the `s3`, `swift`, `ftp` and `qinqstor` backends because they 685 need to do an extra API call to fetch it. 686 687 If you use the `--vfs-fast-fingerprint` flag then rclone will not 688 include the slow operations in the fingerprint. This makes the 689 fingerprinting less accurate but much faster and will improve the 690 opening time of cached files. 691 692 If you are running a vfs cache over `local`, `s3` or `swift` backends 693 then using this flag is recommended. 694 695 Note that if you change the value of this flag, the fingerprints of 696 the files in the cache may be invalidated and the files will need to 697 be downloaded again. 698 699 ## VFS Chunked Reading 700 701 When rclone reads files from a remote it reads them in chunks. This 702 means that rather than requesting the whole file rclone reads the 703 chunk specified. This can reduce the used download quota for some 704 remotes by requesting only chunks from the remote that are actually 705 read, at the cost of an increased number of requests. 706 707 These flags control the chunking: 708 709 --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) 710 --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) 711 712 Rclone will start reading a chunk of size `--vfs-read-chunk-size`, 713 and then double the size for each read. When `--vfs-read-chunk-size-limit` is 714 specified, and greater than `--vfs-read-chunk-size`, the chunk size for each 715 open file will get doubled only until the specified value is reached. If the 716 value is "off", which is the default, the limit is disabled and the chunk size 717 will grow indefinitely. 718 719 With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` 720 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. 721 When `--vfs-read-chunk-size-limit 500M` is specified, the result would be 722 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. 723 724 Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. 725 726 ## VFS Performance 727 728 These flags may be used to enable/disable features of the VFS for 729 performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) 730 feature. 731 732 In particular S3 and Swift benefit hugely from the `--no-modtime` flag 733 (or use `--use-server-modtime` for a slightly different effect) as each 734 read of the modification time takes a transaction. 735 736 --no-checksum Don't compare checksums on up/download. 737 --no-modtime Don't read/write the modification time (can speed things up). 738 --no-seek Don't allow seeking in files. 739 --read-only Only allow read-only access. 740 741 Sometimes rclone is delivered reads or writes out of order. Rather 742 than seeking rclone will wait a short time for the in sequence read or 743 write to come in. These flags only come into effect when not using an 744 on disk cache file. 745 746 --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) 747 --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) 748 749 When using VFS write caching (`--vfs-cache-mode` with value writes or full), 750 the global flag `--transfers` can be set to adjust the number of parallel uploads of 751 modified files from the cache (the related global flag `--checkers` has no effect on the VFS). 752 753 --transfers int Number of file transfers to run in parallel (default 4) 754 755 ## VFS Case Sensitivity 756 757 Linux file systems are case-sensitive: two files can differ only 758 by case, and the exact case must be used when opening a file. 759 760 File systems in modern Windows are case-insensitive but case-preserving: 761 although existing files can be opened using any case, the exact case used 762 to create the file is preserved and available for programs to query. 763 It is not allowed for two files in the same directory to differ only by case. 764 765 Usually file systems on macOS are case-insensitive. It is possible to make macOS 766 file systems case-sensitive but that is not the default. 767 768 The `--vfs-case-insensitive` VFS flag controls how rclone handles these 769 two cases. If its value is "false", rclone passes file names to the remote 770 as-is. If the flag is "true" (or appears without a value on the 771 command line), rclone may perform a "fixup" as explained below. 772 773 The user may specify a file name to open/delete/rename/etc with a case 774 different than what is stored on the remote. If an argument refers 775 to an existing file with exactly the same name, then the case of the existing 776 file on the disk will be used. However, if a file name with exactly the same 777 name is not found but a name differing only by case exists, rclone will 778 transparently fixup the name. This fixup happens only when an existing file 779 is requested. Case sensitivity of file names created anew by rclone is 780 controlled by the underlying remote. 781 782 Note that case sensitivity of the operating system running rclone (the target) 783 may differ from case sensitivity of a file system presented by rclone (the source). 784 The flag controls whether "fixup" is performed to satisfy the target. 785 786 If the flag is not provided on the command line, then its default value depends 787 on the operating system where rclone runs: "true" on Windows and macOS, "false" 788 otherwise. If the flag is provided without a value, then it is "true". 789 790 The `--no-unicode-normalization` flag controls whether a similar "fixup" is 791 performed for filenames that differ but are [canonically 792 equivalent](https://en.wikipedia.org/wiki/Unicode_equivalence) with respect to 793 unicode. Unicode normalization can be particularly helpful for users of macOS, 794 which prefers form NFD instead of the NFC used by most other platforms. It is 795 therefore highly recommended to keep the default of `false` on macOS, to avoid 796 encoding compatibility issues. 797 798 In the (probably unlikely) event that a directory has multiple duplicate 799 filenames after applying case and unicode normalization, the `--vfs-block-norm-dupes` 800 flag allows hiding these duplicates. This comes with a performance tradeoff, as 801 rclone will have to scan the entire directory for duplicates when listing a 802 directory. For this reason, it is recommended to leave this disabled if not 803 needed. However, macOS users may wish to consider using it, as otherwise, if a 804 remote directory contains both NFC and NFD versions of the same filename, an odd 805 situation will occur: both versions of the file will be visible in the mount, 806 and both will appear to be editable, however, editing either version will 807 actually result in only the NFD version getting edited under the hood. `--vfs-block- 808 norm-dupes` prevents this confusion by detecting this scenario, hiding the 809 duplicates, and logging an error, similar to how this is handled in `rclone 810 sync`. 811 812 ## VFS Disk Options 813 814 This flag allows you to manually set the statistics about the filing system. 815 It can be useful when those statistics cannot be read correctly automatically. 816 817 --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) 818 819 ## Alternate report of used bytes 820 821 Some backends, most notably S3, do not report the amount of bytes used. 822 If you need this information to be available when running `df` on the 823 filesystem, then pass the flag `--vfs-used-is-size` to rclone. 824 With this flag set, instead of relying on the backend to report this 825 information, rclone will scan the whole remote similar to `rclone size` 826 and compute the total used space itself. 827 828 _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the 829 result is accurate. However, this is very inefficient and may cost lots of API 830 calls resulting in extra charges. Use it as a last resort and only with caching. 831 832 833 ``` 834 rclone mount remote:path /path/to/mountpoint [flags] 835 ``` 836 837 ## Options 838 839 ``` 840 --allow-non-empty Allow mounting over a non-empty directory (not supported on Windows) 841 --allow-other Allow access to other users (not supported on Windows) 842 --allow-root Allow access to root user (not supported on Windows) 843 --async-read Use asynchronous reads (not supported on Windows) (default true) 844 --attr-timeout Duration Time for which file/directory attributes are cached (default 1s) 845 --daemon Run mount in background and exit parent process (as background output is suppressed, use --log-file with --log-format=pid,... to monitor) (not supported on Windows) 846 --daemon-timeout Duration Time limit for rclone to respond to kernel (not supported on Windows) (default 0s) 847 --daemon-wait Duration Time to wait for ready mount from daemon (maximum time on Linux, constant sleep time on OSX/BSD) (not supported on Windows) (default 1m0s) 848 --debug-fuse Debug the FUSE internals - needs -v 849 --default-permissions Makes kernel enforce access control based on the file mode (not supported on Windows) 850 --devname string Set the device name - default is remote:path 851 --dir-cache-time Duration Time to cache directory entries for (default 5m0s) 852 --dir-perms FileMode Directory permissions (default 0777) 853 --file-perms FileMode File permissions (default 0666) 854 --fuse-flag stringArray Flags or arguments to be passed direct to libfuse/WinFsp (repeat if required) 855 --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) 856 -h, --help help for mount 857 --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) 858 --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) 859 --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) 860 --no-checksum Don't compare checksums on up/download 861 --no-modtime Don't read/write the modification time (can speed things up) 862 --no-seek Don't allow seeking in files 863 --noappledouble Ignore Apple Double (._) and .DS_Store files (supported on OSX only) (default true) 864 --noapplexattr Ignore all "com.apple.*" extended attributes (supported on OSX only) 865 -o, --option stringArray Option for libfuse/WinFsp (repeat if required) 866 --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) 867 --read-only Only allow read-only access 868 --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) 869 --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) 870 --vfs-block-norm-dupes If duplicate filenames exist in the same directory (after normalization), log an error and hide the duplicates (may have a performance cost) 871 --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) 872 --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) 873 --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) 874 --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) 875 --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) 876 --vfs-case-insensitive If a file name not found, find a case insensitive match 877 --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) 878 --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection 879 --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full 880 --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) 881 --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) 882 --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) 883 --vfs-refresh Refreshes the directory cache recursively in the background on start 884 --vfs-used-is-size rclone size Use the rclone size algorithm for Used size 885 --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) 886 --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) 887 --volname string Set the volume name (supported on Windows and OSX only) 888 --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) 889 ``` 890 891 892 ## Filter Options 893 894 Flags for filtering directory listings. 895 896 ``` 897 --delete-excluded Delete files on dest excluded from sync 898 --exclude stringArray Exclude files matching pattern 899 --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) 900 --exclude-if-present stringArray Exclude directories if filename is present 901 --files-from stringArray Read list of source-file names from file (use - to read from stdin) 902 --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) 903 -f, --filter stringArray Add a file filtering rule 904 --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) 905 --ignore-case Ignore case in filters (case insensitive) 906 --include stringArray Include files matching pattern 907 --include-from stringArray Read file include patterns from file (use - to read from stdin) 908 --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) 909 --max-depth int If set limits the recursion depth to this (default -1) 910 --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) 911 --metadata-exclude stringArray Exclude metadatas matching pattern 912 --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) 913 --metadata-filter stringArray Add a metadata filtering rule 914 --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) 915 --metadata-include stringArray Include metadatas matching pattern 916 --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) 917 --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) 918 --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) 919 ``` 920 921 See the [global flags page](/flags/) for global options not listed here. 922 923 # SEE ALSO 924 925 * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. 926