]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Add man page for lxc-clone
authorSerge Hallyn <serge.hallyn@canonical.com>
Fri, 8 Feb 2013 22:58:01 +0000 (16:58 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 8 Feb 2013 23:22:33 +0000 (18:22 -0500)
And doing so pointed out a bug in lxc-clone itself - it claims
default fssize is 2G.  It's not.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
doc/Makefile.am
doc/lxc-clone.sgml.in [new file with mode: 0644]
src/lxc/lxc-clone.in

index 8963e3dc7100e0f67481bc66864b52cd67f0e581..6402024fbda0f9d95d25fe4a984e2d6ec1ac4e7c 100644 (file)
@@ -302,6 +302,7 @@ AC_CONFIG_FILES([
        config/Makefile
 
        doc/Makefile
+       doc/lxc-clone.sgml
        doc/lxc-create.sgml
        doc/lxc-destroy.sgml
        doc/lxc-execute.sgml
index e5392546ed6507a5079b735a712fb34465c657c8..e54a087827c17d9c6c2311828342e0d4a7dfdcc5 100644 (file)
@@ -7,6 +7,7 @@ EXTRA_DIST = \
 
 if ENABLE_DOCBOOK
 man_MANS = \
+       lxc-clone.1 \
        lxc-create.1 \
        lxc-destroy.1 \
        lxc-execute.1 \
diff --git a/doc/lxc-clone.sgml.in b/doc/lxc-clone.sgml.in
new file mode 100644 (file)
index 0000000..e3eb946
--- /dev/null
@@ -0,0 +1,194 @@
+<!--
+
+lxc: linux Container library
+
+(C) Copyright IBM Corp. 2007, 2008
+
+Authors:
+Daniel Lezcano <dlezcano at fr.ibm.com>
+Serge Hallyn <serge.hallyn at ubuntu.com>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+-->
+
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+
+<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
+<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
+]>
+
+<refentry>
+
+  <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
+
+  <refmeta>
+    <refentrytitle>lxc-clone</refentrytitle>
+    <manvolnum>1</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>lxc-clone</refname>
+
+    <refpurpose>
+      clone a new container from an existing one.
+    </refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>lxc-clone</command>
+      <arg choice="req">-o <replaceable>orig</replaceable></arg>
+      <arg choice="req">-n <replaceable>new</replaceable></arg>
+      <arg choice="opt">-s </arg>
+      <arg choice="opt">-L <replaceable>fssize</replaceable></arg>
+      <arg choice="opt">-v <replaceable>vgname</replaceable></arg>
+      <arg choice="opt">-p <replaceable>lxc_lv_prefix</replaceable></arg>
+      <arg choice="opt">-t <replaceable>fstype</replaceable></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Description</title>
+
+    <para>
+      <command>lxc-clone</command> Creates a new container as a copy of an existing
+      container.  When the original container's rootfs is an LVM block device or
+      is on a btrfs filesystem, then a snapshotted clone can be created, taking up
+      very little initial disk space.
+    </para>
+
+  </refsect1>
+
+  <refsect1>
+
+    <title>Options</title>
+
+    <variablelist>
+
+      <varlistentry>
+       <term>
+         <option>-o, --orig <replaceable>orig</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           The name of the original container to clone.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-n, --new <replaceable>new</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           The name of the new container to create.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-s, --snapshot</option>
+       </term>
+       <listitem>
+         <para>
+           The new container's rootfs should be a LVM or btrfs snapshot of the original.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-L, --fssize <replaceable>fssize</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           In the case of a LVM-backed container, a size for the new
+           block device.  By default, the new device will be made the
+           same size as the original.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-v, --vgname <replaceable>vgname</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           For an LVM-backed container, the volume group name to use.  By
+           default it is 'lxc'.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-p, --lvprefix <replaceable>lxc_lv_prefix</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           For an LVM-backed container, a string to prefix to the container name to
+           form the logical volume name.  For instance, specifying
+           <command>-n c1 -p lxc_</command> will cause the container rootfs to
+           be on a logical volume called <replaceable>lxc_c1</replaceable>.
+         </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <option>-t, --fstype <replaceable>fstype</replaceable></option>
+       </term>
+       <listitem>
+         <para>
+           For a non-snapshot LVM clone, the file system to use for the new
+           container.  Note this option is ignored when requesting a
+           snapshotted container.
+         </para>
+       </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+  </refsect1>
+
+  &seealso;
+
+  <refsect1>
+    <title>Author</title>
+    <para>Serge Hallyn <email>serge.hallyn@ubuntu.com</email></para>
+  </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
index fcf34a9212214ac0a8944f2c457b0faa087d98bf..291db30fd60ef6e34b316cb93702369b82d5aa3a 100755 (executable)
@@ -37,7 +37,7 @@ help() {
     echo "  -o ORIG_NAME   specify the name of the original container" >&2
     echo "  -n NEW_NAME    specify the name of the new container" >&2
     echo "  -s             make the new rootfs a snapshot of the original" >&2
-    echo "  -L FS_SIZE     specify the new filesystem size (default: 2G)" >&2
+    echo "  -L FS_SIZE     specify the new filesystem size (default: same as original)" >&2
     echo "  -v VG_NAME     specify the new LVM volume group name (default: lxc)" >&2
     echo "  -p LV_PREFIX   add a prefix to new LVM logical volume names" >&2
     echo "  -t FS_TYPE     specify the new filesystem type (default: ext3;" >&2
@@ -56,7 +56,6 @@ optarg_check() {
 
 . @DATADIR@/lxc/lxc.functions
 snapshot=no
-lxc_defsize=2G
 lxc_size=_unset
 lxc_vg=lxc
 lxc_lv_prefix=""