2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-22 01:47:24 +00:00

Merge branch 'task/CMD-618_FUSE_user_guide' into 'release/v2.1.0'

CMD-618. FUSE user guide [to release/v2.1.0]

See merge request apps/MEGAcmd!892
This commit is contained in:
Pablo M 2025-03-25 03:46:35 +13:00
commit f5cfdb2b3f
2 changed files with 101 additions and 3 deletions

View File

@ -46,8 +46,9 @@ We are also building it for some NAS systems, please check your provider's App S
The major features are
* Move files around inside your MEGA account or between MEGA and your PC using command line tools.
* Use those same commands in scripts to manage your files.
* Set up synchronization or a backup schedule between a folder on your machine, and a folder on your MEGA account. (use the [`sync`](#sync) or [`backup`](#backup) commands)
* Set up WebDAV access to files in your MEGA account (use the [`webdav`](#webdav) command)
* Set up synchronization or a backup schedule between a folder on your machine, and a folder on your MEGA account. (use the [`sync`](#sync) or [`backup`](#backup) commands).
* Set up WebDAV access to files in your MEGA account (use the [`webdav`](#webdav) command).
* [Linux only] Set up a FUSE mount point to seamlessly access files in your MEGA account (use the [`fuse-add`](#fuse-add) command).
See our Help Centre pages for the basics of getting started, and friendly examples of common usages with plenty of pictures: https://mega.nz/help
@ -114,7 +115,12 @@ For further information on backups, please see the [`backup`](#backup) command a
### WebDAV configurations
MEGAcmd can set up access to folders or files in your MEGA account as if they were local folders and files on your device using the [`webdav`](#webdav) command. For example making the folder appear like a local drive on your PC, or providing a hyperlink a browser can access, where the hyperlink is to your PC.
For further information on WebDAV, please see the [`webdav`](#webdav) command and the [tutorial](contrib/docs/WEBDAV.md).
For further information on WebDAV, please see the [`webdav`](#webdav) command and the [tutorial](contrib/docs/WEBDAV.md
### FUSE mount point
If you use Linux, MEGAcmd can set up access to folders or files in your MEGA account as if they were local folders and files on your device using Filesystem in User Space via [`fuse-add`](#fuse-add) command.
For further information on FUSE, please see the [`fuse-add`](#fuse-add) command and the [tutorial](contrib/docs/FUSE.md).
### Linux
On Linux, MEGAcmd commands are installed at /usr/bin and so will already be on your PATH. The interactive shell is `mega-cmd` and the background server is `mega-cmd-server`, which will be automatically started on demand. The various scriptable commands are installed at the same location, and invoke `mega-exec` to send the command to `mega-cmd-server`.

92
contrib/docs/FUSE.md Normal file
View File

@ -0,0 +1,92 @@
# MEGA-FUSE — Serve your files as a "Filesystem in Userspace" (FUSE) with MEGAcmd
This is a brief tutorial on how to configure and manage [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) with MEGAcmd.
Configuring a FUSE mount will let you access your MEGA files as if they were located in your computer. After enabling a FUSE mount, you can use your favourite tools to browse, play, and edit your MEGA files.
Note: this functionality is in beta, and only supported on Linux.
## Local cache
MEGAcmd will use a cache to place files while working with mount points. This cache will be used to store both files downloaded from MEGA, and files being uploaded to MEGA. It will be created automatically in `$HOME/.megaCmd/fuse-cache`.
Bear in mind that this cache is fundamental to be able to work with FUSE mounts. Cache files are removed automatically. Restarting the MEGAcmd Server may help reduce the space used by the cache.
### Important caveats
Files and folders created locally may not be immediately available in your MEGA cloud: the mount engine will transfer them transparently in the background. Note that the MEGAcmd Server needs to be running in order for these actions to complete.
## Streaming
Currently, streaming is not directly supported. In order to open files in a FUSE mount point, they need to be downloaded completely to the local cache folder. You will need space in your hard drive to accomodate for these files.
## Usage
### Creating a new mount
You can create a new FUSE mount with:
```
$ fuse-add /local/path/to/fuse/mountpoint /cloud/dir
```
After creating the mount, MEGAcmd will try to enable it; if it fails, the mount will remain disabled. See [`fuse-add`](commands/fuse-add.md) for all the possible options and arguments.
The mount will have an associated name that we can use to refer to it when managing it. The name must be unique. A custom name can be chosen on creation with the `--name=custom_name` argument. We might also refer to a mount by its local path, but this is not necessarily unique: if multiple mounts share the same local path, we *must* use the name so we can distinguish between them.
### Displaying mounts
The list of existing mounts can be displayed with:
```
$ fuse-show
NAME LOCAL_PATH REMOTE_PATH PERSISTENT ENABLED
dir /local/path/to/fuse/mountpoint /cloud/dir YES YES
```
Use `fuse-show <NAME|LOCAL_PATH>` to get further details on a specific mount. See [`fuse-show`](commands/fuse-show.md) for the list of all possible options and arguments.
### Enabling/disabling mounts
To make your cloud files available in your local filesystem, the mount must be enabled. We can do so with:
```
$ fuse-enable <NAME|LOCAL_PATH>
```
Note: mounts are enabled when created by default (unless `--disabled` is used).
Similarly, we can stop exposing our cloud files locally with:
```
$ fuse-disable <NAME|LOCAL_PATH>
```
Note: disabled mounts still exist and are shown in `fuse-show`. See [`fuse-enable`](commands/fuse-enable.md) and [`fuse-disable`](commands/fuse-disable.md) for more information on these commands.
### Adjusting configuration
As we've mentioned before, the full details of a mount can be displayed with:
```
$ fuse-show dir
Showing details of mount "dir"
Local path: /local/path/to/fuse/mountpoint
Remote path: /cloud/dir
Name: dir
Persistent: YES
Enabled: YES
Enable at startup: YES
Read-only: NO
```
To configure these flags, we can use the [`fuse-config`](commands/fuse-config.md) command. For example, to make the mount read-only, we would do:
```
$ fuse-config --read-only=yes dir
Mount "dir" now has the following flags
Name: dir
Enable at startup: YES
Persistent: YES
Read-only: YES
```
### Removing mounts
A mount can be removed with:
```
$ fuse-remove <NAME|LOCAL_PATH>
```
Note: mounts must be disabled before they can be removed.
## Issues
Occasionally, you may encounter issues in FUSE mounts that cannot be directly resolved within MEGAcmd (for example, if the MEGAcmd server was closed abruptly). The most common one is: "Error: cannot access '/local/path/to/fuse/mountpoint': Transport endpoint is not connected". To fix them you might need to use the `fusermount` command like so:
```
fusermount -u /local/path/to/fuse/mountpoint
```
Adding `-z` may help if the above fails. See the [fusermount man page](https://www.man7.org/linux/man-pages/man1/fusermount3.1.html).