UFS UFS to ZFS

Hi!
During the setup I selected UFS and been "living" with it until today.
But I would like to try ZFS again.
I would like to know if there's a way to convert from UFS to ZFS in place, without data loss?
What is the best way to turn my UFS filesystem into ZFS, if there's a way at all?

Thank you.
 
As far as I know you can use a file stored on UFS as a device to create a ZFS pool.
It may be useful if you want to try ZFS.
 
Hi!
During the setup I selected UFS and been "living" with it until today.
But I would like to try ZFS again.
I would like to know if there's a way to convert from UFS to ZFS in place, without data loss?
What is the best way to turn my UFS filesystem into ZFS, if there's a way at all?

Thank you.
dump(8)/restore(8)?
 
Hi!
During the setup I selected UFS and been "living" with it until today.
But I would like to try ZFS again.
I would like to know if there's a way to convert from UFS to ZFS in place, without data loss?
What is the best way to turn my UFS filesystem into ZFS, if there's a way at all?

Thank you.

After you backup all your data, /etc and /usr/local/etc (and other configs) you can use REROOT to do that on the fly.

Details are here: https://people.freebsd.org/~lidl/blog/re-root.html

The idea is to create RAMDISK that will hold your system (4-12 GB of RAM) - copy file there - create new ZFS layout - copy files from RAM to ZFS on disk.
 
Just copying all the files only will not do,
since you need to make the system capable to boot and work with zfs (load the kernel module zfs.ko).

The script vermaden linked respects this in the two lines:
Code:
# Fixup the system to be able to boot via zfs.
echo 'zfs_load="YES"' >> /mnt/boot/loader.conf
echo 'zfs_enable="YES"' >> /mnt/etc/rc.conf
Those entries are missing in your UFS' installation /boot/loader.conf and /etc/rc.conf, but needed to be added.
Otherwise the system will not reboot properly anymore.

And of course as Alain De Vos pointed out, the fstab needs to be adapted, too.

btw. I recommend using labels for the partitions getting into the zpool(s).
 
You can only restore(8) to UFS.


You can't 'convert' UFS to ZFS, you're going to need to reinstall.
That's the answer I was afraid of.

What if I get another disk, reinstall FreeBSD in a new ZFS and use the original disk as an external drive (USB adapter) then just sync data from one to another, will it work?
In this process I have to make sure to keep ZFS drivers getting loaded at boot, etc.
 
if it's only /boot/loader.conf & /etc/... /usr/local/etc/... & /home/... , then you can .tar.gz the files/directories and store them in a tmpfs (in-memory) or on a usb-stick.
 
Back
Top