create note post
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m28s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m28s
This commit is contained in:
62
content/notes/bed63.md
Normal file
62
content/notes/bed63.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
date: 2026-04-01T13:59:14.462Z
|
||||
category: bsd/zfs
|
||||
mpSyndicateTo:
|
||||
- https://blog.giersig.eu/
|
||||
aiTextLevel: "0"
|
||||
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 dataset
|
||||
```
|
||||
zfs destroy -r zroot/bastille/jails/audio
|
||||
zfs destroy -r zroot/bastille/jails/cloud
|
||||
```
|
||||
Reference in New Issue
Block a user