# Moving a zpool from FreeBSD 8.0 to Opensolaris



## wonslung (Dec 23, 2009)

I've got a zfs system that i need to move to opensolaris.  Personally, i prefer working with FreeBSD because i know a lot about more about it but the guy the system belongs to wants it on opensolaris.  The problem is, i'm fairly sure he create the current zpool without using pass-through devices, so they are all tied to the raid card.  This card isn't compatible with opensolaris, so he is replacing it.  

Heres the questions:
We have 8 sata ports left on the current system (4 on the raid card and 4 on the motherboard)  If i set the 4 on the raid card as passthrough devices, what's the best way to create a pool which can be imported into opensolaris. Will Opensolaris be able to import a pool created on FreeBSD devices (formatted with 1 giant freebsd partiton)

If not, what's the best way to do this?

Thanks for any help.


----------



## deepdish (Dec 26, 2009)

wonslung said:
			
		

> Will Opensolaris be able to import a pool created on FreeBSD devices (formatted with 1 giant freebsd partiton)



With respect to zpool's created and ran in FreeBSD, there should no problems when exporting it to OpenSolaris, mainly because ZFS is more up-to-date then it is on FreeBSD. Going the other way is where you will run into headaches. As you mentioned earlier in your post, the only issues going from FreeBSD to OpenSolaris would usually be driver availability for the hardware. 

FreeBSD 8.0-RELEASE uses ZFS version 13. Last time I used OpenSolaris 2009.06, the ZFS version on the install was at version 14. After updates, I believe it is now at version 22, which includes deduplication (correct me if this is wrong).


----------



## hedwards (Dec 26, 2009)

Moving the disks to a different RAID card is the only part which might get dicey, depending upon whether or not it uses a proprietary format.

The filesystem itself just needs to be exported and imported. I'd recommend against upgrading the ZFS version unless you're absolutely positive that you won't want to go back until FreeBSD has caught that version.


----------



## wonslung (Dec 26, 2009)

deepdish said:
			
		

> With respect to zpool's created and ran in FreeBSD, there should no problems when exporting it to OpenSolaris, mainly because ZFS is more up-to-date then it is on FreeBSD. Going the other way is where you will run into headaches. As you mentioned earlier in your post, the only issues going from FreeBSD to OpenSolaris would usually be driver availability for the hardware.
> 
> FreeBSD 8.0-RELEASE uses ZFS version 13. Last time I used OpenSolaris 2009.06, the ZFS version on the install was at version 14. After updates, I believe it is now at version 22, which includes deduplication (correct me if this is wrong).




I'm mostly worried about partion schemes...or drive labels or whatever OpenSolaris uses (i think it uses EFI labels.


I'm not worried about the raid card because i'm just going to create the second pool with passthrough devices.

I'm not sure if the current pool is set up with passthrough devices or not but seeing as i have 8 open sata ports on the machine right now, my plan was to do this:

Create a second pool with these 8 drives (maybe one big 8 drive raidz)  Then copy the data i wish to back up from the first pool to the second pool.

Import this new pool into opensolaris, destroy the original pool and create a new pool inside of opensolaris then copy the data over.

The only thing that really matters, and what i'm really looking for is:

How should i create this pool in FreeBSD 8.0?

I need to be sure that when i DO create it, i'll be able to import it.


----------



## wonslung (Jan 3, 2010)

Just an update.

After talking to some people on talk-zfs in the opensolaris mailing lists, we came up with method which works very well for moving data from FreeBSD zfs to Opensolaris.

Basically, you have to boot a Opensolaris Live CD and use the 

```
format -e
```
tool
then use fdisk, create a 100% opensolaris drive, then use label to switch it to an EFI label (if you try to label it without using fdisk first, it just doesn't work)

Do this for all drives which you wish to make a pool with in FreeBSD

use these EFI labeled drives to create a zpool in FreeBSD  (you will get errors that look like this:

```
Jan  2 21:51:14 vbox kernel: GEOM: da4: corrupt or invalid GPT detected.
Jan  2 21:51:14 vbox kernel: GEOM: da4: GPT rejected -- may not be recoverable.
```
but it doesn't seem to matter.

Once you have your new Zpool, copy all your data from FreeBSD, then export the pool
install Opensolaris, import the pool.

I tried this in Virtualbox with 4 small virtual hard drives, and later on bare metal.

It seems to work well.

I'm not 100% sure about doing a simple import/export outside of this method....i would imagine it MIGHT work but this wasn't an option for me because of stupid choices i made with my old raid controller.

just thouhgt i'd share.


----------

