ZFS Pool questions - help me understand.

styx0r

Limp Gawd
Joined
Jul 28, 2008
Messages
301
I've just spent the last few hours reading about ZFS configurations, and I have a working install of napp-it up and running to play with.

I understand that pools are the basic storage organization method. They are made up of Virtual Devices, or Vdevs.

Let's assume I have 5 identical 2TB drives.

Let's say I created a pool tank with two Vdevs, and fill it with 1TB of data.

Tank:
(2) 2TB drives mirrored = vdev 1
(3) 2TB drives RAIDZ = vdev 2

Now, I know this isn't a recommended configuration - all vdevs should have identical redundency characteristics - but I want to understand this:

Now, let's say I buy a 6th 2TB drive, and I want to convert the 2TB mirrored vdev into a (3) 2TB RAIDZ, so I end up with:

Tank:
(3) 2TB drives RAIDZ = vdev 1
(3) 2TB drives RAIDZ = vdev 2

Can I force the data onto the RAIDZ(vdev 2) and off the mirror(vdev 1), before I remove vdev 1? And then, (re)create vdev 1 as a RAIDZ with my 6th drive?
 
As far as I know you can't change the type of vdev in a pool. If you create a mirror your stuck with a mirror even if you add a third drive. You would have to create an entirely new pool to convert it. Here is a link to an article where someone has done just that (link). It is also not recommended that you don't combine different types of VDEV's within a pool as this will just complicate things when you go to expand. What I recommend would be to create a pool with a single 3 disk raidz vdev. Then expand your pool by adding a second raidz vdev of 3 disks when you get the 6th disk.

Or just buy the 6th disk and make a single raidz2. (2x 3 disk raidz1 < 1x 6 disk raidz2)
 
A ZFS pool does not care about the vdevs it consists of.
You can mix any type of vdevs to increase capacity but you can currently
not convert a vdev from one type to another beside basic to mirror.

You should only care about keeping overall redundancy level.
The rest is a question of economy and a balanced structure for better performance.
 
I don't believe you can ever remove a vdev at all from a pool. And as others have mentioned you can't ever change a vdev's type (with the exception of adding or removing mirrors from a mirror, but it's still only a mirror).
 
Ok, I appreciate your replies - I feel like I did a bad job of explaining.

I know you can't convert the mirror to a RAIDZ.

I was imagining something like:

1. Delete mirror vdev
2. Create RAIDZ vdev

-Without losing data. In my example, there's only 1TB of data being stored, which can easily fit on vdev 2. My question was specifically if I can flush the data stored on the mirror vdev before removing it from the pool.
 
Ok, I appreciate your replies - I feel like I did a bad job of explaining.

I know you can't convert the mirror to a RAIDZ.

I was imagining something like:

1. Delete mirror vdev
2. Create RAIDZ vdev

-Without losing data. In my example, there's only 1TB of data being stored, which can easily fit on vdev 2. My question was specifically if I can flush the data stored on the mirror vdev before removing it from the pool.


ZFS spreads data over all vdevs for speed, capacity and redundancy.
If you delete a vdev you kill the pool

You can only backup to a second pool and destroy/ recreate the pool
 
Last edited:
1. Delete mirror vdev

Simply, ZFS does not support this. You can not remove a vdev from a pool. You can destroy the pool and start over, but then it's obviously up to you to move your data around.
 
Thanks again for all the input - I really appreciate it! I now understand - vdevs are there for the life of the pool.
 
Create 2 different pools then

Pool 1
2 x 2tb drives Mirror < vdev1

Pool 2
3 x 3tb Drives Raidz < vdev1

When you want to move the 2 x 2tb mirror into a RaidZ

Copy the data off of the Pool 1 - Onto Pool 2
Destroy Pool 1

Recreate Pool 1 as a 3 x 2tb RaidZ

Copy your data back from Pool 2 onto Pool 1

.;)
 
Back
Top