diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-03-06 11:59:16 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-09 16:40:55 +0100 |
commit | 07d6072e0ea25e6047007bca53b329b03c76db43 (patch) | |
tree | df83be86e3f7a28a4c552d2c3b0b2b573b0e6bb6 /man/systemd-dissect.xml | |
parent | loop-util: add API for selecting "lo_file_name" field for a loopback device (diff) | |
download | systemd-07d6072e0ea25e6047007bca53b329b03c76db43.tar.xz systemd-07d6072e0ea25e6047007bca53b329b03c76db43.zip |
dissect: add commands for attaching/detaching loopback devices
Sometimes it is useful attaching DDIs without mounting them. We could
use "losetup" for that, but doing this in systemd-dissect has various
benefits:
1. we superficially validate the DDI first
2. we set the sector size depending on what we determine
3. we synchronously create the per-partition block devices
Diffstat (limited to 'man/systemd-dissect.xml')
-rw-r--r-- | man/systemd-dissect.xml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/man/systemd-dissect.xml b/man/systemd-dissect.xml index 7dfad29c35..1d0532713d 100644 --- a/man/systemd-dissect.xml +++ b/man/systemd-dissect.xml @@ -33,6 +33,12 @@ <command>systemd-dissect <arg choice="opt" rep="repeat">OPTIONS</arg> <option>--umount</option> <arg choice="plain"><replaceable>PATH</replaceable></arg></command> </cmdsynopsis> <cmdsynopsis> + <command>systemd-dissect <arg choice="opt" rep="repeat">OPTIONS</arg> <option>--attach</option> <arg choice="plain"><replaceable>IMAGE</replaceable></arg></command> + </cmdsynopsis> + <cmdsynopsis> + <command>systemd-dissect <arg choice="opt" rep="repeat">OPTIONS</arg> <option>--detach</option> <arg choice="plain"><replaceable>PATH</replaceable></arg></command> + </cmdsynopsis> + <cmdsynopsis> <command>systemd-dissect <arg choice="opt" rep="repeat">OPTIONS</arg> <option>--list</option> <arg choice="plain"><replaceable>IMAGE</replaceable></arg></command> </cmdsynopsis> <cmdsynopsis> @@ -174,6 +180,25 @@ </varlistentry> <varlistentry> + <term><option>--attach</option></term> + + <listitem><para>Attach the specified disk image to an automatically allocated loopback block device, + and print the path to the loopback block device to standard output. This is similar to an invocation + of <command>losetup --find --show</command>, but will validate the image as DDI before attaching, and + derive the correct sector size to use automatically. Moreover, it ensures the per-partition block + devices are created before returning. Takes a path to a disk image file.</para></listitem> + </varlistentry> + + <varlistentry> + <term><option>--detach</option></term> + + <listitem><para>Detach the specified disk image from a loopback block device. This undoes the effect + of <option>--attach</option> above. This expects either a path to a loopback block device as an + argument, or the path to the backing image file. In the latter case it will automatically determine + the right device to detach.</para></listitem> + </varlistentry> + + <varlistentry> <term><option>--list</option></term> <term><option>-l</option></term> |