Category: truenas

SSD Cache Basic

SSD Cache Basic

Consideration

SSD cache helps accessing same set of files frequently. But if the system just holding media files, most likely they won't be visited again, then cache doesn't help.

RAM is required for SSD cache, but adding RAM is more directly impact the perform, because there is no duplication between harddisk and SSD.

Synolog

The required amount of RAM is calculated before cache created.

One SSD disk only can be configured for one volume in read-only mode.

Two or more SSD disks can be configured as one raid, for one volume in read-write mode.

Currently, one SSD disk or raid can not be partitioned for different volume.

FreeNAS/TrueNAS (Untested)

Others suggest 64GB or more of RAM before adding a cache, otherwise, will slow the system down if add a cache with 16GB RAM.

Fusion disk could be another choise because the SSD can be used as storage as well, no waste of space.

Creating FreeNAS VM on ESXi

Creating FreeNAS VM on ESXi

ZFS advantages

Synology uses btrfs as filesystem, which lack of support for bad sector as it natively not supported by btrfs. ZFS could be the choise because of some advantages below.

Bad sector support

Although Synology also can hand bad sector, but btrfs doesn't. Not sure how Synology handle it, but bad sectors can cause Synology volumes crash, and then volumes will be in read only mode, reconfiguration required and taking time to move volumes out from impacted volumes.

Block level dedup

This is an intersting feature of ZFS. The btrfs dedup can be done by running scripts, but ZFS can do natively.

Decision

Software

FreeNAS/TrueNAS has many feature and got full functions of NAS feature.

Hardware

FreeNAS/TrueNAS doesn't support ARM CPU, and cheap ARM board, such as Raspberry PI 4, doesn't support SATA, and 4 SATA drives should be considered for normal NAS. So not intend to use ARM board for NAS.

Consolution

Decided to try FreeNAS/TrueNAS using an old PC installed ESXi, which has 32GB RAM, 8 theads CPU, and 10GB Ethernet.

  1. Assign 8GB RAM and 2 theads to FreeNAS VM, set hot plug memory and CPU in order to increase memory and CPU dynamically.

    Note: Error occurred when add memory to VM. See post Error on adding hot memory to TrueNAS VM.

  2. Create RDM disk access hard disk directly to improve disk performance.

  3. Create VM network interface which supports 10GB.

  4. Create iSCSI disk to hold VM image, because RDM disk vmdk file can not be created in NFS.

Create iSCSI storage

Although the ESXi is managed by vCenter, but could not find the place to configure iSCSI device. So login to ESXi web interface, and configure iSCSI in Storage -> Adapters.

Note: Target is IQN, not name.

Configure network on ESXi

During the creation, ESXi shows an error that two network interfaces had detected on network used by iSCSI, so I removed second standby interface during iSCSI adapter creation, then put back again after creation completed.

Create RDM disk

Following instructions given by Raw Device Mapping for local storage (1017530), to create RDM disk.

  1. Open an SSH session to the ESXi host.

  2. Run this command to list the disks that are attached to the ESXi host:

    ls -l /vmfs/devices/disks
  3. From the list, identify the local device you want to configure as an RDM and copy the device name.

    Note: The device name is likely be prefixed with t10. and look similar to:

    t10.F405E46494C4540046F455B64787D285941707D203F45765
  4. To configure the device as an RDM and output the RDM pointer file to your chosen destination, run this command:

    vmkfstools -z /vmfs/devices/disks/diskname /vmfs/volumes/datastorename/vmfolder/vmname.vmdk

    For example:

    vmkfstools -z /vmfs/devices/disks/t10.F405E46494C4540046F455B64787D285941707D203F45765 /vmfs/volumes/Datastore2/localrdm1/localrdm1.vmdk

    Note: The size of the newly created RDM pointer file appears to be the same size and the Raw Device it it mapped to, this is a dummy file and is not consuming any storage space.

  5. When you have created the RDM pointer file, attach the RDM to a virtual machine using the vSphere Client:

    • Right click the virtual machine you want to add an RDM disk to.
    • Click Edit Settings.
    • Click Add.
    • Select Hard Disk.
    • Select Use an existing virtual disk.
    • Browse to the directory you saved the RDM pointer to in step 5 and select the RDM pointer file and click Next.
    • Select the virtual SCSI controller you want to attach the disk to and click Next.
    • Click Finish.

