From eae4943afa0f5cb15a7d68d046c67de9c463fde5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 30 Oct 2023 12:12:59 +0100 Subject: [PATCH] man: add docs for new storagetm service --- man/rules/meson.build | 1 + man/systemd-storagetm.service.xml | 104 ++++++++++++++++++++++++++++++ man/systemd.special.xml | 13 ++++ 3 files changed, 118 insertions(+) create mode 100644 man/systemd-storagetm.service.xml diff --git a/man/rules/meson.build b/man/rules/meson.build index 525bea94fd4..45a1780fb2c 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -1045,6 +1045,7 @@ manpages = [ ['systemd-socket-proxyd', '8', [], ''], ['systemd-soft-reboot.service', '8', [], ''], ['systemd-stdio-bridge', '1', [], ''], + ['systemd-storagetm.service', '8', ['systemd-storagetm'], 'ENABLE_STORAGETM'], ['systemd-stub', '7', ['linuxaa64.efi.stub', 'linuxia32.efi.stub', 'linuxx64.efi.stub', 'sd-stub'], diff --git a/man/systemd-storagetm.service.xml b/man/systemd-storagetm.service.xml new file mode 100644 index 00000000000..4fa79587370 --- /dev/null +++ b/man/systemd-storagetm.service.xml @@ -0,0 +1,104 @@ + + + + + + + + systemd-storagetm.service + systemd + + + + systemd-storagetm.service + 8 + + + + systemd-storagetm.service + systemd-storagetm + Exposes all local block devices as NVMe-TCP mass storage devices + + + + systemd-storagetm.service + + + /usr/lib/systemd/systemd-storagetm + OPTIONS + DEVICE + + + + + Description + + systemd-storagetm.service is a service that exposes all local block devices as + NVMe-TCP mass storage devices. Its primary use-case is to be invoked by the + storage-target-mode.target unit that can be booted into. + + Warning: the NVMe disks are currently exposed without authentication or encryption, in read/write + mode. This means network peers may read from and write to the device without any restrictions. This + functionality should hence only be used in a local setup. + + Note that to function properly networking must be configured too. The recommended mechanism to boot + into a storage target mode is by adding rd.systemd.unit=storage-target-mode.target + ip=link-local on the kernel command line. Note that ip=link-local only + configures link-local IP, i.e. IPv4LL and IPv6LL, which means non-routable addresses. This is done for + security reasons, so that only systems on the local link can access the devices. Use + ip=dhcp to assign routable addresses too. For further details see + systemd-network-generator.service8. + + Unless the switch is used expects one or more block devices or regular files to expose + via NVMe-TCP as argument. + + + + Options + + The following options are understood: + + + + + Takes a string. If specified configures the NVMe Qualified Name to use for the + exposed NVMe-TCP mass storage devices. The NQN should follow the syntax described in NVM + Express Base Specification 2.0c, section 4.5 "NVMe Qualified Names". Note that the NQN + specified here will be suffixed with a dot and the the block device name before it is exposed on the + NVMe target. If not specified defaults to + nqn.2023-10.io.systemd:storagetm.ID, where ID is + replaced by a 128bit ID derived from + machine-id5. + + + + + + + + + If specified exposes all local block devices via NVMe-TCP, current and future + (i.e. it watches block devices come and go and updates the NVMe-TCP list as needed). Note that by + default any block devices that originate on the same block device as the block device backing the + current root file system are excluded. If the switch is specified twice this safety mechanism is + disabled. + + + + + + + + + + See Also + + systemd1, + systemd.special7 + + + + diff --git a/man/systemd.special.xml b/man/systemd.special.xml index 1d1796154ed..8acad5c83ef 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -83,6 +83,7 @@ sockets.target, soft-reboot.target, sound.target, + storage-target-mode.target, suspend.target, swap.target, sysinit.target, @@ -767,6 +768,18 @@ + + storage-target-mode.target + + A special target unit that can be booted into that selects the "Storage Target Mode" for + the OS. In this mode all local storage disks are exposed to external systems as block + devices. This invokes + systemd-storagetm.service8 + which exposes all local disks as NVMe-TCP devices for access over the network. It might as well + invoke other services too that make local disks available via other mechanisms. + + + suspend.target -- 2.47.3