Running a Home NAS with TrueNAS CORE: From ZFS Pool to SMB Shares

Setting up a Home NAS with TrueNAS CORE: From ZFS Pool to SMB Shares

Home‑network attached storage is the bread‑and‑butter of any homelab. A single box can hold media, backups, and a file‑server, and it can run Plex, Nextcloud, or just plain SMB.
TrueNAS CORE (the free, community edition of the FreeNAS family) ships with ZFS, so you get snapshots, compression, and data integrity out of the box.

Below is a hands‑on walk‑through on a modest 4‑bay chassis, from booting the installer to exposing a Windows‑friendly SMB share. I’ll keep the command snippets real, point out where you’ll run into trade‑offs, and throw in some “I’ve seen this go wrong” moments that only come from running the system day‑to‑day.

Prerequisites

  • 4‑bay NAS chassis (Synology DS420j‑compatible or a DIY case).
  • Four 4 TB SATA drives (or whatever size you prefer).
  • USB‑to‑serial adapter if you need console access.
  • A computer with a browser to hit the TrueNAS web UI.
  • Basic Linux command knowledge (zpool, zfs, smbclient, etc.).

1. Booting into the Installer

  1. Grab the latest TrueNAS CORE ISO from the official site.
  2. Burn it to a USB stick (Linux dd, Windows Rufus).
  3. Plug in the USB, power on the NAS, and hit the boot‑menu key (F12/Esc).
  4. Pick the USB and let the installer start.

The console will ask for a root password and language. After that, you’ll get a prompt to install to a disk. Pick a dedicated “boot” disk (a 120 GB SSD or a small SATA drive). This disk will hold the OS, not the data pool.

Tip: If you have a spare SSD, use it for the boot disk. ZFS on SSD is fast and reliable, and the boot disk will be wiped during the install.


2. Creating the ZFS Pool

Once the system reboots into the web UI, log in with the root credentials you set. The first thing you’ll see is the “Storage” dashboard.

2.1 Choosing the Pool Layout

With four drives, you can go a few ways:

Layout Description Pros Cons
RAIDZ‑1 3‑drive parity, 1 spare Good capacity vs. fault tolerance 25 % usable space
RAIDZ‑2 2‑drive parity, 2 spares Survives two simultaneous failures 50 % usable space
Mirror‑2 Two 2‑drive mirrors Fast reads/writes, simple 50 % usable space

For a home NAS, RAIDZ‑1 is usually the sweet spot: about 9 TB usable and survives a single drive failure. If you’re paranoid about double failures, RAIDZ‑2, but you’ll lose half the capacity.

2.2 Building the Pool

  1. In the UI, click Pools → Add.
  2. Name the pool (homepool).
  3. Select the four drives and pick the layout.
  4. Click Create.

The UI runs zpool create behind the scenes. Verify from the console:

$ zpool status homepool
  pool: homepool
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        homepool    ONLINE       0     0     0
          sda       ONLINE       0     0     0
          sdb       ONLINE       0     0     0
          sdc       ONLINE       0     0     0
          sdd       ONLINE       0     0     0

errors: No known data errors

If you see DEGRADED or UNAVAIL, double‑check cables or replace a bad drive.

2.3 Enabling Compression

ZFS compression is cheap and can save space, especially for media. Enable it on the pool:

$ zfs set compression=on homepool

compression=lz4 is the default and offers a great speed/space trade‑off.


3. Creating a Dataset for Shared Files

A dataset is a logical partition of the pool that can have its own properties (quota, compression, ACLs). Create one for your shared data:

$ zfs create homepool/share
$ zfs set compression=lz4 homepool/share

If you want to cap how much a user can consume, set a quota:

$ zfs set quota=5T homepool/share

4. Configuring SMB (Windows) Shares

TrueNAS uses Samba under the hood. The web UI does the heavy lifting, but it’s useful to know what’s really happening.

4.1 Enabling SMB Service

  1. Go to Services → SMB.
  2. Toggle it ON.
  3. Click Advanced and set Workgroup to your Windows domain (e.g., WORKGROUP).
  4. Save.

Check the status:

$ systemctl status smbd
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2026‑12‑01 10:12:34 UTC; 2min 15s ago

4.2 Creating the Share

  1. Shares → Windows (SMB) → Add.
  2. Name it (Media).
  3. Point the path to the dataset: /mnt/homepool/share.
  4. Set Read‑only to No (unless you want a read‑only share).
  5. Click Save.

