Mirror Questions

Status
Not open for further replies.

chip33az

Cadet
Joined
Jun 3, 2013
Messages
3
Hello,

I was thinking about building a NAS using FreeNAS and had a couple of questions about how mirroring works.

I thought I would start out with 2 1TB drives mirrored using ZFS. If I pull a drive out, can it be read by any system that can read ZFS (since it is mirrored, I would assume yes)?

What happens when I go to add 2 more drives and extend the mirror (like a RAID10)? Can the existing data on the original mirror be redistributed to all 4 drives?

What happens if the original mirror is almost full before I add two more drives? Since the data would be written to all four drives, couldn't the first 2 fill up and cause issues?

Thanks for any answers you can give.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I thought I would start out with 2 1TB drives mirrored using ZFS. If I pull a drive out, can it be read by any system that can read ZFS (since it is mirrored, I would assume yes)?

You'd be better off assuming no. Mirroring is data protection, not a cheapskate's shortcut to copying drives. Once you pull a drive and lose redundancy, your data is no longer redundant.

What happens when I go to add 2 more drives and extend the mirror (like a RAID10)? Can the existing data on the original mirror be redistributed to all 4 drives?

No. However, as new data is put into the pool, ZFS will manage it intelligently.

What happens if the original mirror is almost full before I add two more drives? Since the data would be written to all four drives, couldn't the first 2 fill up and cause issues?

No, because "Since the data would be written to all four drives" is not the way it works.
 

chip33az

Cadet
Joined
Jun 3, 2013
Messages
3
Thank you for the reply.

I know mirroring is for data protection, but since both drives would be identical, I was just curious if one could pull out a drive and read it in another computer that could read the ZFS format. I know I would lose the data protection, more of a general question.

I guess I'm a little surprised that the data would not be written to all 4 drives (well, two drives and their mirrors). I thought it would behave more like a striped setup where the data would be spread across all 4 (again, 2 drives and their mirrors).

Thanks again.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I guess I'm a little surprised that the data would not be written to all 4 drives (well, two drives and their mirrors). I thought it would behave more like a striped setup where the data would be spread across all 4 (again, 2 drives and their mirrors).

So if you have a pool with a 2TB vdev and a 1TB vdev, what you are expecting is that it will treat the 2TB vdev as a 1TB vdev in order that it might stripe equally across all drives all the time.

ZFS is more intelligent than that. If you want simplistic behaviour, ZFS is not for you. ZFS will attempt to intelligently manage the storage you throw at it. It will attempt to balance where it stores things based on several variables, such as the amount of free space on a vdev, and for multiple vdevs, it will spread the data amongst them if it is reasonable to do so.
 

chip33az

Cadet
Joined
Jun 3, 2013
Messages
3
That is exactly what I was looking for. I was just curious how it worked and this answers the questions.

Thanks.
 
Status
Not open for further replies.
Top