Go to file
Lennart Poettering 1761066b13 storagetm: add new systemd-storagetm component
This implements a "storage target mode", similar to what MacOS provides
since a long time as "Target Disk Mode":

        https://en.wikipedia.org/wiki/Target_Disk_Mode

This implementation is relatively simple:

1. a new generic target "storage-target-mode.target" is added, which
   when booted into defines the target mode.

2. a small tool and service "systemd-storagetm.service" is added which
   exposes a specific device or all devices as NVMe-TCP devices over the
   network.  NVMe-TCP appears to be hot shit right now how to expose
   block devices over the network. And it's really simple to set up via
   configs, hence our code is relatively short and neat.

The idea is that systemd-storagetm.target can be extended sooner or
later, for example to expose block devices also as USB mass storage
devices and similar, in case the system has "dual mode" USB controller
that can also work as device, not just as host. (And people could also
plug in sharing as NBD, iSCSI, whatever they want.)

How to use this? Boot into your system with a kernel cmdline of
"rd.systemd.unit=storage-target-mode.target ip=link-local", and you'll see on
screen the precise "nvme connect" command line to make the relevant
block devices available locally on some other machine. This all requires
that the target mode stuff is included in the initrd of course. And the
system will the stay in the initrd forever.

Why bother? Primarily three use-cases:

1. Debug a broken system: with very few dependencies during boot get
   access to the raw block device of a broken machine.

2. Migrate from system to another system, by dd'ing the old to the new
   directly.

3. Installing an OS remotely on some device (for example via Thunderbolt
   networking)

(And there might be more, for example the ability to boot from a
laptop's disk on another system)

Limitations:

1. There's no authentication/encryption. Hence: use this on local links
   only.

2. NVMe target mode on Linux supports r/w operation only. Ideally, we'd
   have a read-only mode, for security reasons, and default to it.

Future love:

1. We should have another mode, where we simply expose the homed LUKS
   home dirs like that.

2. Some lightweight hookup with plymouth, to display a (shortened)
   version of the info we write to the console.

To test all this, just run:

    mkosi --kernel-command-line-extra="rd.systemd.unit=storage-target-mode.target" qemu
2023-11-02 14:19:32 +01:00
.clusterfuzzlite ci: unpin CFLite 2022-04-26 09:13:57 +00:00
.github mkosi: explicitly disable KVM in GHA runs 2023-11-02 12:16:11 +00:00
.semaphore test: use 'until' instead of 'while !' 2023-09-06 19:54:29 +01:00
catalog tree-wide: fix typo 2023-10-31 14:35:33 +09:00
coccinelle coccinelle: don't run iovec-make on iovec_done{,_erase} 2023-10-25 11:16:37 +02:00
docs doc: document explicitly when we require specific top-level mounts to be established 2023-10-30 11:10:50 +00:00
factory docs: excorcise NIS from nsswitch.conf 2023-09-20 15:17:52 +02:00
hwdb.d Update hwdb autosuspend rules 2023-11-01 14:07:54 +00:00
LICENSES LICENSES/README.md: fix syntax 2023-07-08 22:33:53 +00:00
man man: run ninja update-man-rules again 2023-11-01 16:02:05 +01:00
mkosi.conf.d mkosi: Use cache and build subdirectories 2023-10-28 11:30:18 +01:00
mkosi.presets mkosi: Use RuntimeTrees= to mount sources 2023-10-20 12:43:57 +02:00
modprobe.d meson: install the right README file in modprobe.d 2021-07-07 14:52:05 +02:00
network network: add default .network file matching ID_NET_AUTO_LINK_LOCAL_ONLY=1 2023-10-30 18:57:41 +01:00
po po: Translated using Weblate (Portuguese) 2023-11-01 11:54:47 +09:00
presets preset: enable systemd-networkd-wait-online.service by default 2023-06-07 21:51:37 +01:00
rules.d udev: add new builtin net_driver 2023-11-01 16:00:19 +00:00
shell-completion meson: Always build bootctl 2023-10-25 16:49:24 +02:00
src storagetm: add new systemd-storagetm component 2023-11-02 14:19:32 +01:00
sysctl.d sysctl.d: Fix pid_max comment 2023-10-31 13:07:49 +01:00
sysusers.d sysusers.d: create the user for systemd-journal-upload.service 2023-06-19 23:42:00 +02:00
test analyze: handle CAP_BPF support 2023-11-01 10:25:59 +00:00
tmpfiles.d Revert "Revert "tmpfiles.d: adjust /dev/vfio/vfio access mode"" 2023-08-09 11:27:39 +09:00
tools tools: syscall tables moved to a subdirectory 2023-11-01 14:07:54 +00:00
units storagetm: add new systemd-storagetm component 2023-11-02 14:19:32 +01:00
xorg xorg/50-systemd-user: add a full license header 2021-10-01 14:45:00 +02:00
.clang-format clang-format: Adjust style of pointers 2022-05-30 04:00:54 +09:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.editorconfig editorconfig: add NEWS whitespace configuration 2023-10-26 22:41:03 +01:00
.gitattributes Mark all base64 files as generated 2023-08-16 12:49:45 +02:00
.gitignore Add mkosi.conf to gitignore 2023-09-22 08:14:10 +02:00
.mailmap mailmap: "reduce contributor count by 13" 2023-08-16 12:49:42 +02:00
.packit.yml Revert "ci: temporarily disable Packit's i386" 2023-09-17 22:18:49 +02:00
.pylintrc Add .pylintrc to globally suppress warnings we don't really care about 2023-08-10 18:13:29 +02:00
.vimrc vimrc: explicitly set shiftwidth for the C file type 2023-09-18 13:11:45 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure configure: update meson invocation 2023-07-29 14:08:06 +02:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile tree-wide: add spdx header on all scripts and helpers 2021-01-28 09:55:35 +01:00
meson.build storagetm: add new systemd-storagetm component 2023-11-02 14:19:32 +01:00
meson_options.txt storagetm: add new systemd-storagetm component 2023-11-02 14:19:32 +01:00
mkosi.kernel.config mkosi: Don't disable CONFIG_USB 2023-09-06 12:58:30 +02:00
NEWS NEWS: several updates for networking 2023-11-02 15:36:29 +09:00
README docs: excorcise NIS from nsswitch.conf 2023-09-20 15:17:52 +02:00
README.md Update badge on README to refer new scorecard viewer (#28050) 2023-06-15 19:24:32 +01:00
TODO update TODO 2023-10-31 11:03:53 +01:00

Systemd

System and Service Manager

Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
CentOS CI - CentOS 8
CentOS CI - Arch
CentOS CI - Arch (sanitizers)
Fossies codespell report
Weblate
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.