# ZFS pool creation - preserving data?



## mefizto (Mar 9, 2012)

Greetings all,

when I experimented with ZFS on FreeBSD, I created a data pool comprising one disk.  As my need for space is growing, I would like to transition to a raidz1.  Consequently I purchased additional two disks with the same size as the first disk.  Is there a way I could create raidz1 pool from the three disks so that the data from the first disk are preserved?

Kindest regards,

M


----------



## phoenix (Mar 9, 2012)

You have to create the pool using 2 disks and a file.  Then export the pool, delete the file, and import the pool in a degraded state.  Then copy the data from the single-disk pool to the degraded pool (zfs send/recv works well for that).  Finally, you destroy the old pool, and "zpool replace" the missing file with the disk, leaving you with a 3-disk raidz1 vdev.


----------



## mefizto (Mar 9, 2012)

phoenix,

thank you very much for the reply.  The instructions are clear except the statement:



> You have to create the pool using 2 disks and a file.



I understand how to create a pool with two disks.  But what about the file?  I will try to investigate, but if you could kindly point me to the right direction, I would appreciate it.  Or write the command so that I can learn more?

Kindest regards,

M


----------



## ctengel (Mar 10, 2012)

When you do a *zpool create* you can specify the name of a regular file as a vdev (as opposed to a block device).  The tricky part here though would be having a file big enough.


----------

