From 7f979b027a4b4ee883bf83c56a229f733ed8bb76 Mon Sep 17 00:00:00 2001 From: svemagie Date: Wed, 1 Apr 2026 15:59:14 +0200 Subject: [PATCH] create note post --- content/notes/bed63.md | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 content/notes/bed63.md diff --git a/content/notes/bed63.md b/content/notes/bed63.md new file mode 100644 index 0000000..c63f60b --- /dev/null +++ b/content/notes/bed63.md @@ -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 +```