SYSTEMD-ST...@.SERVICE(8)

πŸ“¦
version 262.1 Β· 3 versions
, in arch rolling

πŸ’Ύ SYSTEMD-ST...@.SERVICE β€” the girlies' guide to systemd-storage-fs ✨

okay so bestie, you know systemd-storage-fs@.service? That's the manual we're reading, and honestly? It's giving storage provider realness. Let's go πŸ’…


🌸 NAME 🌸

systemd-storage-fs@.service, systemd-storage-fs.socket, systemd-storage-fs β€” literally a storage provider that exposes your regular files and directories as storage volumes. no cap, that's the whole vibe.


πŸ“œ SYNOPSIS πŸ“œ

systemd-storage-fs@.service

systemd-storage-fs.socket

πŸ’– DESCRIPTION πŸ’–

So systemd-storage-fs@.service is a service that implements the io.systemd.StorageProvider Varlink[1] interface. What does that even mean? It means it's out here exposing regular files and directories in /var/lib/storage/*.volume (if you're running it in system mode) or $XDG_STATE_HOME/storage (if you're in user mode) as storage volumes. The acquired volumes get handed back to whoever asked for them as file descriptors. 🎁

And here's the thing that makes it different from systemd-storage-block@.service(8) β€” this implementation also supports creating brand new volumes on demand, from a small set of built-in templates. it's giving ✨main character✨ energy, truly.

The service is socket-activated via systemd-storage-fs.socket. In system mode it listens on the AF_UNIX socket /run/systemd/io.systemd.StorageProvider/fs, and in user mode it's on $XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/fs. If you want an enumeration tool (iykyk), go look at storagectl(1).

Also pls check out systemd-storage-block@.service(8) β€” that's the complementary implementation that exposes local block devices as storage volumes. besties, not rivals 🫢


πŸ“‚ VOLUMES πŸ“‚

Volumes live below the storage directory, which is:

  • /var/lib/storage/ when run in system mode.
  • $XDG_STATE_HOME/storage/ (typically ~/.local/state/storage/) when run in user mode.

Every volume on disk is stored as a directory entry with a .volume suffix inside the storage directory. Here's the breakdown bestie:

  • Entries that are regular files β†’ exposed as volumes of type reg.
  • Entries that are directories β†’ exposed as volumes of type dir.
  • And plot twist: block device nodes may be symlinked (or bind mounted) into the directory, and those get exposed as volumes of type blk. πŸ”₯

For directory volumes, the root of the file system that gets passed to clients lives in a subdirectory root/ of the NAME.volume directory. The way that works: the former (and literally all inodes below it) must be owned by the foreign UID range, and the latter must be owned by the host's root. yes, that's the rule, we don't make them 🌸

When acquiring a volume, symlinks are followed. no surprises there.

An administrator is permitted to freely manipulate the volume hierarchy directly, as long as the rules above are followed. In particular, it's permitted to copy, mount or symlink arbitrary external resources (doesn't matter if directory, regular file or block) into the volume directory, so they show up as additional volumes. it's giving "decorate your own room" πŸŽ€


🧚 TEMPLATES 🧚

The provider supports creating new volumes automatically when they're acquired. The caller may select a template that determines the configuration details of the volume being created. These are the built-in templates available:

sparse-file

Creates a volume backed by a sparsely populated regular file. This is the default template when creating a regular file volume. (Volume type is "reg".)

Added in version 261.

allocated-file

Creates a volume backed by a fully allocated regular file. (Volume type is "reg".)

Added in version 261.

directory

Creates a volume backed by a regular directory. (Volume type is "dir".)

Added in version 261.

subvolume

Creates a btrfs subvolume as backing inode (falling back to a regular directory if the storage directory is not on btrfs). This is the default template when creating a directory volume. (Volume type is "dir".)

Added in version 261.


βš™οΈ OPTIONS βš™οΈ

These are the command-line options it understands, bestie:

  • --system β€” Operate in system mode. Volumes are stored below /var/lib/storage/. This is the default when invoked from systemd-storage-fs@.service in the system manager.

Added in version 261.

  • --user β€” Operate in user mode. Volumes are stored below $XDG_STATE_HOME/storage/. This is the default when invoked from systemd-storage-fs@.service in the user manager.

Added in version 261.

  • -h, --help β€” Print a short help text and exit.
  • --version β€” Print a short version string and exit.

πŸ—‚οΈ FILES πŸ—‚οΈ

  • /var/lib/storage/, $XDG_STATE_HOME/storage/ β€” The storage directory used to back the system mode and user mode service instances respectively. Each volume is stored as an entry with a .volume suffix below this directory.

Added in version 261.

  • /run/systemd/io.systemd.StorageProvider/fs, $XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/fs β€” AF_UNIX sockets the service listens on, in system and user mode respectively. These are the canonical locations for the "fs" storage provider, and are enumerated by storagectl providers.

Added in version 261.


πŸ‘€ SEE ALSO πŸ‘€

systemd(1), storagectl(1), systemd-storage-block@.service(8)


πŸ“ NOTES πŸ“

  1. Varlink https://varlink.org/

and that's the whole page, bestie. go forth and expose some volumes πŸ’…πŸ¦‹

slay β€” this was systemd 262.1, manual page SYSTEMD-ST...@.SERVICE(8). periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from
  • arch rolling: systemd 262.1-1 Β· LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms