When I was initially looking at my options there was only one NAS oriented OS that seemed to meet all my requirements - OpenMediaVault. I did install it and tried to get it set up the way I wanted, but after much struggle, headache and frustration I decided to give up and use a bare minimum distribution instead.
I chose DietPi as the OS to run on my XU4. I was a little skeptical at first given how gaudy their web site is, but it's actually a very well put together Debian (Jessie) Linux based distribution for ARM.
If you read my previous posts, I jumped the gun in sealing my XU4 in the enclosure so was forced to boot from the SD card and transfer files over to the eMMC afterwards. That wasn't a big deal, just meant a couple extra reboots. When booting from the SD card, the eMMC is visible as the first block device so copying the DietPi image is as simple as...
After booting from the eMMC, the initial setup was simple and guided by the installer...
- Login as root
- Accept update request
- Set up networking
- XU4 restarts here
- Login as root again, installer runs again
At this point you're given the option to select which software you want, I picked the following:
- Plex Media Server
Then just select GO and let the installer do its thing.
At this point I had most of the software I wanted, but not all. Specifically, webmin was missing. Installing it was a little more involved, the following commands did it though...
That took care of webmin, but a few others were still required. I needed HFS+ support since the disks I was copying from were from an OS X server. The rsync, and other utilities were there to assist in the file migration process and avahi-daemon for aesthetic reasons I'll cover later. I installed these using apt-get...
I was going to use Plex for the media server, which goes hand-in-hand with Trakt.tv so the Plex Trakt Scrobbler was installed. I had major issues trying to get this working when I had OpenMediaVault installed, on DietPi the install and running of this plugin went without a hitch. Install instructions can be found here.
Next was time to copy my 3Tb+ of data from the HFS+ disks. These mounted without any issue and I used rsync to copy them over. It took about two days (with breaks in between). The maximum transfer speeds I could get were 40Mb/s, which is well under USB 3.0 speeds, which is probably more due to the HDD enclosure than the XU4. This was the command I used to copy data...
While data was being copied (in a screen session) I did some research on performance, fan speed and cooling of the XU4. This thread on fan control was very useful. I experimented with setting the fan speed as follows:
To make these permanent I created the /etc/udev/rules.d/60-odroid_fan.rules file with the following contents:
At the same time, using dietpi-config I set Performance Options as follows:
Why those (non-performant) settings? Mostly because there is no need to run the XU4 flat-out when it is idle or in light use. Those settings work well for file copy and direct Plex streaming. It does ramp up when needed but my main focus was having just enough performance while keeping the whole setup cool.
I noticed that i had the spi1 process running all the time and taking up considerable CPU (around 20%). After some research I found this process is for the CloudShell and since I don't have one, I decided to disable the SPI module by creating the /etc/modprobe.d/blacklist file with the following contents:
To make the module blacklisting permanent, I ran the command below and restarted.
I was getting annoyed by the heartbeat LED on the XU4 flashing all the time. Fortunately this was easy to disable on boot by adding the following line to /etc/rc.local. That makes the blue heartbeat LED flash only during eMMC access instead of on timed intervals.
In my setup I use an SSD as a kind of temporary/cache drive. That is so that the large 4Tb disk is not used unnecessarily. That means torrent downloads, data for my traffic cam and Plex metadata are located there. By default Plex metadata is on the eMMC (or the / partition) which is not ideal, so I moved it to the SSD (mounted at /mnt/Stage1) after shutting down the plexmediaserver service (/etc/init.d/plexmediaserver stop). Instead of just moving the data I made a copy and renamed the old directory to keep as a backup...
After copying metadata, the /etc/default/plexmediaserver config file was updated with the new location as follows:
Now coming back to the aesthetic reasons I mentioned earlier. I wanted to control how the server name and icon appeared when viewed form my MacBook Pro. The first image shows the before and second image the after version of what Finder displays. The second is much more pleasant I think.
To set that up, I added the Samba service to Avahi configuration as follows:
To make the above work the hostname was also set to 'PulseDroid' i.e. it was in camel case, not standard lower case.
Lastly, after a couple of days of usage I noticed that the hard disk was spinning down and spinning up constantly. That's not so great for the disk health so I decided to change the spin down time to 2.5 hours and disable advanced power management.
Those changes can be done on the fly by running:
To make them permanent, the /etc/hdparm.conf was updated with the following contents (I did it for both disks though it's not actually needed for the SSD):
That's pretty much it for the setup. I did add a script to display system stats on the Odroid-Show2 that I have attached to the XU4, which I'll cover in a separate post.