jailmaker/docs/zfsmigration.md

61 lines
1.7 KiB
Markdown
Raw Normal View History

2024-05-09 12:33:27 +00:00
# Jailmaker Docs
## 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.
2024-05-09 12:33:27 +00:00
### Procedure to migrate from directories to ZFS Datasets
#### Stop all jails
2024-05-28 18:55:46 +00:00
`./jlmkr.py stop jail1`
2024-05-28 18:55:46 +00:00
`./jlmkr.py stop jail2`
etc..
2024-05-09 12:33:27 +00:00
#### Move/rename the 'jailmaker' directory
`mv jailmaker orig_jailmaker`
2024-05-09 12:33:27 +00:00
#### 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
```
2024-05-09 12:33:27 +00:00
#### 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`
2024-05-09 12:33:27 +00:00
#### Test everything works
2024-05-28 18:55:46 +00:00
If everything works, you should be able to use the `./jlmkr.py` command directly. Try doing a `./jlmkr.py 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.