From ec16945ebfe64d5cd5403ae1a1b16bc05a779a16 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2014 03:50:59 +0100 Subject: nspawn: beef up nspawn with some btrfs magic This adds --template= to duplicate an OS tree as btrfs snpashot and run it This also adds --ephemeral or -x to create a snapshot of an OS tree and boot that, removing it after exit. --- man/systemd-nspawn.xml | 98 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 82 insertions(+), 16 deletions(-) (limited to 'man/systemd-nspawn.xml') diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 75db65eac0..b66c34df01 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -165,14 +165,78 @@ Directory to use as - file system root for the container. If - neither - nor are + file system root for the container. + + If neither + , nor + is specified + the directory is determined as + /var/lib/container/ + suffixed by the machine name as + specified with + . If + neither , + , nor + are specified, the current directory will - be used. May not be specified together with + be used. May not be specified together + with . + + + + Directory or + btrfs subvolume to + use as template for the container's + root directory. If this is specified + and the container's root directory (as + configured by + ) does + not yet exist it is created as + btrfs subvolume and + populated from this template + tree. Ideally, the specified template + path refers to the root of a + btrfs subvolume, in + which case a simple copy-on-write + snapshot is taken, and populating the + root directory is instant. If the + specified template path does not refer + to the root of a + btrfs subvolume (or + not even to a btrfs + file system at all), the tree is + copied, which can be substantially + more time-consuming. Note that if this + option is used the container's root + directory (in contrast to the template + directory!) must be located on a + btrfs file system, + so that the btrfs + subvolume may be created. May not be + specified together with + or + . + + + + + + + If specified, the + container is run with a temporary + btrfs snapshot of + its root directory (as configured with + ), that + is removed immediately when the + container terminates. May not be + specified together with + or + . + + @@ -197,7 +261,9 @@ partitions, swap partitions or EFI system partitions are not mounted. May not be specified together with - . + , + or + . @@ -653,13 +719,13 @@ =MODE Boots the container in - volatile (ephemeral) mode. When no - mode parameter is passed or when mode - is specified as yes - full volatile mode is enabled. This - means the root directory is mounted as - mostly unpopulated - tmpfs instance, and + volatile mode. When no mode parameter + is passed or when mode is specified as + yes full volatile + mode is enabled. This means the root + directory is mounted as mostly + unpopulated tmpfs + instance, and /usr from the OS tree is mounted into it, read-only (the system thus starts up with @@ -677,8 +743,8 @@ changes to the latter are lost on shutdown). When the mode parameter is specified as no - (the default) the whole OS tree is made - available writable. + (the default) the whole OS tree is + made available writable. Note that setting this to yes or @@ -748,13 +814,13 @@ - Boot into a btrfs snapshot of the host system + Boot into a <literal>btrfs</literal> snapshot of the host system # btrfs subvolume snapshot / /.tmp # systemd-nspawn --private-network -D /.tmp -b This runs a copy of the host system in a - btrfs snapshot. + btrfs snapshot. -- cgit v1.2.3-54-g00ecf