Set Up ZFS Storage for Your Plex Media Server
ZFS is the best filesystem for a Plex media server if data integrity matters to you. It checksums every block of data, detects and corrects silent corruption (bit rot), supports snapshots for instant backups, and handles large storage pools with native RAID. This guide covers how to set up a ZFS pool for Plex, choose the right RAID level, and configure it for optimal media server performance.
Why ZFS for a Media Server
Hard drives fail. More importantly, hard drives silently corrupt data — a flipped bit here, a degraded sector there — without reporting any error. Traditional filesystems (ext4, NTFS, XFS) do not detect this corruption. You could have damaged video files in your library for months without knowing.
ZFS solves this with end-to-end checksumming: every block of data has a checksum stored separately. When ZFS reads a block, it verifies the checksum. If corruption is detected and you have redundancy (mirror or RAIDZ), ZFS automatically repairs the corrupted block from a good copy. No data loss, no manual intervention.
Additional benefits for media servers:
- Snapshots: Create instant, space-efficient backups of your entire media library. Roll back accidental deletions in seconds.
- Compression: LZ4 compression runs at near-disk speed and can save 5-15% space on media files (more on metadata and subtitles).
- Flexible pool management: Add more drives to expand storage without reformatting. Replace drives with larger ones to grow capacity.
- Scrubbing: Scheduled integrity checks that read every block and verify checksums, catching corruption before it becomes a problem.
Choosing a RAID Level
ZFS has its own RAID implementation (RAIDZ) that is more reliable than traditional hardware or software RAID. The levels:
| Level | Min Drives | Fault Tolerance | Usable Space | Best For |
| Mirror (RAID1) | 2 | 1 drive failure per mirror | 50% | Small pools, best performance |
| RAIDZ1 (RAID5) | 3 | 1 drive failure | 67-80% | Budget builds, replaceable media |
| RAIDZ2 (RAID6) | 4 | 2 drive failures | 50-75% | Large pools, irreplaceable data |
| RAIDZ3 | 5 | 3 drive failures | 40-67% | Very large pools, enterprise |
| Stripe (RAID0) | 1 | None | 100% | Temporary/replaceable data only |
Recommendation for Plex
For most home Plex servers: RAIDZ1 with 3-5 drives offers the best balance of capacity and protection. Media files are large and mostly replaceable (you can re-rip or re-download), so single-parity protection is usually sufficient.
If your media is irreplaceable (home videos, rare recordings): use RAIDZ2 with 4-6 drives for double-parity protection. The capacity cost is worth the peace of mind.
For 2-drive setups: use a mirror. You lose 50% capacity but gain the fastest read performance and simplest recovery.
Creating a ZFS Pool
On TrueNAS (Recommended for Beginners)
TrueNAS is built on ZFS and provides a web UI for pool management. No command line needed.
- Install TrueNAS SCALE (Linux-based, recommended) or TrueNAS CORE (FreeBSD-based).
- Go to Storage > Create Pool.
- Name the pool (e.g., "media").
- Select your drives and choose the RAID level (data vdev type).
- Click Create. TrueNAS formats the drives and creates the pool.
- Create a dataset for your media: Storage > Pools > Add Dataset. Name it "plex-media" or similar.
- Set up an SMB or NFS share for the dataset so your Plex server (if running on a different machine) can access it over the network.
On Ubuntu/Debian Linux
Install ZFS:
apt install zfsutils-linux
Create a RAIDZ1 pool with three drives:
zpool create media raidz1 /dev/sdb /dev/sdc /dev/sdd
Create a dataset for Plex media:
zfs create media/plex
Set the mount point:
zfs set mountpoint=/mnt/media/plex media/plex
The dataset is now available at /mnt/media/plex. Point your Plex libraries here.
On Proxmox
Proxmox has ZFS built in. Create a pool via the web UI (Disks > ZFS > Create ZFS) or via command line. If Plex runs in an LXC container or VM, pass the ZFS dataset through as a bind mount or NFS share.
Optimal ZFS Settings for Media
After creating the pool, tune these properties for media server use:
Compression
zfs set compression=lz4 media/plex
LZ4 compression is so fast it actually improves performance — the CPU compresses/decompresses faster than the disk can read/write uncompressed data. Media files (H.264, H.265, AAC) are already compressed and will not shrink further, but metadata, subtitle files, and Plex database files benefit significantly.
Record Size
zfs set recordsize=1M media/plex
The default ZFS record size is 128 KB. Media files are large and read sequentially — a 1 MB record size reduces metadata overhead and improves sequential read throughput. This is the recommended setting for large media files.
Atime (Access Time)
zfs set atime=off media/plex
Disabling access time tracking prevents ZFS from writing a timestamp every time a file is read. Media servers read files constantly during playback — atime writes add unnecessary disk I/O.
Deduplication
Do not enable deduplication for media storage. Dedup requires enormous amounts of RAM (roughly 5 GB per TB of storage) and media files have almost zero duplicate blocks. Dedup will consume all your RAM and tank performance with no space savings.
Snapshots and Backups
ZFS snapshots are instant, copy-on-write backups. They capture the state of your data at a point in time without duplicating it.
Create a snapshot:
zfs snapshot media/plex@2026-11-18
List snapshots:
zfs list -t snapshot
Roll back to a snapshot (restores the dataset to that point in time):
zfs rollback media/plex@2026-11-18
Automate daily snapshots with a cron job or use zfs-auto-snapshot (available as a package on Ubuntu). Keep 7 daily, 4 weekly, and 3 monthly snapshots to cover accidental deletions and corruption without consuming excessive space.
Scrubbing (Integrity Checks)
A scrub reads every block in the pool and verifies its checksum. If corruption is found and redundancy exists, ZFS repairs it automatically.
Run a scrub manually:
zpool scrub media
Schedule monthly scrubs via cron. TrueNAS schedules scrubs automatically (default: monthly). A scrub on a 20 TB pool with mechanical drives takes roughly 12-24 hours — run it overnight or during low-usage periods.
Drive Replacement
When a drive fails in a RAIDZ pool:
- Identify the failed drive:
zpool status mediashows the pool status and which drive is degraded. - Replace the drive physically.
- Tell ZFS to resilver (rebuild) onto the new drive:
zpool replace media /dev/old-drive /dev/new-drive. - ZFS rebuilds only the data that was on the failed drive, not the entire disk. Resilver time depends on how much data exists (not total drive capacity).
During resilvering, the pool remains online and accessible. Performance will be reduced until the resilver completes.
Hardware Recommendations
- RAM: ZFS uses RAM for its ARC (Adaptive Replacement Cache). The rule of thumb is 1 GB of RAM per TB of storage, with 8 GB minimum. For a 20 TB media server, 16-32 GB is ideal. ECC RAM is recommended but not required for home use.
- Drives: Use identical drives in each vdev for consistent performance. CMR (conventional magnetic recording) drives are preferred over SMR (shingled) drives — SMR drives have terrible write performance during resilvers. WD Red Plus, Seagate IronWolf, and Toshiba N300 are popular NAS-grade choices.
- SATA/SAS controller: Use an HBA (host bus adapter) in IT mode, not a hardware RAID controller. ZFS needs direct access to the drives — hardware RAID controllers hide the drives behind their own layer, defeating ZFS's integrity features.