# Migrating ZFS from one server to another



## cr4sh (Apr 10, 2013)

Hello.

I need to run my system FreeBSD 9.0 (ZFS, jails etc) to another disk. My first server had performance problems. I made backup of it, and sent it to a NAS. Now on another server *I* run 2 x 750G disk, install on it FreeBSD 9.1 STABLE, make zfs mirror with BE. It runs fine, latecy is on sys/ROOT/default. Now *I* get my backup and wrote it as sys/ROOT/zroot (sys/ROOT/zroot/usr, sys/ROOT/zroot/usr/jails etc.) But when *I* set
[CMD=""]zfs set mountpoint=legacy sys/ROOT/zroot[/CMD]
and 
[CMD=""]zpool set bootfs=sys/ROOT/zroot sys[/CMD]
*I* got 
	
	



```
Mounting from zfs:sys/ROOT/zroot failed with error 2
```
 and my server freees; only poweroff helps.

I find @vermaden hint that *I* need to boot from liveCD and make/copy zpool.cache. I did it, but still got that same problem.

I will be grateful for any help. Let me know if more info needed.
Regards.


----------



## kpa (Apr 10, 2013)

You probably need to set vfs.root.mountfrom in loader.conf(5)


----------



## cr4sh (Apr 10, 2013)

@kpa, 

*I*n /boot/loader.conf on sys/ROOT/zroot *I* have 

```
vfs.root.mountfrom="zfs:sys/ROOT/zroot"
```


----------



## HarryE (Apr 10, 2013)

Copy the sys/ROOT/default/boot/zfs/zpool.cache into sys/ROOT/zroot/boot/zfs/zpool.cache (check the mount points for them)

The pool most not be in "exported" state when attempting to boot from it.
HTH


----------



## cr4sh (Apr 10, 2013)

@HarryE, I don*'*t have zpool.cache on default. It was installed from STABLE without zpool.cache.


----------



## cr4sh (Apr 10, 2013)

[SOLVED]
Even ZFS is not so super, to mount spool without disks 
I need to add to /boot/loader.conf

```
mps_load="YES"
```

Thank you for your time.


----------

