Adding drives and switching between Raid systems

Status
Not open for further replies.

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
I'm new at FreeNas.

(1) The first question is if it's possible to add drives to a Raid array thats's already got data on it and (2) the second question is if it's possible to switch between Raid's (1 to 5 and 5 too 6) while there is already data on the array. At the moment I have 5 2TB drives (drive1-5) that are full with data and 1 2TB (drive6) drive that's empty. Just bought a new computer housing, mainboard, memory, powersupply, and pendrive. So at the moment I'm fresh out of cash to buy extra drives and don't have another way to backup the data.

I can start my new FreeNAS with one empty drive (drive6). Afther I have FreeNAS up and running with drive6 in Riad 0 I would like to copy the data from drive1 to the NAS (drive6) and then wipe drive1 so that I can add it to the array with drive6 in Raid 0 without losing the data that I just copied to drive 6. I'll have too repeat this a couple of times untill I have them all in Raid 0. Afther that I'll probably want to change the Raid 0 to Raid 5 or 6.

Is this possible?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Read my noobie guide (link in my sig). We've discussed this topic to death, so you shouldn't even need to ask the question....
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Read my noobie guide (link in my sig). We've discussed this topic to death, so you shouldn't even need to ask the question....

I'm sorry, but i don't understand. What's a sig?
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Read the Pp presentation. If I understand it correctly the zfs system adds an extra layer to the system (drive, VDev/raid, zpool (volume)).

I believe my problem is the amount of data that has to be moved and the shotage of free disks.

5x 2tb and only one spare/empty disk. Non of them are zfs. So I could make the spare disk (disk6) zfs and VDev 6 and add it to the zpool. Afther that I can copy the data from one of the other disks (disk1) to this zpool and erase the data from disk1, freeing it up to change it to zfs and VDev1 and adding it to the zpool. Repeating this for all the disks wil get me a zpool with VDev 1-6 with 2tb free and no redundancy.

So now the question is, how do I change this zpool to a zpool with some form of redundancy and If possible to a Raid setup with some speed and redundancy benefits, without losing my data and having to buy new drives?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
ZFS is basically a combined volume manager and filesystem.

So now the question is, how do I change this zpool to a zpool with some form of redundancy and If possible to a Raid setup with some speed and redundancy benefits, without losing my data and having to buy new drives?

You don't.

Basically the best you can do is to find a way to back up the data you have, create the pool you want, and then fill 'er up. But if you're going to be adding more data to this pool, you'll want more free space because adding free space later is kinda hard.

Once you add a vdev to a pool, it is part of the pool and cannot be removed.
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Jgreco, thanks. I was afraid of that. So I'll need 10TB of extra storage to make a New VDev and zpool so I can move the data, afther which I can add the old disks to a new VDev.

Any advise regarding using big hdd's (4 or 6TB) or better use smaller drives (2 or 3TB), or doesn't it make a difference in speed and reliability, using the same ammount of drives. Was thinking about using 5 WD Red's 4TB each.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That's approximately correct. The 6TB drives command too much of a price premium to be practical to a cost-sensitive user, but 4's are not much more expensive than 3's. There's an effect involved here where you need to contemplate the parity drive cost, however, and it gets a little funny to think about.

A 2TB Red is around $100. A 3TB Red is around $120. A 4TB is around $160.

So let's talk about getting 10TB of space in RAIDZ2, which is the minimum you ought to consider.

For 2TB drives, that's 7 drives, or $700.

For 3TB drives, that's 6 drives, or $720, and you get 2TB more on top of it (12TB)

For 4TB drives, that's 5 drives, or $800, and you get 2TB more on top of it (12TB)

But you might also want to consider that ZFS does not want you to fill a pool; you're not really supposed to fill a pool above maybe 80%. So either of those latter two options is already full, and the first one actually requires an extra drive to get you some free space, which makes the 2TB drive option a terrible option.

If you're really strapped for cash, then the 3TB's have it, and that also follows the power-of-two rule for RAIDZ vdevs. You can get the 5 4TB drives and that'll work, but it is a nonoptimal configuration, so if speed is an issue, pop for one more drive and you wind up with 16TB of usable storage space and you're again following the power-of-two rule.