You should now see your new hard disk in the virtual machine inventory as Mapped Raw LUN.

Create VM on iSCSI storage

Create VM using following parameters

  • VM type should be FreeBSD 12 (64 bit)
  • Memory recommented 8GB (Configured 4GB at beginning, no issue found)
  • SCSI adapter should be LSI Logic Parallel, if not, harddisk can not be detected.
  • Network adapter should be VMXNET3 to support 10GB
  • Add RDM disk into VM (I have done it after server created)

Configure FreeNAS

Configure network in FreeNAS console, and configure pool, dataset, user, sharing, ACL in FreeNAS website.

Configuration in FreeNAS console

Configure FreeNAS network

Configure IP address

Configuration in FreeNAS website

Using browser to access IP configured in previous step

DNS

Configure DNS

Default route

Default route is added in static route as 0.0.0.0 to gateway.

NTP

Configure timezone

Pool

Configure Pool by giving pool name pool01

Dataset

Under Pool, add Dataset, such as download

User

Create user to be used later in ACL.

Sharing

Create SMB sharing

Configure owner in ACL

Assign owner and group to user created above, and select mode as Restrict.

Delete Pool (if needed)

Select Export/Disconnect in setting of pool.

Result

ESXi hangs

The biggest issue encountered is, ESXi hangs, complains one PCPU freezing. Will try to install usb drive directly to see whether problem only happens on ESXi.

Network speed

Fast as excepted

Compare with Synology DS2419+

They are not comparable, because DS2419+ has more disks in the volume.

  • Slower.
  • Stopped when flushing the disks

Compare with Synology DS1812+

They are not comparable, because DS1812+ has three slow disks with raid in the volume.

FreeNAS USB Drive Installation

FreeNAS USB Drive Installation

In order to fully utilize system by FreeNAS, also like to test whether similar hanging issue happened when directly installed on USB drive without ESXi, installation had been done with following steps.

Create on USB drive from ISO image

Creating USB drive on Mac using steps mentioned below.

Preparing the Media

Using rdiskX, which is raw device (not read-only device), will be faster as mentioned in the instructions.

dd if=FreeNAS-9.3-RELEASE-x64.iso of=/dev/rdisk1 bs=64k

Boot from USB drive

Boot from the USB drive created above, and another USB drive will be used for installation.

Select BIOS mode

By choosing BIOS instead of UEFI, the PC bios could not set as auto boot from USB drive, but it can be chosen for manual boot. So choose UEFI mode instead.

Secure Boot in PC bios also requires to be set to Other OS instead of Windows UEFI, otherwise, following error will occurre.

System found unauthorized changes on the firmware error...

Configure network

To set aggragation mode, two original interfaces which had configured, will not be displayed in aggragation menu.

IP address will be configured on aggragation interface.

FreeNAS vs Synology

FreeNAS vs Synology

Synology

Devices: ds1812+ and ds2419+

Pros

  • Hardware are very stable (more than 10 years without issue)
  • Low power and low noise
  • Reasonable price
  • Mix size hard disks in volume
  • Upgrade Hard disk easily
  • Identify hard disk easily
  • Crashed volume in read-only mode, data can be retrieved
  • Many apps can be downloaded
  • Operations on NAS are organized user friendly

Cons

  • Cannot move or copy share folder after volume crashed, manual copy and resetup required
  • Bad hard disk can cause extension unit disconnected from main unit
  • Doesn't accept bad hard disk which smart testing failed, shows failling HDD list
  • Create many special folder named as @eaDir in everywhere, which can be issue when using some services, and huge number of small files in it.
    Note: This folder creation feature could not be disabled.
  • Dedup can not be handled
  • CPU is weak for virtual machines

FreeNAS

Just started on an i7 PC with 32GB ram.

Pros

  • Opensource
  • Can be installed in a normal PC
  • Hardware upgrade is easy, and can import disks used in other NAS before
  • Insensitive to bad hard disk
  • ZFS can handle bad sector natively
  • ZFS can perform dedup natively (haven't tested)

Cons

  • Not easy to understand the tasks to be performed
  • Network configuration screens are everywhere, not easy to find them
  • Network aggregation configuration isn't easy to understand
  • Disk, pool, and dataset are highly related to ZFS
  • Share folder permission and ACL are too complex for NAS operation