'\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH lxc-clone 1 "Sat Apr 29 06:45:43 UTC 2017" "" "" .SH NAME lxc-clone \- clone a new container from an existing one. .SH SYNOPSIS 'nh .fi .ad l \fBlxc-clone\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [-s ] [-K ] [-M ] [-H ] [-B \fIbackingstore\fR] [-L \fIfssize\fR] [-p \fIlxcpath\fR] [-P \fInewlxcpath\fR] {-o \fIorig\fR} {-n \fInew\fR} [-- hook arguments] 'in \n(.iu-\nxu .ad b 'hy 'nh .fi .ad l \fBlxc-clone\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [-s ] [-K ] [-M ] [-H ] [-B \fIbackingstore\fR] [-L \fIfssize\fR] [-p \fIlxcpath\fR] [-P \fInewlxcpath\fR] {orig} {new} [-- hook arguments] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBlxc-clone\fR Creates a new container as a clone of an existing container. Two types of clones are supported: copy and snapshot. A copy clone copies the root filessytem from the original container to the new. A snapshot filesystem uses the backing store's snapshot functionality to create a very small copy-on-write snapshot of the original container. Snapshot clones require the new container backing store to support snapshotting. Currently this includes only aufs, btrfs, lvm, overlayfs and zfs. LVM devices do not support snapshots of snapshots. .PP The backing store of the new container will be the same type as the original container, with one exception, overlay containers. aufs and overlayfs snapshots can be created of directory backed containers. This can be requested by using (for overlayfs) the \fI-B overlayfs\fR arguments. .PP The names of the original and new container can be given (in that order) after all options, or can be specified with the \fI-o\fR and \fI-n\fR options, respectively. .SH OPTIONS .TP \*(T<\fB\-s, \-\-snapshot\fR\*(T> The new container's rootfs should be a LVM or btrfs snapshot of the original. .TP \*(T<\fB\-K, \-\-keepname\fR\*(T> Do not change the hostname of the container (in the root filesystem). .TP \*(T<\fB\-M, \-\-keepmac\fR\*(T> Use the same MAC address as the original container, rather than generating a new random one. .TP \*(T<\fB\-H, \-\-copyhooks\fR\*(T> Copy all mount hooks into the new container's directory, and update any lxcpaths and container names as needed. .TP \*(T<\fB\-L, \-\-fssize \fR\*(T>\fIfssize\fR In the case of a block device backed container, a size for the new block device. By default, the new device will be made the same size as the original. .TP \*(T<\fB\-p, \-\-lxcpath \fR\*(T>\fIlxcpath\fR The lxcpath of the original container. By default, the system wide configured lxcpath will be used. .TP \*(T<\fB\-P, \-\-newpath \fR\*(T>\fInewlxcpath\fR The lxcpath for the new container. By default the same lxcpath as the original will be used. Note that with btrfs snapshots, changing lxcpaths may not be possible, as subvolume snapshots must be in the same btrfs filesystem. .TP \*(T<\fB\-B, \-\-backingstore \fR\*(T>\fIbackingstore\fR Select a different backing store for the new container. By default the same as the original container's is used. Note that currently changing the backingstore is only supported for aufs and overlayfs snapshots of directory backed containers. Valid backing stores include dir (directory), aufs, btrfs, lvm, zfs, loop and overlayfs. .TP \*(T<\fB\-o, \-\-orig \fR\*(T>\fIorig\fR The name of the original container to clone. .TP \*(T<\fB\-n, \-\-new \fR\*(T>\fInew\fR The name of the new container to create. .SH "CLONE HOOK" If the container being cloned has one or more \*(T<\fIlxc.hook.clone\fR\*(T> specified, then the specified hooks will be called for the new container. The first 3 arguments passed to the clone hook will be the container name, a section ('lxc'), and the hook type ('clone'). Extra arguments passed \fBlxc-clone\fR will be passed to the hook program starting at argument 4. The \*(T<\fILXC_ROOTFS_MOUNT\fR\*(T> environment variable gives the path under which the container's root filesystem is mounted. The configuration file pathname is stored in \*(T<\fILXC_CONFIG_FILE\fR\*(T>, the new container name in \*(T<\fILXC_NAME\fR\*(T>, the old container name in \*(T<\fILXC_SRC_NAME\fR\*(T>, and the path or device on which the rootfs is located is in \*(T<\fILXC_ROOTFS_PATH\fR\*(T>. .SH "SEE ALSO" \fBlxc\fR(7), \fBlxc-create\fR(1), \fBlxc-destroy\fR(1), \fBlxc-start\fR(1), \fBlxc-stop\fR(1), \fBlxc-execute\fR(1), \fBlxc-console\fR(1), \fBlxc-monitor\fR(1), \fBlxc-wait\fR(1), \fBlxc-cgroup\fR(1), \fBlxc-ls\fR(1), \fBlxc-info\fR(1), \fBlxc-freeze\fR(1), \fBlxc-unfreeze\fR(1), \fBlxc-attach\fR(1), \fBlxc.conf\fR(5) .SH AUTHOR Serge Hallyn <\*(T>