Adding the old 2TB drives to another vdev will also give you a speed boost.
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
By the way, if it's impossible to add drives to a VDev after it's a zpool, I believe this means that You'll always have to build your raid with new drives and therefore wil never be able to add your old drives to the new raid. Thos, unless you have extra storage to BU the data (that you don't have, otherwise you wouldn't be upgrding the system). This seems to me to be kind of a corporate thing aimed at selling more drives and/or renting out extra storage by big datacenters. It would save a lot of money and drives if this wouldn't be necessary.

That said, thank you guys for all your help by answering my questions!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Wait wait wait, you've got that backwards. You cannot add drives to a vdev, correct, but a vdev isn't a pool. A pool is built out of vdevs. You only have one vdev. You can add another vdev to your existing pool which would immediately remedy your issue.

The other thing you can do is to use the autoexpand property and replace all the 3TB drives in the existing vdev with larger drives. This involves taking the disks offline one at a time, replacing it, and resilvering it. The moment you do the last replace, ZFS will expand the vdev's capacity to fill those drives.

Adding space is quite possible with ZFS, but not trivial, which is what I meant when I said "adding free space later is kinda hard".
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
@jgreco

Or I'm totally not understanding the system or my post was probably not very clear.

I understand that the raid in zfs is build in the VDev and not in the zpool (volume). Let's say that you have three drives: drive1 has data, drive2 has data and drive3 is empty. Add drive one to a VDev and make it a volume (zpool). Copy the data from drive1 to the zpool and erase drive1. Make a VDev of drive1 and add it to the zpool. Do the same with drive2. Now you have three VDevs in the zpool. As I undrstand it it will never be possible to merge these VDevs in a way so that you can setup a different kind of Raid..... ?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah, read my noobie presentation. That will clear up your misconceptions. ;)
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Read it again. It reads, one or more drives go in a VDev. The Raid is created in the VDev. Once a VDev is created you can't change it any more. One or more VDevs go int o a zpool. Once the zpool is created you can still add and change the VDevs. If a VDev in a zpool fails you'll loose the zpool. But you can still recover the data from other VDevs in the zpool besides the failed VDev.

I believe this was exactly what I posted before, meaning that you can only build a Raid from new empty drives... Am I seeing somthing wrong?
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
By the way, please excuse my english. It isn't my primary language
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Read it again. It reads, one or more drives go in a VDev.
Correct.
The Raid is created in the VDev.
Correct.
Once a VDev is created you can't change it any more.
Correct, with the exception of making a single disk into a mirror or vice versa (though neither of those operations can be done through the GUI).
One or more VDevs go int o a zpool.
Correct.
Once the zpool is created you can still add and change the VDevs.
Almost correct. You can add vdevs to a zpool, but you cannot change or remove them.
If a VDev in a zpool fails you'll loose the zpool.
Correct.
But you can still recover the data from other VDevs in the zpool besides the failed VDev.
No, you will not be able to recover any data from the pool if one of its vdevs fails, unless you're very very lucky and/or spend a great deal of money on data recovery.
meaning that you can only build a Raid from new empty drives... Am I seeing somthing wrong?
You can use used drives, but you'll lose any data on them when you add them to a ZFS volume.
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
You can add vdevs to a zpool, but you cannot change or remove them.[/QUOTE]
You will not be able to recover any data from the pool if one of its vdevs fails, unless you're very very lucky and/or spend a great deal of money on data recovery.[/QUOTE]
You can use used drives, but you'll lose any data on them when you add them to a ZFS volume.[/QUOTE]

Danb 35, thanks for answering my post.

So a VDev is a drive or an array of drives. The zpool is kind of an allocationtable/partitiontable... Adding drives/VDevs to an existing pool means expanding the current zpool (partition) across this drive/VDev, wherby you'll loose all data that was on them.

So building a new Vdev (new, bigger and faster drives) means that the old drives will probably end-up not beeing used. So an Improvement would be to be able to add, remove and change al the parts all the time, without the weakest link problem.....
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You can replace disks in an existing vdev. For example, if you have a 6-disk RAIDZ2 vdev consisting of 6 x 1 TB disks (with a net capacity of ~ 4 TB), you can replace those disks, one at a time, with 4 TB disks. Once you've replaced the last disk, your pool capacity will increase to a net of ~16 TB.

Or, if you have room in the server, you can install those same 6 x 4 TB disks and add them to your existing pool. This will keep the existing disks (and their capacity) in the pool, and add your new disks. If you add your 6 x 4 TB disks into a new RAIDZ2 vdev, your pool's net capacity will increase to ~20 TB.
 
Status
Not open for further replies.
Top