Upgrade ZFS Mirror

Status
Not open for further replies.

John Gorst

Dabbler
Joined
Dec 18, 2014
Messages
15
FreeNas 9.3-stable on N40L 8gb

I have two 500gb (approx) disks running as a ZFS mirror.
I want to change them to two 3gb disks.
I have capacity to have all four to be installed at the same time.

If I use the GUI I need to 'replace' one of the 500gb disks with a 3tb disk.... this means I am running on only one disk whilst it is replicating which will be slower and more 'risky'

Can I just use the CLI to attach the 3gb disks to the Mirror and later remove the old ones?

(where ada2 and ada3 are the new 3tb disks)
Code:
zpool attach datastore ada2 ada3  
(give it time to resilver)   
zpool detach datastore ada0 ada1


However I note that the existing disks seem to have partitions on them...swap file and random space?. Do I need to replicate this swap file partition and how?

I have found similar questions in the past but can't find a succinct answer for a recent version. A previous answer asked for a 8gb swap file in a gpart command so I was not entirely convinced to its reliability.

Code:
[root@garage] ~# gpart show ada0
=>       34  976773101  ada0  GPT  (465G)
         34       2014        - free -  (1M)
       2048  976754688     1  !6a898cc3-1dd2-11b2-99a6-080020736631  (465G)
  976756736      16384     9  !6a945a3b-1dd2-11b2-99a6-080020736631  (8.0M)
  976773120         15        - free -  (7.5k)


Thanks for any help
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Since you have the capacity to plug in all the disks at once, you can simply do so and use the GUI to Replace each of your existing disks (one at a time). This way you will maintain redundancy throughout the resilvering process.
 

John Gorst

Dabbler
Joined
Dec 18, 2014
Messages
15
Sorry, just to clarify.

If I use the GUI to 'replace' a disk it will, for a short time, there will be three disks in the mirror whilst resilvering. Once resilvered to the 2Tb disk it will then automatically remove the one of the old 500gb disk. I then do the same with the other 500gb disk. It will then increase to a 2Tb volume automatically (autoexpand feature is enabled according to 'zpool get all datastore')

Will I need to keep the GUI open for the whole resilvering process or does it just do it in the background (I would imagine 450Gb of data will take a while on an Atom processor!)

Thanks for your assistance
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
My understanding is that during the process you will have a mirror and an additional disk, not a 3-way mirror. If you do 'zpool status' in the shell it will show a mirror and a replacement in progress, not a 3-disk mirror.

The old disk will be automatically removed when the new disk has resilvered.

The volume size will increase automatically after both disks have been replaced.

You do not need to keep the GUI open during the resilvering process.

By the way, this process works on any vdev (except a stripe), not just mirrors, as long as the system can accommodate at least one additional disk. It's really just a simpler, safer alternative to section 8.1.11 of the manual.
 

david kennedy

Explorer
Joined
Dec 19, 2013
Messages
98
If you plan to run all the drives at once why not just "zfs send" to a new pool and then swap them out when it is done?
 

david kennedy

Explorer
Joined
Dec 19, 2013
Messages
98
I had tried this once some time ago when getting into freenas.

Zfs send duplicates everything, once it is done export and import the pools and it should be good.


Just a thought, but replacing the mirrors should also work.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I've done it both ways, and I've found disk replacement to be simpler and less error-prone when available ports allow. Last time I used the send | receive method (because I was also changing the vdev geometry) I was super careful and somehow my plugins still disappeared. The jails and all the data were there but the plugins were gone from the GUI and I had to reinstall them.
 
Status
Not open for further replies.
Top