I have proxmox installed on my homelab on 2x M.2 drives and I want to replace them with 2x SATA SSDs I have lying around. I don’t want to reinstall everything from scratch on the other drives so I thought I could replace them one at a time as if they were failing using the ZFS tool but I never had to do this process and since nothing is actually failing not sure what’s the optimal way of doing it. Can somebody give me some pointers or refer me to a guide?
zpool replace poolname olddisk newdisk should do the job. It doesn’t care what the condition of the old drive is.
But zpool attach works just as well. Just takes more steps, but is tried and trusted among mirror-enthusiasts with SSDs, should be damn fast and painless (sequential resilver)
Choices
edit: just make sure you unplug the M.2 only after the stuff is done. If you use zpool attach, you end up with a 4-way-mirror with 2xM.2 and 2xSATA SSDs. Only after you ran zpool detach are the M.2 safely evacuated (yes, that’s the term) from the pool.
Thank both of you, and yes, they are in a mirror, I thought I put that, my bad
So for what I understand in both scenarios I have to have all 4 disks connected and after running the commands, I physically remove the 2xM.2., right?
The way to reference the disks for the commands is with /dev/nvmXnY (basically how they show up on the Disks section within Proxmox GUI)? What’s the default poolname if I’m booting proxmox from these drives?
Sorry for the trivial questions, don’t want to mess it up.
Thanks!
I was wrongfully under the impression that this is enough, but it isn’t.
The documentation is not great IMHO, when it comes to this.
You not only need to use the ZFS replace command (which basically gets your mirror up and running again) you also need to change the bootloader. Otherwise you can’t boot from both.
Scroll down to “Changing a failed bootable device”
oh right. Proxmox has to make a separate (non-ZFS) boot partition because the Kernel hates ZFS. Forgot about that.
but dd should just work then, right?
You want to offline the pool somehow before using dd, which is problematic on a running boot drive.
Yeah, stick to that Proxmox documentation.
Thank you for pointing that out. I have single SSD with ZFS on my Proxmox and dd cloned replacement disk ready (kinda “clunky manual backup”, haven’t come up with anything better yet)
Hmmm… could be. But DD would take longer, because it also copies zeros, right?
That is IMHO a missing feature of Proxmox.
OPNsense or TrueNAS offer a one click, one file backup.
Proxmox could offer the same. Then you could just reimport the config backup and after that the pool.
I am not sure if you not simply could copy /etc/pve/.
But yeah, it’s a shame there is no official way.
this worked like a charm! thanks!
Only thing missing now is to remove from /etc/kernel/proxmox-boot-uuids the M.2 ids. I can do it manually but anybody knows if there’s a another way?