JustToThePoint English Website Version
JustToThePoint en español
Colaborate with us

Proxmox rsync Backup to ZFS, Freeing Up Space, and PCIe NIC Passthrough to TrueNAS SCALE

When the world says, ‘Give up,’ hope whispers, ‘Try it one more time,’ Lyndon B. Johnson

image info

Proxmox rsync Backup to ZFS

You can use rsync to Remotely Copy Files to the Proxmox Storage. In Proxmox, /mypool is a ZFS pool mount (a pool named mypool). with dataset or directory named backup. Thus, rsync writes directly into that ZFS dataset on myserver.

zpool list # Check if mypool exists and is mounted
root@myserver:/mypool/backup# zfs list # To see where mypool is mounted
NAME                               USED  AVAIL  REFER  MOUNTPOINT
mypool                             322G  6.81T  1.90G  /mypool

mkdir -p /mypool/backup
ssh-copy-id root@dir-IP-YOUR-PROXMOX # Copy your public key to the PROXMOX server

# Copying my dotfiles directory to the ZFS Pool
BACKUP_DEST="root@dir-IP-YOUR-PROXMOX:/mypool/backup/"
rsync -av --delete "$HOME/dotfiles/" "$BACKUP_DEST/dotfiles"
  1. The -a (archive) option ensures a faithful copy of files and metadata: it recurses into directories and preserves permissions, ownership, timestamps, symlinks, etc.
  2. The -v flag adds output verbosity.
  3. Finally, the --delete flag tells rsync to remove any files on the destination that no longer exist on the source, and as a result it makes the destination a mirror of the source.

Freeing Up Space on the Proxmox Node

You may have found out that ProxMox run out of space. This is because /dev/mapper/pve-root is a separate logical volume (LVM) that is used for the root filesystem, and it has a limited size by default in Proxmox.

Let’s start with safe housekeeping:

# Remove unneeded cached package files
apt-get clean
# Remove unused packages and dependencies
apt-get autoremove --purge
# Cleaning old log files is generally safe
journalctl --vacuum-size=100M
# Check for Large Files
du -sh /var/*

Resize the Root Filesystem. The root volume /dev/mapper/pve-root can be shrunk or expanded, but shrinking is risky.

However, if the previous step (freeing up space) isn’t enough, you can resize the root filesystem (/dev/mapper/pve-root) to use more of the available disk space.

# Check the available space in the LVM volume group
vgdisplay
# Extend the Logical Volume
lvextend -l +100%FREE /dev/mapper/pve-root
# After extending the logical volume, resize the filesystem to use the new space
resize2fs /dev/mapper/pve-root
# Verify the changes
df -h
[...]
lvextend -l +100%FREE /dev/mapper/pve-root

Migrating /var/lib/vz and /var/log. By default, Proxmox VU uses /var/lib/vz for its “local” directory storage, which holds container images, ISO templates, etc., and /var/log for system logs. If these are on the root filesystem and filling it up, you can relocate it onto ZFS (e.g., mypool).

# 1. Create the Target ZFS Dataset (if it doesn't exist)
sudo zfs create mypool/vz

# 2. Copy Data from /var/lib/vz to the New Location
mv /var/lib/vz /mypool/vz
# Using rsync is safer than mv as it allows for verification and preserves permissions.
sudo rsync -avX /var/lib/vz/ /mypool/vz/

# 3. Create the Symbolic Link:
ln -s /mypool/vz /var/lib/vz
lrwxrwxrwx 1 root root    10 Jan  8 01:44 vz -> /mypool/vz

# 1b. Create the Target ZFS Dataset
sudo zfs create mypool/log

# 2b. Copy Data from /var/log to the New Location
mv /var/log /mypool/log

# 3.b Create the Symbolic Link:
ln -s /mypool/log /var/log
# Or even better
sudo rsync -avX /var/log/ /mypool/log/

PCIe NIC Passthrough to TrueNAS SCALE VM

A Network Interface Card (NIC), also called a network adapter or network card, is a hardware component that allows a computer to connect to a network. It serves as the physical interface between a computer and the network infrastructure, enabling the computer to send and receive data over the network.

Modern cards such as Realtek 68B 2.5GE, Intel Ethernet Network Adapter I225-V 2.5 GbE or Intel X550-T2 (10 GbE) provide high-speed (2.5/10 Gigabit) ethernet connectivity, offering data transfer speeds of up to 2.5/10 Gbps, which is significantly faster than traditional Gigabit Ethernet (1 Gbps) and advanced features like Wake-on-LAN.

  1. Enable and verify IOMMU.First, ensure VT-d (Intel) or AMD-Vi is enabled in BIOS: dmesg | grep -e DMAR -e IOMMU.

  2. Identify the NIC’s PCI IDs. On the Proxmox host, list PCI devices to find the NIC.

    lspci -nn | grep -i ethernet
    2a:00.0 Ethernet controller [0200]:
    Realtek Semiconductor Co., Ltd. RTL8111/8168/8411
    PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    

    Write down vendor:device IDs in brackets, e.g. 10ec:8168

  3. Bind the NIC to vfio-pci. You must prevent the host from using the NIC so it can be assigned to the VM.

    echo "options vfio-pci ids=10ec:8168" | sudo tee -a /etc/modprobe.d/vfio.conf
    # Update initramfs and reboot:
    update-initramfs -u
    reboot
    # Blacklist the default driver if the host keeps claiming the NIC (e.g., for Realtek)
    echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf
    
  4. Passthrough (PCI Device) via Proxmox GUI. Open the Proxmox web UI and select the TrueNAS SCALE VM. Go to the Hardware tab, click Add, PCI Device. In the dialog, you should see your NIC listed, e.g., Realtek RTL8168 PCI Express Gigabit Ethernet Controller. Choose the entry corresponding to your NIC (In the dialog, you should see your NIC listed), then select All Functions and add it.

    Ensure the Proxmox host is not using the NIC for its own networking.

  5. Verify the NIC inside TrueNAS. In the TrueNAS SCALE shell, you should see the new NIC: ip link or ifconfig -a; you might see an interface like eth0 or ix0 (Intel NIC) or re0 (Realtek NIC). Assign it an IP or DHCP as needed. You can then move your NFS/SMB shares to use this interface.

  6. Configure Networking in TrueNAS. Use the TrueNAS web UI (Network, Interfaces) to confirm the new interface is present and assign it an IP or enable DHCP as needed. You can then move your NFS/SMB shares to use this interface.

Bitcoin donation

JustToThePoint Copyright © 2011 - 2025 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.