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