A file system Composefs has been proposed for Linux.

Alexander Larsson, the creator of Flatpak working at Red Hat, has introduced a preliminary set of patches implementing the Composefs file system for the Linux kernel. The proposed file system is similar to Squashfs and is also suitable for mounting images in read-only mode. The main differences lie in Composefs providing efficient shared storage of the contents of multiple mounted disk images and supporting the verification of read data. Use cases for Composefs include mounting container images and utilizing it for Git-like repositories such as OSTree.

Composefs uses a content-addressed storage model, meaning the primary identifier is not the file name but the hash of the file's content. This model ensures deduplication and allows for only one copy of identical files appearing in different mounted partitions to be stored. For instance, container images contain many standard system files, and when using Composefs, each of these files is shared across all mounted images without tricks like hard links. Shared files not only occupy one copy on the disk but also correspond to a single entry in the page cache, which helps save both disk and RAM.

To save disk space, data and metadata in mounted images are separated. When mounting, the following are specified:

  • A binary index that contains all the filesystem metadata, file names, permissions, and other information, except the actual content of the files.
  • The base directory where the contents of all mounted images are stored. Files are stored with reference to the hash of their content.

A binary index is created for each file system image, while the base directory is common to all images. To verify the contents of individual files and the entire image in shared storage conditions, the fs-verity mechanism can be applied, which checks the consistency of the hashes specified in the binary index against the actual content when accessing files (i.e., if an attacker modifies a file in the base directory or data becomes corrupted due to a crash, such a verification will detect the discrepancy).

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster