Replace all Hard drives (complete array) without losing my data or configurations

haitham050

Cadet
Joined
Sep 11, 2020
Messages
8
Dear All,
I was introduced to Freenas like two month ago while was experimenting with creating a NAS. I had an Old CPU tower that has two x1 TB hard drives . I created a pool with both drives and now they are full . I like FreeNas now so I bought 3x10 TB WD drives . I want to use them to completely replace the ones I have. I looked every where for the last few days i cannot find a way to replace all my drives (replicate them to the new ones + Raid) without losing any shares, plugins, data or configurations that I did.
Thank you in advance guys from a newbie to NAS
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
How have you configured the pool now? mirrors or stripe ? and how do you want the pool to be after upgrade? stripe / 3-way mirror / raidz1 ?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
i cannot find a way to replace all my drives (replicate them to the new ones + Raid) without losing any shares, plugins, data or configurations that I did.
Given what you describe, there really isn't a direct way to do this. If you were wanting to move from 2x 1 TB disks to 2x 10 TB disks, with the same pool configuration (hopefully a mirror), it would be pretty easy--replace one disk, then the other, following the instructions in the manual. But you have 3 x 10 TB disks, and I assume you don't want to use them in a three-way mirror (you could; ZFS supports this, and it would give you great redundancy, but you'd be using 2/3 of your total capacity for redundancy). Instead, you probably want to use them in RAIDZ1, which we'd strongly discourage for that size of a disk.

To do that in general, you'd need to make a new pool on the new disks, use ZFS replication to migrate everything from the old pool to the new pool, detach the old pool and remove its disks, rename the new pool, and then start up all the services--and cross your fingers.

A better option would be to get a fourth 10 TB disk. Then replace your two 1 TB disks as discussed above, and add a second vdev of the remaining two 10 TB disks. This gets you a four-disk pool of striped mirrors (i.e., RAID10) with about 20TB of capacity, and none of the configuration needs to be changed.
 

haitham050

Cadet
Joined
Sep 11, 2020
Messages
8
you'd be using 2/3 of your total capacity for redundancy). Instead, you probably want to use them in RAIDZ1, which we'd strongly discourage for that size of a disk.

Thank you for your detailed response . But why would you discourage raidz1 for this size of disk ?. That was the aim why I bought three
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Last edited:

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
But why would you discourage raidz1 for this size of disk ?
replacing a disk in raidz1 means there is zero redundancy while resilvering. during that time any other disk failing will destroy the pool.
the bigger disks get, the longer a resilver takes, and the longer the raidz1 is in degraded state.
resilvering puts all disks in the raidz vdev at high usage as all the data needs to be read and parity calculated, if you only have one vdev then this applies to the whole pool
the longer you are in degraded state, the higher, and more likely, of another failure that would destroy the pool.
raidz1 on large drives should only be used if :
a) you dont care about the data or it is backed up.
b) you know what you are doing and the rules don't apply to you (like pirate laws)
c) you are using SSD's, which typically rebuild fast enough that the risk is dramatically lower
you should always have a backup anyway, because when zfs does die, it typically really, really dies, since its designed for enterprise and paranoid backups
 
Last edited:

haitham050

Cadet
Joined
Sep 11, 2020
Messages
8
replacing a disk in raidz1 means there is zero redundancy while resilvering. during that time any other disk failing will destroy the pool.
the bigger disks get, the longer a resilver takes, and the longer the raidz1 is in degraded state.
Thank you very much . Very valuable information. Then I will get another 10TB (hopefully on black Friday since the prices have gone up again) and see if I can do a mirror of my pool
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Thank you very much . Very valuable information. Then I will get another 10TB (hopefully on black Friday since the prices have gone up again) and see if I can do a mirror of my pool
note that if you do 2xmirrors with 4 disks, you will have at most 1 drive redundancy per vdev ( you can lose any 1 drive, or any 2 drives that arent in the same vdev). the mirrors tend to resilver more simply, and some of the administration is easier ( you can add and remove disks at the command line, which is not yet available for raidz), but unless you need the IOPS (speed) of mirrors, you might want to consider raidz2, which will give the same amount of space, but you can outright lose any 2 drives.
as a home user, you probably just want raidz2, although ideally you would want at least 6 disks when possible. (75% of the RAW available storage instead of 50%)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
as a home user, you probably just want raidz2
No, mirrors are generally fine for home use, and they're much easier to expand than a six-disk RAIDZ2 pool.
you can add and remove disks at the command line
I understand you can do this at the GUI in TN12.
75% of the RAW available storage
Six disks in RAIDZ2 would give you 66%, not 75%.

