ZFS by default allows record sizes and I/O aggregation up to 1MB. Having MAXPHYS below that causes I/O fragmentation and respective maximum queue depth reduction for disks. First creates additional processing overhead, while second may limit disk's ability to sort the I/Os for better performance. AFAIK Linux has no such limitation, so being on par is good to unify ZFS I/O scheduler tuning. Increased MAXPHYS may consume additional memory for different memory structures and page lists, but for typical NAS memory size it should not be a big problem.
Building FreeNAS 11 from Scratch
Note: All these commands must be run as root.
Requirements:
-
Hardware
- CPU: amd64-compatible 64-bit Intel or AMD CPU.
- 16GB memory, or the equivalent in memory plus swap space
- at least 80GB of free disk space
-
Operating System
- The build environment must be FreeBSD 11.x (or 11-STABLE) (building on FreeBSD 10 or 12 is not supported at this time).
Make Targets
-
checkoutcreates a local working copy of the git repositories withgit clone -
updatedoes agit pullto update the local working copy with any changes made to the git repositories since the last update -
releaseactually builds the FreeNAS release -
cleanremoves previously built files
Procedure
-
Install git
pkg install -y git rehash -
Clone the build repository (
/usr/buildis used for this example):git clone https://github.com/freenas/build /usr/build -
Install Dependencies
cd /usr/build make bootstrap-pkgs python3 -m ensurepip python3 pip install six -
First-time checkout of source:
make checkout
A FreeNAS release is built by first updating the source, then building:
make update
make release
To build the SDK version:
make update
make release BUILD_SDK=yes
Clean builds take a while, not just due to operating system builds, but because poudriere has to build all of the ports. Later builds are faster, only rebuilding files that need it.
Use make clean to remove all built files.
Results
Built files are in the freenas/_BE subdirectory,
/usr/build/freenas/_BE in this example.
ISO files: freenas/_BE/release/FreeNAS-11-MASTER-{date}/x64/.
Update files: freenas/_BE/release/.
Log files: freenas/_BE/objs/logs/.