-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Full ZFS Dataset Support (#118)
Added Full ZFS Dataset Support: - The script will now create a ZFS dataset for each jail if the 'jailmaker' directory is a ZFS dataset - The script will create the 'jails' directory as a dataset if the 'jailmaker' directory is a ZFS dataset - The script will now remove the ZFS dataset (including snapshots) when deleting the jail - Dual mode: For legacy use without datasets, it will continue to work as previously Added a guide to migrate from using directories to using ZFS datasets. Closes #80. --------- Co-authored-by: Jip-Hop <2871973+Jip-Hop@users.noreply.github.com>
- Loading branch information
1 parent
f046dd3
commit a7c4b9d
Showing
3 changed files
with
126 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# ZFS Datasets Migration | ||
|
||
From version 1.1.4 ZFS Datasets support was added to jailmaker. | ||
By default starting in v1.1.4, jailmaker will create a separate dataset for each jail if possible. This allows the user to configure snapshots, rollbacks, replications etc. | ||
|
||
Jailmaker operates in dual-mode: it supports using both directories and datasets. If the 'jailmaker' directory is a dataset, it will use datasets, if it is a directory, it will use directories. | ||
___ | ||
## Procedure to migrate from directories to ZFS Datasets | ||
|
||
### Stop all jails | ||
|
||
`jlmkr stop jail1` | ||
|
||
`jlmkr stop jail2` | ||
etc.. | ||
|
||
### Move/rename the 'jailmaker' directory | ||
|
||
`mv jailmaker orig_jailmaker` | ||
|
||
### Create the ZFS datasets for jailmaker | ||
|
||
Create all the required datasets via GUI or CLI. | ||
|
||
You need to create the following datasets: | ||
|
||
`jailmaker` | ||
|
||
`jailmaker/jails` | ||
|
||
And one for each existing jail: | ||
|
||
`jailmaker/jails/jail1` | ||
|
||
`jailmaker/jails/jail2` | ||
etc. | ||
|
||
|
||
Via CLI: | ||
``` | ||
zfs create mypool/jailmaker | ||
zfs create mypool/jailmaker/jails | ||
zfs create mypool/jailmaker/jails/jail1 | ||
zfs create mypool/jailmaker/jails/jail2 | ||
``` | ||
|
||
|
||
### Move the existing jail data into the newly created datasets | ||
|
||
Now move all the jail data: | ||
|
||
`rsync -av orig_jailmaker/ jailmaker/` | ||
|
||
Warning! It's important that both directories have the `/` at the end to make sure contents are copied correctly. Otherwise you may end up with `jailmaker/jailmaker` | ||
|
||
### Test everything works | ||
|
||
If everything works, you should be able to use the `jlmkr` command directly. Try doing a `jlmkr list` to check if the jails are correctly recognized | ||
|
||
You can also try creating a new jail and see that the dataset is created automatically. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters