Using your Microserver as a Squeezebox Music Server (OpenMediaVault)

AVForums

Help Support AVForums:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Now Playing

AVForums Super Veteran
Joined
May 25, 2010
Messages
1,208
Reaction score
15
Location
South Africa
PREFACE
Only follow this guide if you plan on creating a RAID array, OMV is tightly integrated to act as a NAS so you're not able to make sustainable changes to underlying Debian config files e.g. mount points, shares etc.  It can be used with standalone disks, but it's then easier and more elegant to use Ubuntu Server.  The guidance that follows is for those stubborn buggers like myself that want my cake and to eat it, whilst being careful not to choke.


Introduction
Having heard about OpenMediaVault earlier this week (thanks Gideon) and at the same time having issues getting SBS/LMS to run on Ubuntu Server 12.04 (there are a whole series of Perl CPAN dependencies that aren't installed by default) I decided I'd try OpenMediaVault to see if it makes life easier.  At the same time I was getting strange library scan results (and inordinately long scan times) from LMS so I decided I'd revert to the last version of Squeezeboxserver made before it morphed into Logitechmediaserver.

Initial preparation
First off let me state that if you want to get the best performance out of Squeezeboxserver/ Logitechmediaserver you should install *nix as an OS.  SBS/LMS runs a hell of a lot faster under *nix than it does under any flavour of Windows I've ever tried it on - this is especially the case where library scans are concerned.  This guide speaks to an OpenMediaVault installation.

Installing OpenMediaVault Server to a memory stick using a 2nd memory stick
Secondly, let me cover some stuff that had me pulling out what little hair I have two weeks back - installing OpenMediaVault from a memory stick to another memory stick on the Microserver (harder than it should be because the Microserver is idiosyncratic). To do this, remove/ disconnect all hard drives and USB devices (other than the USB stick you want to install from) from the Microserver, fire it up and make sure the BIOS is set to boot from the USB you have inserted.  Save and exit the BIOS settings and let the Microserver start firing up the OpenMediaVault live session...whilst this is happening, insert the USB you want to install to into the motherboard USB header - it'll be visible to the OpenMediaVault live session and it'll be the only installation candidate available to you.  Once you've gotten to this point let the installation run its course.  Once it's completed, shut down the Microserver whilst removing the memory stick you booted and installed from.  Install any hard drives you want in the Microserver.  Power up the Microserver, once rebooted you can access OpenMediaVault's web interface via http://<ip of microserver>.  The default l/p are: admin/openmediavault.  From there you can configure partition and format your drives, format and RAID arrays, shares etc.

If you want to mount your drives as discrete entities rather than create a RAID array (which is best done from the OpenMediaVault Web UI) do the following at the terminal prompt:
Code:
blkid
This will return a listing of the drives installed in your Microserver.  It will look something like this:
Code:
/dev/sda1: UUID="5e917119-6a9b-441d-a714-a04655a8a4d8" TYPE="ext4" 
/dev/sdb1: UUID="de7f1768-950e-49ca-9034-d8b1d2231763" TYPE="ext4" 
/dev/sdc1: UUID="94038e76-5f89-42b9-99b2-51e3dc5cba2f" TYPE="ext4" 
/dev/sdd1: UUID="9334fa42-fed6-473f-aa39-cc03c03b6131" TYPE="ext4" 
/dev/sde1: UUID="d79f841a-d077-4668-9003-354658e724f2" TYPE="ext4" 
/dev/sdf1: UUID="73a85bc5-1162-41ca-89b7-181363f20ef4" TYPE="ext4" 
/dev/sdf5: UUID="a3a9314c-3ff5-42fd-bed3-5995244c7880" TYPE="swap"

The UUID is the unique identifier for each drive/device and is the best method of ensuring specific drives are mounted to specific mountpoints (critical for using SBS/LMS on a memory stick and moving its data files to a hard drive which is pointed to via a symbolic link).

As I don't use RAID (my collection's too large to give up a drive) I've got 5x hard drives (/dev/sda1...sde1) installed in my Microserver with each containing a single ext4 formatted partition.  Now OMV is a fully integrated NAS aimed at setting up a server as an appliance device - so it doesn't take kindly to you poking around inside its Debian configuration via the back door - doing so breaks it, as I've learned the hard way, so best you underastand what it does and work with it.  Where mounting individual drives is concerned, OMV mounts each drive in /media/UUID_of_the_drive. It does so by modifying /etc/fstab and running a "mount -a" when you mount drives through its UI (which is the only way not to break it).

Make a directory within which to mount the drives:
Code:
mkdir /diskpool
cd /diskpool
mkdir d1 d2 d3 d4 d5

Using the above output from blkid, create symbolic links to where you'd like the drives mounted:
Code:
ln -s /diskpool/d1 /media/d79f841a-d077-4668-9003-354658e724f2
ln -s /diskpool/d2 /media/de7f1768-950e-49ca-9034-d8b1d2231763
ln -s /diskpool/d3 /media/5e917119-6a9b-441d-a714-a04655a8a4d8
ln -s /diskpool/d4 /media/94038e76-5f89-42b9-99b2-51e3dc5cba2f
ln -s /diskpool/d5 /media/9334fa42-fed6-473f-aa39-cc03c03b6131

Now, using OMV's GUI goto Storage/Filesystems and mount each of the drives.  They will in effect mount to /diskpool/dx as shown above.

