# Migrating ZFS to 9.0



## bsus (Nov 12, 2011)

Hi,

There are only some days/weeks until 9.0 will get released. I wanted to make a complete reinstall of our fileserver. We're running a zfs raidz1 with five drives. My question is now:

Can I just install FreeBSD new over an USB medium or will the zfs data get lost?

Regards


----------



## kpa (Nov 12, 2011)

ZFS pools are almost completely self contained, there is one external file /boot/zfs/zpool.cache but it's not needed unless you have root on zfs setup. You can safely upgrade the OS or reinstall it from scratch without any danger of losing the pool data.


----------



## Sylhouette (Nov 12, 2011)

> You can safely upgrade the OS or reinstall it from scratch without any danger of losing the pool data.



Like said above, but make sure you have a backup!! Just in case....
Maybe you select the wrong drive, and install the OS on one of the disks belonging to the vdev of the pool.


regards
Johan Hendriks


----------



## bsus (Nov 13, 2011)

Ok thank you Good to know 

Is it recommand to use ZFS as default filesystem?
For root even theres only one drive?


Regards


----------



## kpa (Nov 14, 2011)

I wouldn't recommend ZFS on root on a server myself,  disaster recovery is a little bit too tricky compared to lets say UFS root fs on gmirror(8). For a desktop it may be useful to have everything on ZFS  but I find ZFS little bit of an overkill for desktop machines. YMMV


----------



## fluca1978 (Nov 14, 2011)

I think it is better to have the / on a separate disk from your file storage, in such case you can either:
(a) install a new hard drive to keep only the system and mount the storage
(b) change the filesystem of / (using UFS with gmirror/gstripe is a good advice)

Please also note that you can export and import the zfs filesystem, so this is a good way to have a backup before installing (if you have enough space of course).


----------



## bsus (Nov 14, 2011)

I didn't had good experience with gmirror...always resilvering somehow..

The system is already seperated from the data at the moment I use one drive with ufs with all system data and 4 drives in a raidz1 as home-storage.
Just if there will be another server it should be better to have a raid1 for the system to have a better reliable.




> Please also note that you can export and import the zfs filesystem


What do you mean exactly?


----------



## fluca1978 (Nov 15, 2011)

bsus said:
			
		

> What do you mean exactly?



Zfs has a couple of commands called _export_ and _import_ that are used to "move" a storage from a system to another (or behind the same system).
This can be useful when migrating a set of disk to another machine or to sync a system with another live system. Here you can find some documentation.


----------



## bsus (Nov 16, 2011)

Ok thank you


----------

