# ZFS - moving disks from one controller to another



## wszczep (Apr 1, 2014)

Hi All,

I've got raidz2 pool made from 4 disks, currently they are attached to internal ahci controller, the disks are ada1..4
To have expand possibilities in nearby future, I've bought JBOD enclosure which is connected via LSI SAS2008 controller, and disks will be named da0..11

Is it safe to just switch off the box and move disks to external enclosure, or it must be preceeded by `zpool export` command? The gpart labels will remain the same but disk devs names will be different.

Thx,


----------



## ralphbsz (Apr 1, 2014)

I think it is safe.  I've moved disks around within my computer and to an external eSATA enclosure, and they change from one adaX to a different adaY, and ZFS has no problem with that.  Conceptually, the move from adaX to daY should be the same.

I would just try it.  Worst thing that can happen is that ZFS comes up after a reboot, finds zero disks in the pool, and complains.  In that case, you can always go back, return the disks to where they came from, and do the `zpool export` before trying it again.

You have full backups, right?


----------



## phoenix (Apr 2, 2014)

If you know you will be moving disks between systems, and you will be powering the system off, do an export.  It will make your life that much simpler, and you won't have to force the import.

ZFS keeps metadata on the drives that detail which vdev of which pool the disk belongs to.  During the import, it reads the metadata off the drives and builds the pool based on that.


----------



## wszczep (Apr 2, 2014)

Ok. As the system will be powered off, I will export the pool.

Though, as ralphbsz says, it should be safe to move disks - I guess even on a life powered on system, I think it could do much unnecessary stress on disks. I mean when following something like this procedure: 
`zpool offline /dev/adaN`
detach physically disk, place it on external enclosure
`zpool online /dev/daN`
wait for resilver, 
repeat for the rest of three disks.


----------



## SirDice (Apr 2, 2014)

wszczep said:
			
		

> I mean when following something like this procedure:
> `zpool offline /dev/adaN`
> detach physically disk, place it on external enclosure
> `zpool online /dev/daN`
> ...


Yeah, don't do that, it's going to take forever. I've moved two of my RAID-Z arrays around multiple times, just power off, move the whole array and power on. The first boot may take a little longer but it shouldn't cause any issues. I've only exported the pool when I needed to move it to another machine.


----------

