Object Mount FlexMount
This article dives into the configuration and use of Object Mount FlexMount for Linux.
Overview
Object Mount FlexMount combines the wide compatibility and support for Linux Apps via FUSE (including SUID binaries, Snap, AppImage and FlatPak applications) plus all the speed & benefits of Direct Interception Mode whenever possible.
With Object Mount in FlexMount Mode, Object Mount will recognize that the mount path is an Object Storage mount and use Direct Interception Mode whenever possible for the fastest access. Object Mount will fall back to using Object Mount on FUSE for anything that cannot be directly intercepted. THis provides both the best performance and the broadest compatibility.
Object Mount’s FlexMount benefits are leveraged by:
- Configuring Object Mount on FUSE, and
- Accessing your cloud storage via the Object Mount CLI by specifying your mount path via the
--flexparameter.
Advantages
Speed: Where possible, Object Mount in FlexMount Mode will operate as fast as possible, using Direct Interception Mode.
Compatibility: Support for all POSIX applications: Anything that cannot be directly intercepted will pass through and be handled by Object Mount on FUSE.
Disadvantages
Set up time: Object Mount on FUSE needs to be configured.
Shell launch is more complicated: Each time an Object Mount shell is launched it must be configured to use the mount. This can be worked around by setting up a Object Mount on FUSE on boot, and setting an alias to launch a Object Mount shell with the correct parameters.
How to Enable
FlexMount is set up as follows:
First, set up a mount using Object Mount on FUSE:
Always use the Object Mount CLI to interact with your object storage.
Every time the Object Mount CLI is launched, use the
--flex <full_path_to_mount>parameter.For example:
Then reference your mount using the mount’s path:
FlexMount Tilde (~) Use
You cannot use a tilde ~ in your CUNO_OPTIONS or cuno -o CLI options when setting up a FlexMount, as this is something that the shell needs to resolve.
You may still use it for your cuno mount commands, and subsequent FlexMount operations (such as ls ~/my-object-storage).
The same FlexMount can be re-used across multiple Object Mount-wrapped shells.
The --flex option can also be used with cuno run to run a single command or script with Object Mount enabled.
For example:
FlexMount Interception Details
The --flex option is synonymous with the -o cloudrootover=exact -o cloudroot="<mount point>" option, which is used to tell Object Mount to intercept paths that exactly match the cloudroot setting, and to handle them using Object Mount on FUSE.
When using Object Mount Direct Interception in FlexMount Mode, most “local” paths are intercepted but not acted upon as they are handled by the local file system.
The cloudrootover setting tells Object Mount to intercept local paths that match the cloudroot setting, and to prioritize itself handling them via the mount. This means that whenever a path is recognized as the cloudroot, it will be more efficiently handled in user-space by the Direct Interception/LD_PRELOAD library.
That path recognition can be done in two ways:
Exact String Matching: (
exact) This method will match thecloudrootsetting exactly. This is faster, and will end up relying on the FUSE mount whenever the paths don’t match thecloudroot— for example with symbolic links located outside the mount pointing into the mount.Exact String Matching is the default method. No additional configuration is needed to enable.
Resolved Path Matching: (
resolve) This method will resolve the full path given in a file system call, including symbolic links, to check if the file is ultimately located inside the mount point.This requires more calls for every path-based file system call, so is slower when many files are being accessed. It is useful when symbolic links are pointed to the mount, and other cases where the path ultimately is inside the mount.
This can be more efficient in some special cases (few files, large transfers, complex relationships between files) as
cuno.sowill intercept more calls without requiring them to go through the slower FUSE mount.To use Resolved Path Matching Mode, use the parameters
-o cloudrootover=resolve -o cloudroot="<full path to mount point>".For example: