Skip to main content

Reinstalling Proxmox VE Without Losing VM/LXC Data (ZFS Only)

TODO – WORK IN PROGRESS

Warning: This method applies only when VMs and LXCs are stored on a separate ZFS pool that is not the Proxmox boot pool (rpool). Selecting the wrong disks during installation will permanently erase VM/container data.

Scope: Designed for single-node Proxmox systems using ZFS. Multi-node clusters require additional steps for cluster recovery and are not covered here.


Baseline Scenario

  • Host Type: Single Proxmox VE node using ZFS

    • Boot Pool: rpool — ZFS Mirror (2× SSD)
    • Data Pool: zfs-data — RAIDZ2 (4× NVMe) — contains all VM/LXC disks
    • Goal: Reinstall Proxmox VE without backing up VM disk images

Step 1: Backup Critical Configuration Files

VM and LXC metadata ("shells") are stored in:

/etc/pve

These files define names, hardware settings, disks, and resources.

VM Configuration Files

/etc/pve/qemu-server/*.conf

LXC Configuration Files

/etc/pve/lxc/*.conf
/etc/network/interfaces
/etc/hosts
/etc/pve/storage.cfg

Tip: Use scp, rsync, or WinSCP to copy these to a safe location.


Step 2: Gracefully Shut Down All Resources

Ensures data consistency:

# Stop all VMs
qm stop $(qm list | awk 'NR>1 {print $1}')

# Stop all LXCs
pct stop $(pct list | awk 'NR>1 {print $1}')

Shut down the host:

shutdown -h now

Step 3: Reinstall Proxmox VE (Carefully)

  1. Boot from Proxmox VE ISO

  2. During disk selection:

    • Select only the SSDs used for rpool
    • Do not select NVMe disks from zfs-data
  3. Complete installation normally

Critical: Selecting the wrong disks will permanently destroy VM data.


Step 4: Import the Existing ZFS Data Pool

After first boot:

zpool import

If zfs-data appears imported automatically, continue.

If not:

zpool import -f zfs-data

Verify:

zpool status zfs-data
zfs list

Confirm that datasets containing VM disks are present.


Step 5: Restore Configuration Files

Copy the saved files back:

scp qemu/*.conf root@<new-proxmox-ip>:/etc/pve/qemu-server/
scp lxc/*.conf root@<new-proxmox-ip>:/etc/pve/lxc/

They should appear in the web interface immediately.


Step 6: Re-Add the ZFS Pool as Storage

Option A: Web GUI (Recommended)

Datacenter → Storage → Add → ZFS Select: zfs-data Content: Disk image, Container

Option B: Restore storage.cfg

scp storage.cfg root@<new-proxmox-ip>:/etc/pve/storage.cfg
systemctl restart pve-cluster

Step 7: Verify /etc/pve Availability (Important)

If /etc/pve appears empty:

systemctl status pve-cluster
systemctl status corosync
journalctl -xe

The cluster filesystem must be active before configuration files are usable.


Final Check: Start a Test VM/LXC

qm start 100
pct start 103

If both start correctly, the system is operational.


Recovery Note

If configuration backups are missing, metadata may still be recoverable by inspecting:

/zfs-data

or:

zfs list

Dataset names often correspond to VM IDs.


Summary

By preserving configuration files and re-importing the existing ZFS data pool, you can reinstall Proxmox VE without migrating large VM disk images, significantly reducing downtime and storage requirements. The added safety checks help ensure a reliable and recoverable process.