How to safely replace and expand hard drives in Proxmox VE?

chchang

Well-Known Member
Feb 6, 2018
34
4
48
47
I have a Proxmox VE server that has been running online for many years.
Currently, the system is installed on a 512GB NVMe, and I use four 256GB SATA SSDs configured as a RAIDZ array.


Now, because I’m running out of space, I want to upgrade by buying four new 2TB SSDs.
However, I also want to keep the data currently stored in my zpool.
What’s the best way for me to do this?


My own idea is:


  1. zpool export pool_name
  2. Replace the four old SSDs
  3. zpool import pool_name

Is it really that simple?
 
  1. zpool export pool_name
  2. Replace the four old SSDs
  3. zpool import pool_name

Is it really that simple?

Yes, it is simple. No, the sequence you listed will NOT work:

a) there is no need to export it, disk replacement MUST be done online - resilvering is an active process!

b) if you replace all four of them in step 2. while the pool being exported, the pool can not get imported again. It is destroyed/lost.

What I would do is to replace the disks one-by-one. The procedure is well documented, e.g.: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_zfs_change_failed_dev . (Note there are special things to do if we would be talking about the pool, the system is booting from - which you stated is not the case.)

The most important detail is to wait for resilvering to finish before removing the old device ;-)

The nice thing with the above is that during the replacement procedure the redundancy rises. There is no additional risk "because of the procedure".


If - and only if - you have no spare connector for this approach you could:

a) go and buy a cheap USB-to-SATA adapter. Use it for this task, not for "normal, productive usage"! Follow the above.

or:

b) remove ONE disk, which will lead to a DEGRADED state. Put in a new disk and resilver. Make sure to have enough backups for this approach, the chance that a second drive will show errors is higher than zero - that's the reason why I do not recommend this. This approach rises the risk "because of the procedure" ;-)


Good luck!

PS: a RaidZ1 is really not a good choice in PVE context and the choice of "good" devices is crucial. But that's another story - which has been discussed here in the forum several times...
 
Last edited: