Author Archives: Norm

Update dnsmasq in OpenWRT for unRAID

I’ve been having some router issues and have temporarily moved from dd-wrt to Open-WRT. Since I have https turned on for my unRAID server, I needed to modify the dnsmasq file so that I can access the unRAID GUI, as DNS rebinding protection is turned on by default in OpenWRT. Spaceinvader One shows how to do this for pfSense and dd-wrt, which is pretty easy, as you can add the required text directly into the GUI for those. Not true with OpenWRT. You will need to ssh into OpenWRT and then locate the file:

/etc/dnsmasq.conf

Open this file using vi and add the following line to the bottom of the file:

rebind-domain-ok=unraid.net

Save and quit. Then restart dnsmasq with the following command:

/etc/init.d/dnsmasq restart

All should be good.

Testing Network Transfer Speed Between unRAID and macOS

This post is a follow up to the previous post about creating RAM disks on unRAID and macOS in order to test network transfer speeds. I actually used this method first, as it was the easier of the two and gave me exact transfer rates. The key is to use iPerf3.

Installing iPerf3 on unRAID

Installing iPerf3 on unRAID is a snap using the excellent Nerd Pack plugin. Assuming you have the Community Apps (CA) plugin installed, navigate to the Apps tab and search for “nerd”. Click on the resulting Nerd Pack link in the drop down to install the plugin.

Once installed, click on the gear icon (settings) for Nerd Pack. You will be presented with a long list of packages that can be installed. Scan down until you find:

iperf-3.1.6-x86_64-1cf.txz

the latest version when this post was written. Just click the slider on the far right to ON and the package will be installed.

Running iPerf3 in Server Mode on unRAID

Click the Terminal icon >_ in the upper righthand corner of the unRAID window, right below the Uptime display. In the Terminal window that pops up, type the following command:

iperf3 -s

You will see the following server response letting you know it’s listening:

------------------------------------------------
Server listening on 5201
------------------------------------------------

Installing iPerf3 on macOS

The easiest way to install iPerf3 on macOS is to use Homebrew. If you don’t have Homebrew installed, click the Homebrew link in the previous sentence and it will take you to the install instructions. Once Homebrew is installed, installing iPerf3 is as easy as typing the following command in a Terminal window:

brew install iPerf3

Running iPerf3 in Client Mode on macOS

Now that iPerf3 is installed, just type the following command to test your network speed:

iperf3 -c xx:xx:xx:xx

where xx:xx:xx:xx is the IP address of your unRAID server (or more specifically, depending on your setup, the IP address of the 10 GB NIC in your unRAID server). After issuing that command, Terminal will print out (something similar to) the following (in both the client and server terminal windows):

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  1.09 GBytes  9.35 Gbits/sec                  
[  5]   1.00-2.00   sec  1.08 GBytes  9.30 Gbits/sec                  
[  5]   2.00-3.00   sec  1.09 GBytes  9.40 Gbits/sec                  
[  5]   3.00-4.00   sec  1.09 GBytes  9.37 Gbits/sec                  
[  5]   4.00-5.00   sec  1020 MBytes  8.56 Gbits/sec                  
[  5]   5.00-6.00   sec  1.04 GBytes  8.94 Gbits/sec                  
[  5]   6.00-7.00   sec  1.09 GBytes  9.38 Gbits/sec                  
[  5]   7.00-8.00   sec  1.09 GBytes  9.35 Gbits/sec                  
[  5]   8.00-9.00   sec  1.09 GBytes  9.40 Gbits/sec                  
[  5]   9.00-10.00  sec  1.07 GBytes  9.20 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  10.7 GBytes  9.23 Gbits/sec                  sender
[  5]   0.00-10.00  sec  10.7 GBytes  9.23 Gbits/sec                  receiver

Congratulations, you are now riding the light at 10 Gig speeds!

Creating a RAM disk in unRAID (and macOS)

I’ve been playing around with unRAID for about a month now and find it very interesting. I just purchased 2 10 GBE ASUS/Aquantia NICs and wanted to test the network transfer speed.

Unfortunately, one quickly finds out the Array and/or SSD cache read speeds become the bottleneck and you don’t see the full 10 Gbps throughput. In order to mitigate this, I created a RAM disk on the unRAID server and then another RAM disk on my Hackintosh. Creating the macOS RAM disk is easy but it took some digging to find how to create a RAM disk on unRAID. Hopefully this will help anyone trying to create a RAM disk on unRAID moving forward.

Creating a RAM disk in unRAID

  1. Stop the Array.
  2. Go to Settings > SMB
  3. In Samba extra configuration, paste the following:
[ramdisk]
path = /mnt/ramdisk
comment =
browseable = yes
public = yes
writeable = yes
vfs objects =
  1. Click Apply, then Done.
  2. Restart Array.
  3. Mount your Flash drive/share
  4. Open the Go file (inside the Config folder) using a text editor.
  5. Paste the following:
mkdir -p /mnt/ramdisk
  1. Save the Go file.
  2. Reboot the unRAID server.

While the ramdisk will not show up under the Shares tab, it will show up as a share when you connect to your unRAID server. It will also show up in Krusader under /mnt/ramdisk. The size of the RAM disk defaults to half of the available RAM.

Creating a RAM disk in macOS (Catalina)

  1. Open the Terminal app and enter the following command:
diskutil partitionDisk $(hdiutil attach -nomount ram://8388608) 1 GPTFormat APFS 'RAMDisk' '100%'

This will create a 4GB APFS formatted RAMdisk. The RAM amount is specified in blocks. You calculate the RAM amount as follows:

2048 (blocks) * RAM disk size in MB (1GB = 1024MB)

4GB RAM disk = 2048 * 4 * 1024 = 8388608

1GB RAM disk = 2097152

Enjoy!

Favourite Books of 2019

Ah, one of those dreaded “best of” posts. As you can see from my Books page, I managed to read/listen to 71 books this year. Granted, several of them were short stories or novellas, but still, a new record for me! Given this new PR, I thought I would post my 3 favourite books from this year.

While many were good or very good, and a few terrible, these 3 make my best of list because they had super characters, great storylines, and unique twists and turns that kept me thinking about these books long after I finished reading them. All three of these fit into the hard science fiction genre, which is one of my favourites in addition to non-fiction science books.

Resize a sparsebundle Disk Image in Terminal

I was trying to resize a sparsebundle disk image using Disk Utility and kept getting the error that the image resize had failed. The selected disk image could not be resized. Terminal to the rescue. The following command resized my disk image without any issues:

hdiutil resize -size XXXg /pathTo/diskimage.dmg

Change XXX to the size you would like, enter the path to your disk image Terminal may spit out some lines of “text” but you can ignore those. This process will resize the disk image but it has not expanded the container. Find the physical stores name (disk name) for your disk image either using the Disk Utility app or via the Terminal with the following command:

diskutil list

Once you have the correct disk name, eg. disk4s1, enter the following command into Terminal to expand the container:

diskutil apfs resizeContainer disk4s1 0

Terminal will show you the progress of the expansion. I found I had to unmount and then remount the disk image for the Finder to show the correct size, which you can also verify using Disk Utility.

NHL 2019 Playoff Bracket

While my heart is with the Leafs, I think it’s going to be difficult for anyone to beat Tampa this year. I’d love to see the NHL go (back) to the NBA style playoff structure, where 1 plays 8 but until that time (at least 2 more years), some of the best playoff hockey will be in the first 2 rounds.