Creating new BE’s using snapshots and clones can get messy with dependencies all over the place. I had an epiphany the other day, why not create a snapshot on the current dataset, send that snapshot to a new dataset within the same zpool (or elsewhere), and subsequently destroy the (two!) snapshots?
Instant transfer of data, and no strings attached to either dataset once the snapshots have been removed.
zfs snapshot zroot/ROOT/current-be@transfer zfs send zroot/ROOT/current-be@transfer | zfs receive -uv zroot/ROOT/new-be zfs destroy zroot/ROOT/current-be@transfer zfs destroy zroot/ROOT/new-be@transfer
Maybe a new
zfs copy command should be created to simplify the typing when copying datasets within a zpool.
- Mount the new BE on, say,
make -C /usr/src DESTDIR=/new-be installworld installkernel, ensures new versions overwriting old versions.
mergemaster -Fi -D /new-be, ensures configuration changes are merged into the new BE.
make -C /usr/src DESTDIR=/new-be delete-old, ensures obsolete stuff are removed.
- Inherit the
mountpointproperty for new BE, or explicitly set the
- Update the
bootfsproperty on the zpool to point to the new BE, and reboot to begin using the new BE.
If you’re not short on disk space, the above suggestion might be an acceptable compromise.