storagectlsystemdstoragectl1storagectlmount.storageEnumerate and mount storage volumes provided by storage providersstoragectlOPTIONSCOMMANDNAMEmount-tstoragePROVIDER:VOLUMEDIRECTORYmount-tstorage.FSTYPEPROVIDER:VOLUMEDIRECTORYDescriptionstoragectl may be used to inspect storage providers and the storage
volumes they expose. A storage provider is a service implementing the
io.systemd.StorageProviderVarlink
interface, registered as an AF_UNIX socket below the well-known socket directory
/run/systemd/io.systemd.StorageProvider/ (in system mode) or
$XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/ (in user mode). The two
storage providers shipped with systemd are
systemd-storage-block@.service8,
which exposes the system's block devices, and
systemd-storage-fs@.service8,
which exposes regular files and directories from a backing file system.The tool also provides a mount8 helper
for the file system type storage, which permits mounting storage volumes to arbitrary
places. See "Use as a mount helper" below for details.CommandsThe following commands are understood:volumesGLOBList storage volumes provided by all storage providers running on the
system (or, with , in the user runtime). The optional
GLOB argument is a shell-style pattern (see
fnmatch3)
that filters the result by volume name. The output is a table containing the providing
service, the volume name, its type (blk, reg or
dir), whether it is read-only, and — if known — its size and the number
of bytes used.This is the default command if none is specified.templatesGLOBList volume templates supported by the running storage providers. Templates
encapsulate a configuration to use when creating volumes on-the-fly, when they are acquired. Template
support is an optional feature for providers, and only applies to providers that allow creation
of volumes on-the-fly. See the respective provider documentation for details, for example
systemd-storage-fs@.service8. The
optional GLOB argument filters by template name. Storage providers that do
not implement template-based volume creation (such as the block-device provider) do not contribute to
this output.providersList the storage providers known to the system. This is determined by scanning the
well-known socket directory for AF_UNIX sockets that look like
io.systemd.StorageProvider endpoints. For each provider it is also reported
whether the socket can currently be connected to.OptionsThe following options are understood:Operate on system-wide storage providers. Sockets are looked for in
/run/systemd/io.systemd.StorageProvider/. This is the default.Operate on per-user storage providers. Sockets are looked for in
$XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/.Use as a mount helperThe tool provides the /sbin/mount.storage alias, implementing the
mount8
"external helper" interface, allowing storage volumes to be mounted with the regular
mount command. The volume to mount is encoded as the source of the mount,
in the form
PROVIDER:VOLUME, where
PROVIDER is the name of a storage provider (as listed by
storagectl providers) and VOLUME is the volume
name. Two file system type spellings are recognized:storageAcquires a directory volume and bind-mounts its directory tree onto the
target.storage.FSTYPEAcquires a regular file or block device volume and mounts it as a file system of type
FSTYPE (for example storage.ext4,
storage.btrfs, …).The standard mount options are forwarded to
mount. In addition, the following storage.-prefixed
options are interpreted by mount.storage itself and stripped from the
forwarded list:MODETakes one of any (open if it exists, otherwise create — the
default), open (fail if the volume does not yet exist) or new
(fail if the volume already exists).NAMEThe template to use when creating a new volume, if it is missing and the provider
supports on-the-fly creation of volumes.BYTESWhen creating a new volume on-the-fly, the size in bytes to allocate. Accepts the
usual K/M/G/T suffixes
(base 1024). Required when creating a regular file volume.ExamplesEnumerate available storage providers, volumes and templates$ storagectl providers
$ storagectl volumes
$ storagectl volumes '*foo*'
$ storagectl templatesMount a directory volume from the file system provider# mount -t storage fs:myvol /mnt/myvolIf the volume myvol does not yet exist, it will be created using
the default subvolume template.Create and mount an ext4 file system from a regular file.# mount -t storage.ext4 fs:scratch /mnt/scratch -o loopMount a block device volume read-only# mount -t storage.ext4 -o ro block:/dev/disk/by-id/usb-foo /mnt/fooExit statusOn success, 0 is returned, a non-zero failure code otherwise.See Alsosystemd1systemd-storage-block@.service8systemd-storage-fs@.service8varlinkctl1mount8