Setting Up RAID-1 with NFS on Proxmox

Setting Up RAID-1 with NFS on Proxmox

Setting Up RAID-1 with NFS on Proxmox

nfs Jan 22, 2026

This document guide you through setting up RAID-1 with your sda and sdb drives, then configuring NFS access for your Ubuntu/Linux servers.

Step 1: Backup and Prepare

First, verify the drives and ensure no important data exists:

lsblk -f
# Verify sda and sdb are the correct drives (3.6TB each)

Step 2: Remove Existing Configurations

Clean up any existing partition tables:

# Unmount if mounted
umount /dev/sda* 2>/dev/null
umount /dev/sdb* 2>/dev/null

# Wipe filesystem signatures
wipefs -a /dev/sda
wipefs -a /dev/sdb

# Zero out partition tables
sgdisk --zap-all /dev/sda
sgdisk --zap-all /dev/sdb

Step 3: Install MDADM (if not already installed)

apt update
apt install mdadm -y

Step 4: Create RAID-1 Array

# Create the RAID-1 array
mdadm --create /dev/md0 \
  --level=1 \
  --raid-devices=2 \
  /dev/sda \
  /dev/sdb

# Monitor the sync process (this will take time for 3.6TB)
watch cat /proc/mdstat
# Press Ctrl+C to exit watch

Step 5: Create Filesystem

Here, raid1-storage is a label used to identify the filesystem, use your desired name.

# Create ext4 filesystem (or xfs if you prefer)
mkfs.ext4 -L raid1-storage /dev/md0

# For XFS (alternative, better for large files):
# mkfs.xfs -L raid1-storage /dev/md0

Step 6: Configure RAID to Persist

# Save RAID configuration
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

# Update initramfs
update-initramfs -u

Step 7: Mount the RAID Array

# Create mount point
mkdir -p /mnt/raid1-storage

# Mount the array
mount /dev/md0 /mnt/raid1-storage

# Add to fstab for automatic mounting
echo '/dev/md0 /mnt/raid1-storage ext4 defaults 0 2' >> /etc/fstab

# Verify
df -h /mnt/raid1-storage

Step 8: Install and Configure NFS Server

# Install NFS server
apt install nfs-kernel-server -y

# Create directory structure for your services
mkdir -p /mnt/raid1-storage/nextcloud
mkdir -p /mnt/raid1-storage/shared

# Set appropriate permissions
chmod 755 /mnt/raid1-storage/nextcloud
chmod 755 /mnt/raid1-storage/shared

Step 9: Configure NFS Exports

Edit the exports file:

nano /etc/exports

Add your NFS shares (replace IP ranges with your network):

bash

# For specific subnet (recommended)
/mnt/raid1-storage/nextcloud 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)
/mnt/raid1-storage/shared 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)

# Or for specific IPs
# /mnt/raid1-storage/nextcloud 192.168.1.100(rw,sync,no_subtree_check,no_root_squash)

NFS Options explained:

  • rw - read/write access
  • sync - synchronous writes (safer but slower)
  • no_subtree_check - improves reliability
  • no_root_squash - allows root on client to access as root (be careful with this)

Apply the configuration:

exportfs -ra
systemctl restart nfs-kernel-server
systemctl enable nfs-kernel-server

Step 10: Configure Firewall (if enabled)

# Allow NFS through firewall
ufw allow from 192.168.1.0/24 to any port nfs

Step 11: Mount on Ubuntu Clients

On your Ubuntu servers:

# Install NFS client
apt install nfs-common -y

# Create mount point
mkdir -p /mnt/nextcloud-data

# Mount NFS share
mount -t nfs proxmox-ip:/mnt/raid1-storage/nextcloud /mnt/nextcloud-data

# Add to fstab for persistence
echo 'proxmox-ip:/mnt/raid1-storage/nextcloud /mnt/nextcloud-data nfs defaults 0 0' >> /etc/fstab

Verification Commands

# On Proxmox - Check RAID status
mdadm --detail /dev/md0
cat /proc/mdstat

# Check NFS exports
showmount -e localhost

# On Ubuntu client - Check NFS mount
df -h
mount | grep nfs

Important Notes

  1. RAID sync time: The initial RAID sync will take several hours for 3.6TB drives. The array is usable during sync but performance will be affected.
  2. Permissions for Nextcloud: You'll likely need to set ownership for the Nextcloud user:
   chown -R www-data:www-data /mnt/raid1-storage/nextcloud
  1. Network performance: Consider using 10GbE or bonded network interfaces for better NFS performance.
  2. Monitoring: Set up RAID monitoring:
   echo '[email protected]' >> /etc/mdadm/mdadm.conf

Tags