Skip to content

Feature: Use an overlayfs for the Server data directory #201

@a-usr

Description

@a-usr

Preamble

Overlay Filesystems are a type of filesystem mount, which overlay two directories lowerdir and upperdir on top of each other into mountTarget.
Changes to the contents of files below mountTarget are written into upperdir, with lowerdir being completely unaffected (ergo, lowerdir can be located on a read-only filesystem).

There are some constraints:
Overlay Filesystems require a workdir, which has to be located on the same filesystem as upperdir, a filesystem which has to support extended attributes. This is required to support whiteout files (files or directories which hide a file or directory that is in fact present in lowerdir). For further information the linux kernel documentation may be consulted

Subject

I would like to propose the usage of an overlay type mount for the server directory, with lowerdir being a built nix store path. This would facilitate multiple things, such as managing default configurations from within the nix configuration without inhibiting the server from modifying them later.

Additionally, issues like in #191 would not be a problem with this feature.

Implementation

Functionality for this would need to be opt-in, as to not break compatibility with existing servers, and to avoid filesystem incompatibility issues.

I imagine something like an overlayfs options set, with options to enable the feature and to control the location of both upperdir and workdir non-individually, with a default being /srv/minecraft/.overlayfs/<servername>/alternatively, an attrs option persistentFiles could be Implemented next to symlinks, with non-emptyness being a signal to enable the overlayfs , though I would advocate for the former suggestion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions