-
Notifications
You must be signed in to change notification settings - Fork 3
/
overview-zfs-layout.txt
63 lines (49 loc) · 2.4 KB
/
overview-zfs-layout.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
The following is a proposed overview of the zfs layout for jail environments.
First off, there is a root dataset to contain the jail datasets and jail environment datasets:
zroot/JAIL
A jail dataset is the top-level dataset for a given jail. The name of
a jail dataset should correspond to a jail name in jail.conf:
zroot/JAIL/$jailname
A jail dataset can have one or more jail environments associated with it,
example of a jail with one jail environment:
zroot/JAIL/$jailname
zroot/JAIL/$jailname/$jail_environment
An example of a jail with three different jail environments:
zroot/JAIL/$jailname
zroot/JAIL/$jailname/12.1-RELEASE-p0
zroot/JAIL/$jailname/12.1-RELEASE-p4
zroot/JAIL/$jailname/12.1-RELEASE-p7
The jail dataset (i.e., zroot/JAIL/$jailname) uses a zfs user property,
`je:active`, to determine which jail environment to use. The
`je:active` property is managed by the jectl(?) command line utility,
and should not need to be set explicitly.
Datasets that are a child of or added to the currently active jail
environment will persist after the jail environment has been updated.
Here's an example, let's say we have a jail named 'www':
zroot/JAIL/www
And there are two jail environments available to `www`:
zroot/JAIL/www
zroot/JAIL/www/12.1-RELEASE-p0
zroot/JAIL/www/12.1-RELEASE-p4
Let's assume `www` jail also has two persistent datasets and that the
active jail environment is 12.1-RELEASE-p0:
zroot/JAIL/www
zroot/JAIL/www/12.1-RELEASE-p0
zroot/JAIL/www/12.1-RELEASE-p0/persistent0
zroot/JAIL/www/12.1-RELEASE-p0/persistent1
zroot/JAIL/www/12.1-RELEASE-p4
To upgrade `www` from 12.1-RELEASE-p0 to 12.1-RELEASE-p4:
jectl --jail www --activate 12.1-RELEASE-p4
The above command will now have the zfs layout looking like:
zroot/JAIL/www
zroot/JAIL/www/12.1-RELEASE-p0
zroot/JAIL/www/12.1-RELEASE-p4
zroot/JAIL/www/12.1-RELEASE-p4/persistent0
zroot/JAIL/www/12.1-RELEASE-p4/persistent1
The persistent datasets are kept under the active jail environment, to
take advantage of mountpoint inheritance. When a jail environment is
swapped out, a few things occur:
1. The active (soon to be old), jail environment is unmounted.
2. The persistent datasets are moved over to the new jail environment
3. The mountpoint is set on the new jail environment
4. The jail dataset sets 'je:active' to reflect the new jail environment.