[HOWTO] Connecting to ROCK from FreeBSD with UTF-8 support

My old server recently had a hard drive die, and since it was the server running Roon (among many other things), I decided to get a NUC and put ROCK on it for Roon, and then rebuild my server on FreeBSD rather than Linux (which it had been running), so I could use Root-on-ZFS with a mirrored pair of disks to hopefully minimize issues in the future when a drive fails.

This has worked pretty well so far, except it was a bit tricky figuring out how to get it properly connecting to Roon, as I have some filenames which use non-ASCII characters in my library, so getting those represented and displaying properly required some research. I figured I’d mention what I found in case anybody else is in a similar position (migrating to FreeBSD from Linux) and has a similar question in the future.

First off was getting UTF-8 in my SSH sessions. This involved editing /etc/login.conf to add the following statements to the default block (change the language as appropriate):

        :charset=UTF-8:\
        :lang=en_US.UTF-8:\

Then I ran cap_mkdb /etc/login.conf for the OS to pick up the changes. After that, I set up /etc/nsmb.conf with info about my ROCK host by adding the following blocks to the bottom of it to force UTF-8 over the connection and to specify that the “guest” user has no password:

[ROCK]
charsets=UTF-8:UTF-8

[ROCK:GUEST]
password=

Capitalization in the section headers is important there. Also worth noting is that, at least as of 12.2, FreeBSD only supports SMB1 via its built-in SMB module, and it doesn’t easily support using Samba in fstab. There is some work happening to hopefully add SMB3 support at some point, but it’s still not a sure thing. I’m hoping it happens before ROCK drops SMB1 support.

The last thing was to create a directory to mount the ROCK share in (I decided to use /mnt/smbRock) and then to update /etc/fstab to reference it, by adding this line:

//GUEST@ROCK/Data	/mnt/smbRock	smbfs	rw,-I192.168.1.2,-N	0	0

The -I parameter has the IPv4 address of the ROCK host (192.168.1.2 in this example), rw is read/write, and -N specifies that the credentials for this user on this host are in /etc/nsmb.conf (in this case, a blank password for the guest user).

With that, I just called mount /mnt/smbRock and I was good to go, and it comes up after reboots as well. My files are properly named, both ones I copy to ROCK from the SMB connection on my FreeBSD host as well as ones I copy to it from other hosts using SMB3 and read back on my FreeBSD host.

4 Likes