Skip to main content

How to Install Proxmox on Software RAID-1 After Installation (Using mdadm)

·477 words·3 mins·

Proxmox VE does not provide built-in support for creating mdadm software RAID arrays during installation. However, even if you install Proxmox on a single disk, you can still convert the system to a reliable RAID-1 setup afterward using mdadm and LVM.

Note The Proxmox installer does support ZFS RAID, but this guide focuses on mdadm-based RAID.

Requirements

  • Two identical SSDs/HDDs (same capacity; minor revision differences are okay)
  • Proxmox installed on one drive
  • A second empty drive of the same size or larger
  • Basic familiarity with LVM, mdadm, and Debian-based tools

Environment Example

  • /dev/nvme0n1 Drive containing a fresh Proxmox installation.
  • /dev/nvme0n1p1 BIOS partition.
  • /dev/nvme0n1p2 Boot partition.
  • /dev/nvme0n1p3 Proxmox OS partition.
  • /dev/nvme1n1 Identical empty drive.

Install mdadm

Update package lists and install mdadm:

apt update && apt install mdadm

Clone the Partition Table

Backup the partition table of the primary drive:

sfdisk -d /dev/nvme0n1 > part_table

Strip UUIDs and copy the table to the second drive:

grep -v ^label-id part_table | sed -e 's/, *uuid=[0-9A-F-]*//' | sfdisk /dev/nvme1n1

Create a Degraded RAID-1 Array

Create a RAID-1 device with only the new drive attached:

mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/nvme1n1p3 missing

Add RAID Device to LVM

Create a physical volume:

pvcreate /dev/md0

Extend the existing Proxmox volume group:

vgextend /dev/pve /dev/md0

Move Data to RAID

Warning! This step can take a long time, even on SSDs.
Do not interrupt it.
Move data from the original single-disk volume to the RAID device:

pvmove /dev/nvme0n1p3 /dev/md0 > pvmove.log 2>&1 &

Check the progress:

tail -f pvmove.log

Remove Old PV from Volume Group

Important: Perform this step only after the previous migration process has fully completed.
vgreduce /dev/pve /dev/nvme0n1p3

Add the Original Disk to RAID

Now attach the original Proxmox OS partition to the RAID array so it can resync:

mdadm --manage --add /dev/md0 /dev/nvme0n1p3

Copy Boot and EFI Partitions

Clone partition 1 and 2 to the second drive:

dd if=/dev/nvme0n1p1 of=/dev/nvme1n1p1
dd if=/dev/nvme0n1p2 of=/dev/nvme1n1p2

Install GRUB on Both Drives

Install GRUB on each disk:

grub-install /dev/nvme0n1
grub-install /dev/nvme1n1

Update initramfs

Regenerate initramfs so the system knows about the new RAID structure:

update-initramfs -u -k all

Monitor RAID Sync Status

Check resync progress:

watch cat /proc/mdstat

Expected output (example):

md0 : active raid1 sda3[2] sdb3[0]
      487729152 blocks super 1.2 [2/2] [UU]
      bitmap: 1/4 pages [4KB], 65536KB chunk

Verification — Check Final Layout

A functional RAID-1 setup should show an md0 RAID-1 device backing your LVM volumes (pve-root, pve-data, etc.).

lsblk

mdadm will automatically begin syncing the array. To monitor the progress:

watch cat /proc/mdstat

Additional Notes

  • You can extend this method to mirror the boot partition as well, although this has not been fully tested.
  • If a drive is replaced in the future, you must manually copy partitions 1 and 2 before adding it back to the RAID array.
  • After adding a replacement drive, mdadm will automatically begin the resync process.