|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!--*-nxml-*--> |
| 3 | +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 4 | + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 5 | +<!-- |
| 6 | + SPDX-License-Identifier: LGPL-2.1-or-later |
| 7 | +--> |
| 8 | +<refentry id="clonetab" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 9 | + |
| 10 | + <refentryinfo> |
| 11 | + <title>clonetab</title> |
| 12 | + <productname>systemd</productname> |
| 13 | + </refentryinfo> |
| 14 | + |
| 15 | + <refmeta> |
| 16 | + <refentrytitle>clonetab</refentrytitle> |
| 17 | + <manvolnum>5</manvolnum> |
| 18 | + </refmeta> |
| 19 | + |
| 20 | + <refnamediv> |
| 21 | + <refname>clonetab</refname> |
| 22 | + <refpurpose>Configuration for dm-clone block devices</refpurpose> |
| 23 | + </refnamediv> |
| 24 | + |
| 25 | + <refsynopsisdiv> |
| 26 | + <para><filename>/etc/clonetab</filename></para> |
| 27 | + </refsynopsisdiv> |
| 28 | + |
| 29 | + <refsect1> |
| 30 | + <title>Description</title> |
| 31 | + |
| 32 | + <para>The <filename>/etc/clonetab</filename> file describes |
| 33 | + dm-clone block devices that are set up during system boot.</para> |
| 34 | + |
| 35 | + <para>Empty lines and lines starting with the <literal>#</literal> |
| 36 | + character are ignored. Each of the remaining lines describes one |
| 37 | + dm-clone device. Fields are delimited by white space.</para> |
| 38 | + |
| 39 | + <para>Each line is in the form<programlisting><replaceable>name</replaceable> <replaceable>source-device</replaceable> <replaceable>destination-device</replaceable> <replaceable>metadata-device</replaceable> [<replaceable>options</replaceable>]</programlisting> |
| 40 | + The first four fields are mandatory, the fifth is optional.</para> |
| 41 | + |
| 42 | + <para>The five fields of <filename>/etc/clonetab</filename> are defined as follows:</para> |
| 43 | + |
| 44 | + <orderedlist> |
| 45 | + |
| 46 | + <listitem><para>The first field contains the name of the resulting dm-clone device; its |
| 47 | + block device is set up below <filename>/dev/mapper/</filename>.</para></listitem> |
| 48 | + |
| 49 | + <listitem><para>The second field contains a path to the read-only source block device. |
| 50 | + This is the device whose data is cloned to the destination device. Reads to regions not |
| 51 | + yet hydrated are served directly from this device.</para></listitem> |
| 52 | + |
| 53 | + <listitem><para>The third field contains a path to the writable destination block device. |
| 54 | + The source device's data is copied here in the background. It must be at least as |
| 55 | + large as the source device.</para></listitem> |
| 56 | + |
| 57 | + <listitem><para>The fourth field contains a path to the metadata block device. This |
| 58 | + small device tracks which regions of the destination have been hydrated and is managed |
| 59 | + exclusively by dm-clone.</para></listitem> |
| 60 | + |
| 61 | + <listitem><para>The fifth field, if present, contains comma-separated <literal>key=value</literal> |
| 62 | + options. The following option is supported:</para> |
| 63 | + |
| 64 | + <variablelist> |
| 65 | + <varlistentry> |
| 66 | + <term><option>region_size=<replaceable>BYTES</replaceable></option></term> |
| 67 | + <listitem><para>Controls the granularity of background hydration copying — how much |
| 68 | + data is copied at a time. Region size is specified in bytes (standard suffixes like |
| 69 | + <literal>K</literal>, <literal>M</literal>, <literal>G</literal> are supported), and must |
| 70 | + correspond to a power of two between 4 KiB and 1 GiB. For example, |
| 71 | + <literal>region_size=4K</literal> or <literal>region_size=4096</literal> sets a 4 KiB region size.</para> |
| 72 | + |
| 73 | + <para> |
| 74 | + One region is the atomic unit dm-clone tracks: it is either fully hydrated (copied to the destination) |
| 75 | + or not, never partially. If a copy is interrupted mid-region, that whole region is |
| 76 | + retried from scratch on next boot. Smaller regions mean finer progress tracking; |
| 77 | + larger regions reduce metadata overhead. Defaults to <literal>4K</literal>. For background, see |
| 78 | + <ulink url="https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/dm-clone.html">dm-clone kernel documentation</ulink>. |
| 79 | + </para> |
| 80 | + |
| 81 | + <xi:include href="version-info.xml" xpointer="v262"/></listitem> |
| 82 | + </varlistentry> |
| 83 | + </variablelist> |
| 84 | + |
| 85 | + <para>If no options are needed, the field may be omitted entirely or |
| 86 | + <literal>-</literal> may be used as a placeholder.</para> |
| 87 | + </listitem> |
| 88 | + |
| 89 | + </orderedlist> |
| 90 | + |
| 91 | + <para>At early boot and when the system manager configuration is reloaded, this file is |
| 92 | + translated into native systemd units by |
| 93 | + <citerefentry><refentrytitle>systemd-clonesetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> |
| 94 | + </refsect1> |
| 95 | + |
| 96 | + <refsect1> |
| 97 | + <title>Examples</title> |
| 98 | + |
| 99 | + <example> |
| 100 | + <title>Simple clone without options</title> |
| 101 | + <para>Clone a source device to a destination, using a separate metadata device:</para> |
| 102 | + <programlisting>mydevice /dev/sdb /dev/sdc /dev/sdd</programlisting> |
| 103 | + </example> |
| 104 | + |
| 105 | + <example> |
| 106 | + <title>Clone with custom region size</title> |
| 107 | + <para>Clone a source device to a destination with a custom region size of 8 KiB:</para> |
| 108 | + <programlisting>mydevice /dev/sdb /dev/sdc /dev/sdd region_size=8K</programlisting> |
| 109 | + </example> |
| 110 | + </refsect1> |
| 111 | + |
| 112 | + <refsect1> |
| 113 | + <title>See Also</title> |
| 114 | + <para><simplelist type="inline"> |
| 115 | + <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 116 | + <member><citerefentry><refentrytitle>systemd-clonesetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 117 | + <member><citerefentry project='die-net'><refentrytitle>dmsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 118 | + </simplelist></para> |
| 119 | + </refsect1> |
| 120 | + |
| 121 | +</refentry> |
0 commit comments