Now edit /etc/fstab to have Debian write log files to RAM:
Code:
sudo nano /etc/fstab
Position the cursor on a new line and paste the following into the file:
Code:
# create temporary filesystems in RAM to extend the life of your USB stick

tmpfs           /var/log        tmpfs   defaults        0       0
tmpfs           /var/tmp        tmpfs   defaults        0       0

Save the file and exit, then reprocess fstab to mount your drives:
Code:
mount -a

At this juncture I'm assuming you've a fully functional OpenMediaVault Server setup on your Microserver (which boots off a memory stick) and that you've mounted and can write to your hard drive(s).  If you're booting from a hard drive then some of what follows is irrelevant to you.

Installing SBS/LMS (see Note below before proceeding)
First off you need to add the SBS/LMS repositories to OpenMediaVault server.  In a terminal window enter the following:
Code:
nano /etc/apt/sources.list
followed by your user password when prompted.  Now add one of the following lines to the bottom of the file (stable is an official release, testing implies testing releases):
Code:
# Squeezebox
deb http://debian.slimdevices.com stable main
OR
Code:
# Squeezebox
deb http://debian.slimdevices.com testing main
Save your changes and exit.

Now type the following in the terminal window (replace <squeezeboxserver/logitechmediaserver> with whichever you wish to install):
Code:
apt-get update && apt-get install <squeezeboxserver/logitechmediaserver>

It may take a while for SBS/LMS to be downloaded and installed.

Note
If you want to install the last version of SBS that was built before the morph into LMS you can get it here (this is what I'm running) and install as follows:
Code:
wget http://downloads.slimdevices.com/SqueezeboxServer_v7.6.2_unreleased/squeezeboxserver_7.6.2~33593_all.deb
dpkg -i squeezeboxserver_7.6.2~33593_all.deb

When the install is completed SBS/LMS will automatically be started.  This represents a problem if you're running the OS on a memory stick because SBS/LMS is going to build its database on the memory stick (not a good idea from a performance perspective, if you have a large collection, or make changes to tags on a regular basis and want your USB stick to last).

To have SBS/LMS write its database to an alternative location on a hard drive stop SBS/LMS, move its data files to the location of your choice and create a symbolic link to the new destination as follows:
Stop the server
Code:
service <squeezeboxserver/logitechmediaserver> stop

Move the contents of /var/lib/squeezeboxserver/cache to the drive and folder in which you wish to house SBS/LMS' database.  I find it easiest to do this using Midnight Commander, which is installed and run as follows:
Code:
apt-get install mc && mc

Now remove the folder /var/lib/squeezeboxserver/cache and replace it with a symbolic link to the folder you moved the contents to.
Code:
rm -R /var/lib/squeezeboxserver/cache && ln -s /path/to/target/dir /var/lib/squeezeboxserver/cache

Change ownership of the symbolic link to your target directory from the "root" user to the "squeezeboxserver" user and do the same for your target directory:
Code:
chown -R squeezeboxserver:nogroup /var/lib/squeezeboxserver/cache
chown -R squeezeboxserver:nogroup /path/to/target/dir

Finally restart SBS/LMS
Code:
service <squeezeboxserver/logitechmediaserver> start

That's it, now you can go ahead and configure SBS/LMS and scan your library (I suggest that the first thing you do is tell SBS/LMS that your library and playlists are located in /tmp whilst you're configuring SBS/LMS - this avoids it triggering a scan of your library until you've set it up to run the way you like - the last step should be pointing it to your actual library for the real scan to initiate).

If, for some strange reason SBS/LMS doesn't seem to be working have a look at its server log file for an idea of what's going on:
Code:
cat /var/log/squeezeboxserver/server.log

If that doesn't give you insight into the issues, stop SBS/LMS, and create a script to restart it as follows:
Create the script:
Code:
nano sbstart.sh
Copy and past the following into the text editor:
Code:
#!/bin/bash
# Script to debug startup of squeezeboxserver/logitechmediaserver


INSTNAME='squeezeboxserver'
INSTUSER='squeezeboxserver'

PIDFILE=/var/lib/${INSTNAME}/${INSTNAME}.pid
PREFSDIR=/var/lib/${INSTNAME}/prefs
LOGDIR=/var/log/${INSTNAME}
CACHEDIR=/var/lib/${INSTNAME}/cache

OUTFILE=$(basename $0)
OUTFILE="${OUTFILE%.*}"
OUTFILE="${OUTFILE}.txt"

if [ -e ${PIDFILE} ]; then
  rm ${PIDFILE}
fi

echo "Attempting to start ${INSTNAME}.."
echo "  Console output redirected to ${OUTFILE}.."
echo "  Hit CTRL+C to terminate.."

sudo -u ${INSTUSER} /usr/bin/perl /usr/sbin/${INSTNAME} --pidfile=${PIDFILE} --prefsdir=${PREFSDIR} --logdir=${LOGDIR} --cachedir=${CACHEDIR} --charset=utf8 --diag --d_startup >${OUTFILE} 2>&1

echo "Done!  Examine ${OUTFILE} for details.."

Save the script and exit nano.
Mark the script executable and then run it
Code:
chmod +x sbstart.sh
./sbstart.sh

examine the contents of its output file for further tips.
 

Latest posts

Top