Files
selfhosted-apps-docker/trueNASscale
DoTheEvo 4d96d33550 update
2022-12-30 22:53:33 +01:00
..
2022-12-30 22:53:33 +01:00

TrueNAS SCALE

guide-by-example

logo

Purpose & Overview

Network storage operating system managed through web GUI.

TrueNAS SCALE is based on debian linux. ZFS file system is at the core. Running nginx and using pythong and django for the web interface.

ZFS for Dummies

My specific use case

My home server runs ESXi.
TrueNAS is one of the virtual machines, with Fujitsu D3307 flashed in to IT Mode and pass-through in to the VM so that truenas has direct access to the disk, without any in between layer.

I hold strong opinion on backups > raid.
So I make zero use of zfs raid features and use it just as nice web GUI for samba and nfs sharing.

Good alterntive I could have go for is openmediavault, but truenas seems a bigger player. And if I did not luck out with the HBA card, I would be buying Fujitsu 9211-8i from ebay.

Installation

esxi-vm

The official documentation.

  • download ISO
  • upload it to ESXi datastore
  • create new VM
    • Guest OS family - linux
    • Guest OS version - Debian 64-bit
    • give it 2 cpu cores
    • give it 4GB RAM with sub-setting: Reserve all guest memory (All locked)
    • give it 50GB disk space
    • mount ISO in to the dvd drive
    • SCSI Controller was left at default - vmware paravirtual
    • switch tab and change boot from bios to uefi
  • click through the Installation
  • login, shutdown
  • ESXi - edit VM, add other device, PCI device,

Basic Setup

Static IP address

  • Network > Interfaces > uncheck DHCP > add Aliases > fill IP/mask, on save it asks for the gateway IP
  • set hostname and DNS server in Network > Global Configuration

Set time

  • Set time zone and date format
    System Settings > General > Localization > Settings

If there are issues with the time... enable ssh service, ssh in to the truenas check few things

  • timedatectl
  • ntpq -p
  • systemctl status ntp.service
  • sudo journalctl -u ntp.service
  • cat /etc/ntp.conf
  • hwclock --systohc --utc

timedatectl

For the issue I faced, I think what did the trick was sync time through dashboard when I had notice of wrong time for like 4th time. Then I used set the UTC time in bios using hwclock --systohc --utc and then I started sudo systemctl start ntp which previously was failing, after that ntpq -p worked.

Pools and Datasets

zfs-layout

First a Pool

The official documentation.

I think of a pool as of a virtual unformated hard rive. You cant mount it, you cant use it without partitioning it first.

  • create a pool in the Storage section, name it, I prefer to not encrypt, that comes later with Datasets
  • assign disks to the pool's default VDev, if needed more VDevs can be added
  • in vdev select "raid" type stripe, mirror,
  • finish
Second comes Dataset

The official documentation.

Dataset is like a partition in the classical terms. It's where filesystem actually comes to play, with all the good stuff like mount, access, quotas, compression, snapshots,...

  • create a dataset in Datasets > Add Dataset, name it, I prefer to turn off compression
  • set encryption to passphrase if desired
    this encryption prevents access to the data after shutdown, nothing to do with sharing
  • set Case sensitivity to Insensitive if windows will be accessing this dataset
  • set Share Type to SMB if planning to share with SMB, which is the most used way to share, especially for windows or mixed access

Theres also a direct alterantive to dataset - Zvol when one desires iScsi and the mounting of a network storage as a block device. Which provides great speeds with small files, but at the cost of space.

For destruction of datasets - Datasets > select one > delete button right side
For destruction of pools - Storage > Export/Disconnect button

SMB share

Should be go-to way to share for most cases.

  • Windows (SMB) Shares > Add
  • set path to the dataset to share
  • set the name under which it will be shared
  • set Purpose if there is a special case
  • in advanced settings allow guest access if desired

This created a share, now to deal with the permissions
There are two type of permissions accessible through icons in the share view

  • Share ACL - set to allow everyone by default
  • Edit Filesystem ACL - where one actually wants to control permissions

NFS share

iSCSI share

Data protection settings

  • enable autoamtic smart short tests
    Data Protection > S.M.A.R.T. Tests > Add > all disks/short/weekly
  • enable autoamtic snapshots

Testing access to ZFS disks on a desktop

Reinstall and import of pools

Update

Backup and restore