ufs to zfs conversion in a freebsd guest

Alan Somers asomers at freebsd.org
Sun Mar 24 22:16:53 UTC 2019


Yes, but it's probably not worth the effort. Easier to spin up 2nd vm and
copy everything over. Here is what you'd have to do:
1) shrink the root filesystem with resizefs.
2) shrink it's partition with gpart.  If it's not the last partition on the
disk, then you'll have to relocate the last (presumably swap) partition.
3) create a new zfs partition.
4) create a new zfs pool.
5) create all of the various zfs datasets just like the installer does.
6) copy over everything from / to the zfs partition except for /boot.
7) configure loader.conf to boot from zfs.  Assuming, that is, that your VM
system even runs the regular boot loader.
8) reboot and pray.
9) spin up a new VM anyway, since you inevitably screwed up something.

Good luck.

On Sun, Mar 24, 2019, 3:57 PM tech-lists <tech-lists at zyxst.net wrote:

> Hi
>
> [context is freebsd-12R-p3]
>
> Is it possible to convert a running freebsd guest from UFS to ZFS?
> It would need to be done in-situ, in the guest as there is no access to
> the host.
>
> The guest filesystem is:
>
> /dev/gpt/rootfs   /       ufs     rw      1       1
> /dev/gpt/swapfs  none    swap    sw      0       0
>
> thanks,
> --
> J.
>


More information about the freebsd-fs mailing list