table of contents
- unstable 261~rc1-1
| STORAGECTL(1) | storagectl | STORAGECTL(1) |
NAME¶
storagectl, mount.storage - Enumerate and mount storage volumes provided by storage providers
SYNOPSIS¶
storagectl [OPTIONS...] {COMMAND} [NAME...]
mount -t storage PROVIDER:VOLUME DIRECTORY
mount -t storage.FSTYPE PROVIDER:VOLUME DIRECTORY
DESCRIPTION¶
storagectl may be used to inspect storage providers and the storage volumes they expose. A storage provider is a service implementing the io.systemd.StorageProvider Varlink[1] 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@.service(8), which exposes the system's block devices, and systemd-storage-fs@.service(8), which exposes regular files and directories from a backing file system.
The tool also provides a mount(8) helper for the file system type "storage", which permits mounting storage volumes to arbitrary places. See "Use as a mount helper" below for details.
COMMANDS¶
The following commands are understood:
volumes [GLOB]
This is the default command if none is specified.
Added in version 261.
templates [GLOB]
Added in version 261.
providers
Added in version 261.
OPTIONS¶
The following options are understood:
--system
Added in version 261.
--user
Added in version 261.
--json=MODE
--no-pager
--no-legend
--no-ask-password
-h, --help
--version
USE AS A MOUNT HELPER¶
The tool provides the /sbin/mount.storage alias, implementing the mount(8) "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:
"storage"
Added in version 261.
"storage.FSTYPE"
Added in version 261.
The standard -o 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:
storage.create=MODE
Added in version 261.
storage.template=NAME
Added in version 261.
storage.create-size=BYTES
Added in version 261.
EXAMPLES¶
Example 1. Enumerate available storage providers, volumes and templates
$ storagectl providers $ storagectl volumes $ storagectl volumes '*foo*' $ storagectl templates
Example 2. Mount a directory volume from the file system provider
# mount -t storage fs:myvol /mnt/myvol
If the volume "myvol" does not yet exist, it will be created using the default "subvolume" template.
Example 3. Create and mount an ext4 file system from a regular file.
# mount -t storage.ext4 fs:scratch /mnt/scratch -o loop
Example 4. Mount a block device volume read-only
# mount -t storage.ext4 -o ro block:/dev/disk/by-id/usb-foo /mnt/foo
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
ENVIRONMENT¶
$SYSTEMD_LOG_LEVEL
$SYSTEMD_LOG_COLOR
This setting is only useful when messages are written directly to the terminal, because journalctl(1) and other tools that display logs will color messages based on the log level on their own.
$SYSTEMD_LOG_TIME
This setting is only useful when messages are written directly to the terminal or a file, because journalctl(1) and other tools that display logs will attach timestamps based on the entry metadata on their own.
$SYSTEMD_LOG_LOCATION
Note that the log location is often attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs.
$SYSTEMD_LOG_TID
Note that the this information is attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs.
$SYSTEMD_LOG_TARGET
$SYSTEMD_LOG_RATELIMIT_KMSG
$SYSTEMD_PAGER, $PAGER
Note: if $SYSTEMD_PAGERSECURE is not set, $SYSTEMD_PAGER and $PAGER can only be used to disable the pager (with "cat" or ""), and are otherwise ignored.
$SYSTEMD_LESS
Users might want to change two options in particular:
K
If the value of $SYSTEMD_LESS does not include "K", and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.
X
Note that setting the regular $LESS environment variable has no effect for less invocations by systemd tools.
See less(1) for more discussion.
$SYSTEMD_LESSCHARSET
Note that setting the regular $LESSCHARSET environment variable has no effect for less invocations by systemd tools.
$SYSTEMD_PAGERSECURE
This option takes a boolean argument. When set to true, the "secure mode" of the pager is enabled. In "secure mode", LESSSECURE=1 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses. Currently only less(1) is known to understand this variable and implement "secure mode".
When set to false, no limitation is placed on the pager. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment may allow the user to invoke arbitrary commands.
When $SYSTEMD_PAGERSECURE is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see geteuid(2) and sd_pid_get_owner_uid(3), or when running under sudo(8) or similar tools ($SUDO_UID is set [2]). In those cases, SYSTEMD_PAGERSECURE=1 will be set and pagers which are not known to implement "secure mode" will not be used at all. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience. It is recommended to explicitly set $SYSTEMD_PAGERSECURE or disable the pager.
Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, other than to disable the pager, $SYSTEMD_PAGERSECURE must be set too.
$SYSTEMD_COLORS
true
false
"16", "256", "24bit"
"auto-16", "auto-256", "auto-24bit"
$SYSTEMD_URLIFY
SEE ALSO¶
systemd(1), systemd-storage-block@.service(8), systemd-storage-fs@.service(8), varlinkctl(1), mount(8)
NOTES¶
- 1.
- Varlink
- 2.
- It is recommended for other tools to set and check $SUDO_UID as appropriate, treating it is a common interface.
| systemd 261~rc1 |