There isn't a "right" answer to RAIDZn vs. mirrors, but there are a number of relevant considerations. This article lays out many of them:

In OP's case, mirrors provide the additional benefit of being able to do all the disk replacement, expansion, etc. through the GUI, while maintaining the same pool, so no need to reconfigure anything.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Six disks in RAIDZ2 would give you 66%, not 75%.
my bad, math hard.
otherwise, i don't exactly disagree, i was more trying to give a summary of the tradeoff's, since they said they are relatively new.
the only way to match the overall redundancy of raidz2 is triple mirrors (any 2 drives can fail), at least in the lower disk counts, but that's really inefficient for space (more math, ugh 33% i think).
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
the only way to match the overall redundancy of raidz2 is triple mirrors
True. With four disks in striped mirrors, up to two disks can fail without data loss, but if the wrong two fail, your pool is toast. OTOH, resilvers are faster, so you aren't exposed for as long. I don't put much stock in the "OMG resilvers are so stressful!!!" argument (it's literally the same as a scrub, which we do as routine pool maintenance), but it's definitely true that your pool would be back to normal faster with a mirrored pool than with parity RAID.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
IIRC, @Chris Moore disagrees with mirror resilvers being all that much faster. (I can't remember what post but we got into it a bit)
simpler, yes, the speed is likely about the same. on older hardware it might have been different but reasonably modern stuff doesn't really care about the parity, just the disk transfer speed, and that's pretty much locked at150mb/s anyway
 
Last edited:

haitham050

Cadet
Joined
Sep 11, 2020
Messages
8
Sorry for the naive question. My two drives are on stripe mode. Do I need to take one offline then replace ? And repeate ? Or should I do while the drive that am replacing is online?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If you remove a drive from a pool that is built of two single drives as striped vdevs, your data will be gone.

So you could add two of your 10 T disks and attach one to each of your 1 T disks. That will form two mirrors of size 1 T but don't worry.
You could then detach the 1 T disks resulting in a striped setup of two 10 T disks. And then add the remaining two 10 T disk to build two mirrors again. Those will have size 10 T, each then.

If your case is able to hold six disks and you have enough SATA connectors you could even avoid the dangerous time when switching disks and add all four new ones, Then attach 2 each to each of your 1 T drives to build two 3-way mirrors. Then detach the 1 T drives as before, but the pool will already be redundant.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Do I need to take one offline then replace ?
You cannot take a disk offline until the replacement is finished. Power down the system, install one 10TB drive, replace one 1TB drive with the 10TB drive using the GUI. When complete, power down, remove the 1TB drive (make sure it's the right one!), and install a second 10TB drive. Replace the remaining 1TB drive with the new 10TB drive. When complete, power down, remove the remaining 1TB drive, and install the remaining 10TB drives. Then add them as mirrors of the other two 10TB drives (which I know you can do in TN12, but I'm not sure exactly how). Or do what Patrick suggests.
 

haitham050

Cadet
Joined
Sep 11, 2020
Messages
8
Thank you all . Sorry for late response as I was busy with exams . I replace the two hard-drive with another two and resilvered . It took like a whole day but things worked like a charm . Thank you again
 
Last edited:
Top