The UI will generate a smb.conf entry like:

[Media]
   path = /mnt/homepool/share
   read only = no
   guest ok = yes
   create mask = 0770
   directory mask = 0770

Security note: guest ok = yes lets anyone on the network access the share. For a home network, that’s usually fine, but if you want stricter control, create a Unix user and set guest ok = no.

4.3 Adding a Windows User

If you disabled guest access:

$ pw useradd -n alice -m -s /usr/sbin/nologin
$ passwd alice

Then add the user to the SMB share via the UI: Shares → Windows (SMB) → Edit → Permissions. Grant Read/Write to alice.


5. Mounting the Share from Windows

On a Windows machine:

  1. Open File Explorer.
  2. In the address bar, type \\<TrueNAS‑IP>\Media.
  3. If prompted, enter the credentials you created.

You should now see the shared folder and be able to copy files in and out.


6. Advanced: Using ACLs for Fine‑Grained Access

ZFS ACLs let you specify permissions per user/group, beyond the classic Unix mode bits. Enable ACLs on the dataset:

$ zfs set aclmode=posixacl homepool/share

Then set an ACL for a user:

$ setfacl -m u:alice:rwx /mnt/homepool/share

View the ACL:

$ getfacl /mnt/homepool/share
# file: /mnt/homepool/share
# owner: root
# group: wheel
user::rwx
user:alice:rwx
group::r-x
mask::rwx
other::r-x

This is handy if you have multiple users who need different levels of access to the same share.


7. Snapshotting and Backup Strategy

ZFS snapshots are instant and space‑efficient. Create a daily snapshot:

$ zfs snapshot homepool/share@daily-$(date +%F)

Automate with cron:

0 2 * * * /sbin/zfs snapshot homepool/share@daily-$(date +%F)

To protect against local drive failure, consider an off‑site backup. TrueNAS can push snapshots to an external server via rsync or zfs send | ssh. Example:

$ zfs send -R homepool/share@daily-$(date +%F) | ssh [email protected] zfs receive -F homepool/share

8. Performance Tweaks

Setting Why How
zfs set primarycache=metadata homepool Keeps metadata in RAM, speeding up small file ops zfs set primarycache=metadata homepool
zfs set secondarycache=none homepool Reduces write amplification on SSD boot disk zfs set secondarycache=none homepool
zpool set cachefile=/etc/zfs/zpool.cache homepool Enables persistent cache across reboots zpool set cachefile=/etc/zfs/zpool.cache homepool

If you notice high CPU during heavy writes, consider disabling atime:

$ zfs set atime=off homepool/share

9. Common Issues and Fixes

Symptom Likely Cause Fix
SMB share not visible SMB service stopped systemctl restart smbd
Drive shows UNAVAIL Cable or power issue Check SATA cable, replace if necessary
Snapshot space runs out Unlimited snapshots Set a quota or delete old snapshots
Windows shows “Access Denied” ACL mismatch Verify setfacl entries and aclmode

10. Security Hardening Checklist

  1. Keep the system updated: pkg update && pkg upgrade.
  2. Disable unused services: Turn off ftp, nfs, etc., if you don’t use them.
  3. Use strong passwords for all accounts.
  4. Enable firewall: ufw enable and allow only necessary ports (e.g., 445 for SMB).
  5. Enable SMB signing: In smb.conf, add server signing = mandatory.
  6. Regularly review logs: journalctl -u smbd for suspicious activity.

11. Extending the NAS: Adding a Docker Container

TrueNAS CORE supports Docker via the Plugins feature. For example, to run a simple Nextcloud instance:

  1. Plugins → Install → Search for “Nextcloud”.
  2. Follow the wizard to set up the container.
  3. The plugin will automatically mount a dataset (homepool/nextcloud) and expose ports 80/443.

This turns your NAS into a full‑featured home server without leaving the TrueNAS ecosystem.


12. When Things Go Wrong: A Real‑World Example

I once had a NAS where the SMB share stopped responding after a firmware update. The logs showed:

smbd[12345]: SMB server failed to bind to port 445

The culprit was a leftover iptables rule that blocked port 445. Removing the rule with:

$ iptables -D INPUT -p tcp --dport 445 -j DROP

restored the share. The lesson: after updates, always check the firewall and service status.


Happy storing!

See also