MirrorNest
← Tous les guides

SnapRAID + MergerFS for a home NAS

A popular alternative to traditional RAID for home media servers: MergerFS pools multiple independent drives into one folder tree, while SnapRAID adds parity protection you can add drives to (or recover from) one at a time.

Système : Ubuntu / Debian Linuxstorage-poolingparity-protectionNASSite officiel ↗Documentation officielle ↗
Ce guide est élaboré à partir de la documentation officielle de SnapRAID + MergerFS for a home NAS, dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
  1. 1Install both tools

    sudo apt update
    sudo apt install -y snapraid mergerfs
  2. 2Pool your drives with MergerFS

    Mount several independently-formatted drives as one combined folder -- files are distributed across the underlying drives, but appear in a single unified directory tree.

    sudo mkdir -p /mnt/disk1 /mnt/disk2 /mnt/parity /mnt/storage
    sudo mergerfs /mnt/disk1:/mnt/disk2 /mnt/storage -o defaults,allow_other,use_ino,category.create=mfs
  3. 3Configure SnapRAID parity protection

    Edit /etc/snapraid.conf to list each data drive and a separate parity drive (which must be at least as large as your biggest data drive), then run an initial sync.

    sudo snapraid sync

    Unlike RAID, SnapRAID parity is NOT real-time -- it only protects data as of your last `snapraid sync` run, so schedule that as a regular cron job, and know that anything changed since the last sync isn't protected yet.

  4. 4Recover from a failed drive

    If one data drive fails, SnapRAID can rebuild its exact contents onto a replacement drive using the parity data and the other drives -- your other drives are completely unaffected and don't need to be touched.