64 lines
2.0 KiB
Markdown
64 lines
2.0 KiB
Markdown
---
|
||
date: 2026-04-01T13:59:14.462Z
|
||
category: bsd/zfs
|
||
aiTextLevel: "0"
|
||
syndication:
|
||
- https://blog.giersig.eu/notes/bed63/
|
||
updated: 2026-04-01T14:01:45.287Z
|
||
mpUrl: https://blog.giersig.eu/notes/bed63/
|
||
permalink: /notes/bed63/
|
||
---
|
||
|
||
The beauty of ZFS! I’ve got some extra space, so I’m moving some large jails there, where they can live happily ever after.
|
||
|
||
Step 1 - Stop both jails.
|
||
|
||
Step 2 - Create parent datasets on new pool "store":
|
||
```
|
||
zfs create -o mountpoint=none store/bastille
|
||
zfs create -o mountpoint=none store/bastille/jails
|
||
```
|
||
Step 3 - Snapshot both jail datasets:
|
||
```
|
||
zfs snapshot -r zroot/bastille/jails/audio@migrate
|
||
zfs snapshot -r zroot/bastille/jails/cloud@migrate
|
||
```
|
||
Step 4 - Transfer to "store":
|
||
```
|
||
zfs send -R zroot/bastille/jails/audio@migrate | zfs recv -o mountpoint=none store/bastille/jails/audio
|
||
zfs send -R zroot/bastille/jails/cloud@migrate | zfs recv -o mountpoint=none store/bastille/jails/cloud
|
||
```
|
||
|
||
Step 5 - Unmount old datasets and disable auto-mount:
|
||
```
|
||
zfs unmount -f zroot/bastille/jails/audio
|
||
zfs unmount -f zroot/bastille/jails/cloud
|
||
zfs set canmount=noauto zroot/bastille/jails/audio
|
||
zfs set canmount=noauto zroot/bastille/jails/audio/root
|
||
zfs set canmount=noauto zroot/bastille/jails/cloud
|
||
zfs set canmount=noauto zroot/bastille/jails/cloud/root
|
||
```
|
||
Step 6 - Set mountpoints on new datasets (children inherit):
|
||
```
|
||
zfs set mountpoint=/usr/local/bastille/jails/audio store/bastille/jails/audio
|
||
zfs set mountpoint=/usr/local/bastille/jails/cloud store/bastille/jails/cloud
|
||
```
|
||
Step 7 - Mount new datasets:
|
||
```
|
||
zfs mount store/bastille/jails/audio
|
||
zfs mount store/bastille/jails/audio/root
|
||
zfs mount store/bastille/jails/cloud
|
||
zfs mount store/bastille/jails/cloud/root
|
||
```
|
||
Step 8 - Quick sanity check:
|
||
```
|
||
ls /usr/local/bastille/jails/audio/root/srv/funkwhale/
|
||
ls /usr/local/bastille/jails/cloud/root/usr/local/www/cloud/
|
||
```
|
||
|
||
Step 9 - destroy the old datasets:
|
||
```
|
||
zfs destroy -r zroot/bastille/jails/audio
|
||
zfs destroy -r zroot/bastille/jails/cloud
|
||
```
|