How to upgrade a hdd in a raidz1 array?

Status
Not open for further replies.

globus999

Contributor
Joined
Jun 9, 2011
Messages
105
I just want to double check this procedure. Comments would be appreciated.

I have a raidz1 array (tank2) with 4 hdds (2x2Tb + 2x1Tb).
The array is getting full so I need to replace the 1Tb disks with 2Tb disks.

I don't have extra SATA ports so I need to re-use the SATA port of the disk to be replaced.

Procedure:

1 - Scrub tank2
2 - Export tank2 from the GUI (so that there are no leftovers from the GUI)
3 - Zpoo Import tank2 from CLI (so I can detach)
4 - Zpool Detach the hdd to be replaced (ada5) from CLI
5 - Zpool Export tank2 (now in degraded state) from CLI
6 - Shut the system down
7 - Physically remove ada5 and replace it with a new 2Tb hdd
8 - Bring the system up
9 - Zpool Import tank2
10 - Zpool attach the new hdd to tank2

and hopefully, zpool will start resilvering automatically

11 - Let resilvering finish
12 - Autoimport tank2 from GUI
13 - Reboot

14 - Expect the worst.....:mad:

Does this look viable or am I missing something?

Also, I don't think the "Replace" button in the HDD section of the GUI works for an hdd that needs to be replaced on the same port. Not sure though. Does anybody has any experience to this regard?
 
Joined
May 27, 2011
Messages
566
well i just tried a dry run in a VM... the autoexpand property was not added until zfs version 17. I'm not sure when FreeNAS will support this. i feel bad for saying it's so easy, i forget how antiquated the version of zfs is in freeBSD.
 

globus999

Contributor
Joined
Jun 9, 2011
Messages
105
well i just tried a dry run in a VM... the autoexpand property was not added until zfs version 17. I'm not sure when FreeNAS will support this. i feel bad for saying it's so easy, i forget how antiquated the version of zfs is in freeBSD.

Thank you very much. The script above is the best I can come up with keeping data safety in mind as the highest priority.
 
Joined
May 27, 2011
Messages
566
Thank you very much. The script above is the best I can come up with keeping data safety in mind as the highest priority.

if we were using a version of zfs that supported autoexpansion, you would basically do as you said.

except you don't need to detach the drive, just 'zpool replace' it. you don't need to reboot at all. just do drive after drive, once they are all done, set the property, then export and import. i've done it several times but apparently not on FreeNAS yet. Had to be under opensolaris or solaris express.
 

globus999

Contributor
Joined
Jun 9, 2011
Messages
105
if we were using a version of zfs that supported autoexpansion, you would basically do as you said.

except you don't need to detach the drive, just 'zpool replace' it. you don't need to reboot at all. just do drive after drive, once they are all done, set the property, then export and import. i've done it several times but apparently not on FreeNAS yet. Had to be under opensolaris or solaris express.

I tried zpool replace before (the manual says that you can simply unplug the hdd to be replaced and plug the new one in the same port) and zpool will do the rest. It does not. That's why I am doing it manually. The old drive remains as ghost and the raidz1 remains as degraded until one detaches it manually. Bummer!

Wrt the GUI, I had bad experiences before too. As far as I know the GUI is supposed to auto synch with the new raidz1 config. It does not do that. It retains the configuration of the old hdd (now gone) and then tries to control it. Result? All kind of nasty errors at the CLI level. Double Bummer!

I know that the script is a pain in the neck, but I am trying to do it as bullet-proof as possible. At this stage I deeply distrust the GUI for anything that has to do with setting-up and/or altering zpool. As a monitoring device the GUI is ok.

Tx! for your advice.
 
Joined
May 27, 2011
Messages
566
i mentioned it earlier but to make sure it's clear. you cannot expand a vdev under FreeNAS because the version of ZFS is not current enough to support autoexpansion
 

globus999

Contributor
Joined
Jun 9, 2011
Messages
105
i mentioned it earlier but to make sure it's clear. you cannot expand a vdev under FreeNAS because the version of ZFS is not current enough to support autoexpansion

I understood. Thank you very much. I am not expanding a vdev. I am just replacing hdd's one for one with a higher capacity. The total number of hdds remains the same. That is supported by the current version, it's just that it does not work from the GUI. Actually, the GUI is a nightmare.
 
Status
Not open for further replies.
Top