vulcanridr

NAS beautification -- Stage three

In Part one, we were able to build a FreeBSD 15.1 boot environment alongside an existing zVault install. Part two documented the choices I made between which files to copy from zVault (e.g. /etc/exports and ssh keys/configs) and which to generate from scratch or adapt from an existing FreeBSD 15.1 host. In part three, we will boot into the new BE, and start making it a home for our new updated NAS.

So after plugging in files from zVault or locally generating them, we are pretty much ready to boot into the new BE. Note that TrueNAS/zVault uses beadm instead of bectl. The commands are pretty much the same, so issuing a beadm activate default will point your next reboot to the new BE. (boot environments are so cool, aren't they?)

default is the traditional name of the current boot env on my FreeBSD hosts, and older BEs get saved to names such as 15.1-RELEASE-p5_2026-10-22_111418. Some people disagree vehemently with naming the default BE as default, but this was recommended to me by Allan Jude. Once you activate the 15.1 BE, reboot the system, and you should come up on the 15.1 system. However, you will need to, for the first boot, boot into single user and issue the following commands. The reason is that I was unable to chroot into the new BE from the old, and set the root password:

# adjkerntz -i # mount -u / # /etc/rc.d/hostid start # zfs mount -a # passwd root

Once the password is set, hit control-D to boot to multi-user and log in as root.

At this point, I am going to diverge a bit, because I run my infrastructure via ansible, doing patching (freebsd-update as well as pkg upgrade), provisioning new hosts (jails and physical boxes), and other tasks. For jails, as they are software, I install these packages (sans git) So I am going to install several packages that are essential both for ansible, installing samba (4.25 at the time of this writing in Nov, 2026), and basic tools that will be needed:

  • python312
  • sudo
  • rsync
  • vim
  • bash
  • tmux
  • git
  • samba425

To this end, we need to manually create an ansible user and add to sudoers, which you installed above:

echo '$6$L46N4PhqLBdUzjiW$CBOaN.SauvrJl.hsK2z.51qTPulGJ1.cILSylWY9rPVE4SdHTlopScjqlKwgRBeQW4NWCdJQlRZhqWSRkNdg/1' | pw useradd -n ansible -c "ansible user" -d /home/ansible -u 151 -m -s /usr/local/bin/bash -H 0 ; echo "ansible ALL=(ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers.d/ansible

Then ssh into the ansible host as the ansible user, and copy the ssh key to the NAS host. At this point, the provision role can be run. This role does the following:

  • Removes ssh moduli of less than 3072 bits
  • Configures the latest repo
  • Sets up /etc/hosts
  • Installs extra packages on hardware hosts (e.g. ntp and smartd)
  • Installs still more ZFS related packages on hosts running ZFS (e.g. zfstools) and set up the snapshots schedule in cron.
  • Sets up my user and the user for BackupPC. Also sets up the users' .profile and .bashrc and ssh keys.
  • Install and configure Dragonfly Mail Agent (dma).

Once the provision script runs, set zfs parameters...for the non-privileged user (my non-priv user is storm):

zfs allow -u storm atime,bookmark,canmount,clone,compression,create,destroy,diff,hold,mount,mountpoint,snapshot,promote,receive,release,rename,rollback,share,snapshot,send,userprop boot-pool

Note that the change-key, load-key, and unload-key will generate an error if zfs native encryption is not on the existing BE.

An issue to consider is that the nature of the zVault/TrueNAS alikes is that they kind of encourage you to run as root. On this BE, since I have my normal user, and since WebZFS requires a non-privileged user, I ran my standard provision playbook, however all of the shares (at least on nfs) are going to be shared out as root as before. There are other use cases where admins set up

Now we will go through the process of the installation of WebZFS. As it is in late beta, approaching its 1.0 release, it is available via github. Use the following steps:

  • Pick a location to place the WebZFS sources. I use /var/tmp.
    cd /var/tmp
    git clone https://github.com/webzfs/webzfs.git
    cd webzfs
    ./install_freebsd.sh
  • The installer will install all dependecies and install webzfs to /opt. Answer yes to the question about starting on boot, and no to start now, until we can adjust the configuration.

Make the following changes to the configuration file, /opt/webzfs/.env:

  • Add your non-privileged user to SHELL_ALLOWED_USERS, ZFS_DELEGATION_ALLOWED_USERS, and SHELL_RECORDING_AUDIT_USERS
  • Change the BIND_IP to 0.0.0.0. This will cause webzfs to listen on localhost and any external IPs. I do this because my NAS boxes are in the rack in my basement, have a KVM console with no X, and no browser. Thus, as with most of my servers, I manage it remotely.
  • You can set up emails if you so desire.
  • service webzfs start to start the tool
  • Point your browser at http:<hostname>:26619/ and log in as your non-privileged user.

At this point, we have a working BE with WebZFS installed. In the next part, we will explore actually turning this standalone host into a NAS, by importing the pool and working through providing data services.

Thoughts? Leave a comment