[feature] Add automatic cascade mounting for filesystems #52

Open
opened 2024-11-01 17:34:41 +00:00 by glenux · 0 comments
Owner

Description

This feature request proposes adding support for automatic cascade mounting in MFM. This enhancement would enable MFM to identify and manage filesystem dependencies based on path hierarchy, removing the need for manually configured dependencies.

Use Case Example:

  • A gocryptfs encrypted filesystem needs to be mounted at /mnt/toto/whatever/vault.
  • The directory /mnt/toto/whatever is itself a mount point for another filesystem, such as sshfs.
  • MFM should detect that /mnt/toto/whatever is a required prefix for /mnt/toto/whatever/vault, and thus mount sshfs first to ensure the directory structure is available before attempting the gocryptfs mount.

Steps to Reproduce

  1. Configure MFM with a gocryptfs mount nested within an existing sshfs mount path.
  2. Attempt to mount the gocryptfs filesystem without manually mounting sshfs.
  3. Observe that the gocryptfs mount fails if sshfs is not mounted first.

Expected Behavior

MFM should:

  1. Automatically detect that /mnt/toto/whatever is a required prefix for /mnt/toto/whatever/vault.
  2. Mount sshfs to make /mnt/toto/whatever available.
  3. Proceed with mounting gocryptfs once the dependency is resolved.

Actual Behavior

Currently, MFM does not handle path-based dependencies. Mounting a dependent filesystem like gocryptfs fails if the parent mount (sshfs) is not manually mounted beforehand.

Proposed Solution / Implementation

  1. Path-Based Dependency Detection:

    • Modify MFM to detect dependencies by checking if any configured mount path serves as a prefix for another. For instance, if /mnt/toto/whatever is configured and used as a prefix in /mnt/toto/whatever/vault, MFM should automatically recognize the dependency.
  2. Automatic Mount Sequencing:

    • Implement logic to mount filesystems in the correct sequence, ensuring that parent paths are operational before their dependent paths.
    • Handle unmounting in reverse order to ensure dependent filesystems are unmounted before their parent mounts.
  3. Error Handling and Logging:

    • Add clear error messages and logs to indicate missing dependencies or mount failures for better diagnosability.
## Description This feature request proposes adding support for automatic cascade mounting in MFM. This enhancement would enable MFM to identify and manage filesystem dependencies based on path hierarchy, removing the need for manually configured dependencies. ## Use Case Example: - A `gocryptfs` encrypted filesystem needs to be mounted at `/mnt/toto/whatever/vault`. - The directory `/mnt/toto/whatever` is itself a mount point for another filesystem, such as `sshfs`. - MFM should detect that `/mnt/toto/whatever` is a required prefix for `/mnt/toto/whatever/vault`, and thus mount `sshfs` first to ensure the directory structure is available before attempting the `gocryptfs` mount. ## Steps to Reproduce 1. Configure MFM with a `gocryptfs` mount nested within an existing `sshfs` mount path. 2. Attempt to mount the `gocryptfs` filesystem without manually mounting `sshfs`. 3. Observe that the `gocryptfs` mount fails if `sshfs` is not mounted first. ## Expected Behavior MFM should: 1. Automatically detect that `/mnt/toto/whatever` is a required prefix for `/mnt/toto/whatever/vault`. 2. Mount `sshfs` to make `/mnt/toto/whatever` available. 3. Proceed with mounting `gocryptfs` once the dependency is resolved. ## Actual Behavior Currently, MFM does not handle path-based dependencies. Mounting a dependent filesystem like `gocryptfs` fails if the parent mount (`sshfs`) is not manually mounted beforehand. ## Proposed Solution / Implementation 1. Path-Based Dependency Detection: - Modify MFM to detect dependencies by checking if any configured mount path serves as a prefix for another. For instance, if `/mnt/toto/whatever` is configured and used as a prefix in `/mnt/toto/whatever/vault`, MFM should automatically recognize the dependency. 2. Automatic Mount Sequencing: - Implement logic to mount filesystems in the correct sequence, ensuring that parent paths are operational before their dependent paths. - Handle unmounting in reverse order to ensure dependent filesystems are unmounted before their parent mounts. 3. Error Handling and Logging: - Add clear error messages and logs to indicate missing dependencies or mount failures for better diagnosability.
glenux added the
Kind/Feature
label 2024-11-01 17:38:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: glenux/mfm#52
No description provided.