Add disk and create ZFS Mirror?

Aug 24, 2021
24
2
1
56
Hi,
I am new to Proxmox and very impressed so far.

I want to upgrade my machine- it currently has a 2TB Intel NVMe disk with everything on it.

Goal- add a second 2TB Intel NVMe disk as a mirror without having to wipe and re-install

I don't really care that much if I have to wipe and rebuild, but I'm trying to learn more about disk management and I'm finding the docs a bit difficult to parse into usable info

Happy to read links, docs, whatever you've got
 
I guess a reinstall would be the easiest way for you if yo dont care about wipe and rebuild. You can select ZFS Mirror on Install under Advanced Options, make sure you put in the right size for your disks.

1629877548565.png1629877562721.png

I guess your having an ext4 install not a zfs single disk setup right?

A untestet other way might be to create a zfs single disk (via GUI). move content to that disk and then add the old disk via cli to make it a mirror: https://coderwall.com/p/zpb89a/creating-a-mirrored-zfs-pool-out-of-a-single-disk-rpool
 
Last edited:
In addition to what @jsterr said - should you have installed PVE on ZFS (single disk/RAID0) you can follow the reference documentation for creating the correct partitions on the new NVMe :
https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#_zfs_administration (Changing a failed bootable device)

and then attach the correct partition to the pool (as linked by @jsterr)

In any case - make sure you have a working backup, if you care about the data!
 
  • Like
Reactions: aconnor
Proxmox also only needs around 16GB of storage. If you got some old 120/240 GB SSD laying around and free slots in your case you could install PVE to these and use the NVMes as a storage for VMs only. That way you can easily wipe the VM pool, restore VMs/LXCs from backups without needing to install and setup your PVE again.
 
  • Like
Reactions: aconnor
this is awesome, thanks for your help!
I will do as per the first couple of replies- I have set up a second unit with mirrored ZFS volume, but the first unit only started with one.
I was pretty sure I made first unit a ZFS single drive because this was always in the plans, but if it blows up there's nothing major lost, and yes I could backup first!
 
Also keep in mind that features like bit rot protection require some kind of parity. With just a single ZFS disk it can tell you that you lost data to bit rot but it can't repair it. So it is always a good idea to use atleast a simple mirror. Not only for the case that a drive dies.
 
  • Like
Reactions: aconnor
Hi, i'm in the same situation here, have PBS with just one ext4 disk, and want to add a second one in mirror. I think the best thing it's reinstall everything from scratch. But i would like to "backup my bakcups" into and external USB and then, after de reinstallation restore them.
It's that possible? Thanks a lot!
 
Yes, but not using the webUI.
You can...
- attach and mount USB Disk
- backup your config files and keys (especially "/etc/proxmox-backup/") to USB disk
- verify all backup snapshots
- stop the PBS services (so your datastore won't be accessed while backing up)
- copy your entire PBS datastore folder to your USB disk
- wipe your PBS disks
- install a fresh PBS ontop of a HW raid1 or using a ZFS mirror
- copy the datastore folder from your USB disk to your local disks
- edit your "/etc/proxmox-backup/datastore.cfg" so it points to your copied datastore folder
- unplug USB disk
- reboot your PBS
- run a verify job again but force it to re-verif, to check backup integrity is still fine
 
Thanks a lot for your replay!

Just a question, is there any other config files and keys beside proxmox-backup?
 
Me again, i already make de backups, but i'm having some doubts about de reinstallation process of PBS. I have one ssd disk where i plan to install proxmox, and then the two 4 TB disks that i want to put in mirror.

How should i proceed with the installation?

thanks a lot for any help!
 
Then you don't need to reinstall PBS when PBS is installed on its own dedicated disk.
What is your disk storing the datastore formated with? If it is already ZFS you might even create it into a mirror without deleting anything.
 
Last edited:
Ahhh too late. I realize that didn't reinstalll everything, but i already wipe both 4TB disks and create a zfs mirror pool with them. Now i'm copying back de backups. How could i've done that without wiping the disk?
 
If you didn't previously used ZFS you would have to wipe it anyway.
Have a look at the zpool command: https://openzfs.github.io/openzfs-docs/man/8/zpool-attach.8.html
With that you can attach another disk to an existing vdev creating a mirror of an existing single disk vdev.
Something like: zpool attach YourPool /dev/disk/by-id/YourSingleDisk /dev/disk/by-id/NewDiskToAdd
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!