5b14, Running from Slack64, Latest Virtualbox, some notes


Recommended Posts

First off, not sure which forum this comes under. I believe I'm finally finished setting this build up on my server at home, I just wanted to share some of my notes from going through the process in case someone else has similar problems or is setting up a similar environment.

 

Also, apologies in advance for the length.

All up it took me 4 or 5 days, most of that time was spent making backups of existing data, partially restoring the backups and waiting for parity checks/builds to complete ... found a faulty drive in the process.

 

At this stage I'm still 'testing' it (and will be for a few months due to using 5b14), however everything appears to be working fine. I'll be adding more drives (and yes buying a couple of licenses in the near future), so I'll see how that turns out.

 

From the start, I wanted to create a build that satisfied these requirements:

  • Using unRAID 5.0 beta 14
  • Running from hard disk (Slackware 13.1, kernel 3.1.1)
  • 64-bit system (Slackware64 w/ multilib)
  • Latest VirtualBox installed & running 2x VM guests
  • Mediatomb compiled & running (I have a custom import.js script, and play everything on my WD TV Live)

 

Notes:

  • I used this guide for most of it. Very well written and really not that many problems! (I have compiled a few kernels in my time, so that may have been an advantage ...)
  • For adding in multilib support, following the 'quick & dirty' part of this guide was all that was necessary.
  • The forum thread here regarding 64-bit support mentions changing the symlinks to ensure unRAID uses the correct libraries; this wasn't necessary. (Actually unRAID restored the original symlinks upon reboot!) My build displays HDD's the same way under the Main tab of the unRAID web interface as mentioned in the thread.
  • The guide to installing VirtualBox in unRAID (here) was very informative but ultimately redundant in this setup. If you install the dev libraries with Slack64 during install and compile your own kernel (as part of the guide to installing unRAID to a full slack distro) then the VirtualBox installer from Oracle's website should simply install without a hitch. Just remember to run guest VM's under a user not root ...

 

Here's a list of problems I encountered & the solutions:

Unable to boot from flash disk

  • Cause: flash disk not properly formatted & prepared correctly
  • Solution: Proper formatting of flash disk using guiformat.exe (fat32format)

Creating USB flash boot disk for Slackware64

  • Cause: Provided file & instructions are linux-specific
  • Solution: Boot from existing linux-based USB flask boot disk, use dd from within root console to overwrite 2nd USB flash boot disk (dd if=/folder/usbboot.img of=/dev/sdX bs=512)

Cannot boot slackware system once installed on HDD

  • Cause: Question at end of Slack install process - 'Detected OS/2 or Partition Magic boot loader'
  • Solution: ANSWER NO at this question.
  • Additional info: Suspect Slack installer is detecting the unetbootin/tuxboot bootloader on the USB flash disk

Slackware USB install doesn't show any Slackware64 libraries to install!!

  • Cause: Using Slackware USB flash disk to install Slackware64
  • Solution: Use the Slackware64 USB flash disk installer to install Slackware64 (sigh)

Unable to access newly created files on user shares

  • Cause: Messing with users outside of unRAID ... initially thought it was a samba bug
  • Solution: Don't create/edit/touch users outside of unRAID to be used within unRAID!

 

Finally, on compiling & running Mediatomb:

ffmpeg

Used AlienBob's ffmpeg SlackBuild to setup ffmpeg. The pre-built packages didn't work as they are compiled in an x11 environment (my server is headless). Had to make a few customisations:

  • You need YASM 1.0 at least to build x264. Used slackbuild.org to find the latest.
  • Added --disable-fontconfig to the libass configure.
  • Disabled vaapi in the final ffmpeg compile - short answer is couldn't bothered getting the drivers setup for the AMD chipset on my MB.
  • This gives you ffmpeg 0.9

mediatomb

  • Used slackBuilds from SlackBuild.org to add in support for libmp4v2 & SpiderMonkey js - need the js for my custom import.js script in mediatomb.
  • Compiling mediatomb against latest ffmpeg (0.9) fails as specified in this bug report. There's a patch there which when added to the Mediatomb sources then allows Mediatomb to be compiled with the slackBuild from SBo.
  • As its probably not a good idea to be accessing /mnt/diskX or /mnt/shares directly from within the server (and behind unRAID's back ... it might get offended) I added an entry to fstab to mount one of unRAIDS CIFS shares - specified noauto as I'll figure out how to auto-mount it later. Will probably fail if its mounted before emhttp brings it up.

 

At the moment I only have the one 1Tb WD drive in there - its not an EARS but the 3x 2Tb drives I have are. One is used for parity, and one is holding a backup of just about everything I hold dear so is not going into the array any time soon.

Maybe in another 6 months if the array is still stable & no other bugs have turned up (maybe 5.0 will be out of beta by then too).

The third 2Tb EARS was the faulty one (wasted a good 12 hours waiting for 2x parity checks to confirm) and I'll be sending it away for RMA tomorrow (today is a public holiday).

 

I have a 4th one but can't use it yet (no comment).

 

Hardware is:

AMD Phenom II X6 1090T

8gb g.skill memory (1300mhz I think)

Gigabyte 890GPA-UD3H v2.1

Antec 900-2 case, got about 10 fans all over it.

 

cheers

Link to comment

Nice writeup and thank you for sharing your experiences. I never got around to updating that other thread with more recent information.

 

As you mentioned, some items have changed and are no longer needed, such as the updating of certain symlinks or the copying of certain libs from the original unRAID distro and the web interface displays drives correctly now. At the time I initially setup 64bit unRAID, the usb distro was based off Slackware 12.2 and I was trying to use Slackware 13.1, but since that time unRAID 5.x beta 13/14 are significantly closer to being Slackware 13.37 and more compatible.

 

One word of note though, you're perfectly fine with accessing any and all /mnt/disk# and /mnt/share(s). Those are the interface into unRAID. What you need to avoid is accessing /dev/sdX or /dev/hdX for the drives which are part of your unRAID array. The only item to note is that in order to shutdown the array, you will need to stop all the programs which are accessing the drives.

 

One trick I use is to have a scratch drive outside the unRAID array. That way I don't need to shut down as many programs if I need to make minor adjustments to the array.

 

To easily automate the process of system shutdown, I have all my addons using /etc/rc.d/rc.<process> scripts which are hooked into the /etc/rc.d/rc.local_shutdown script. For simplifying the startup process, the scripts are then hooked into the /etc/rc.d/rc.local startup script.

 

For instance:

#!/bin/sh
#
# /etc/rc.d/rc.local_shutdown: local system shutdown script.

if [ -x /etc/rc.d/rc.cache_dirs ]; then
  . /etc/rc.d/rc.cache_dirs stop
fi

if [ -x /etc/rc.d/rc.transmission-daemon ]; then
  . /etc/rc.d/rc.transmission-daemon stop
fi

if [ -x /etc/rc.d/rc.sabnzbd ]; then
. /etc/rc.d/rc.sabnzbd stop
fi

if [ -x /etc/rc.d/rc.eggdrop ]; then
. /etc/rc.d/rc.eggdrop stop
fi

# start the control group items
#if [ -x /etc/rc.d/rc.cgred ]; then
#  . /etc/rc.d/rc.cgred stop
#fi

#if [ -x /etc/rc.d/rc.cgconfig ]; then
#  . /etc/rc.d/rc.cgconfig stop
#fi

# kick off unraid powerdown
[ -x /etc/rc.d/rc.unRAID ] && /etc/rc.d/rc.unRAID stop

 

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

# kick off identd
if [ -x /etc/rc.d/rc.oidentd ]; then
  . /etc/rc.d/rc.oidentd start
fi

# Invoke the 'go' script
if [ -f /boot/config/go ]; then
  echo "Starting unRAID GO script..."
  fromdos </boot/config/go >/var/tmp/go
  chmod +x /var/tmp/go
  /var/tmp/go
fi

if [ -x /etc/rc.d/rc.unRAID ]; then
  echo "Starting unRAID..."
  . /etc/rc.d/rc.unRAID start
fi

if [ -x /etc/rc.d/rc.sabnzbd ]; then
  echo "Starting Usenet daemon..."
  . /etc/rc.d/rc.sabnzbd start
fi

if [ -x /etc/rc.d/rc.transmission-daemon ]; then
  echo "Starting Torrent daemon..."
  . /etc/rc.d/rc.transmission-daemon start
fi

if [ -x /etc/rc.d/rc.eggdrop ]; then
  echo "Starting IRC daemon..."
  . /etc/rc.d/rc.eggdrop start
fi

if [ -x /etc/rc.d/rc.cache_dirs ]; then
  . /etc/rc.d/rc.cache_dirs start
fi

# local settings hack
hdparm -B 255 /dev/sda

# invoke apc ups
if [ -x /etc/rc.d/rc.apcupsd ]; then
  echo "Starting APC UPS daemon..."
  . /etc/rc.d/rc.apcupsd start
fi

Link to comment
One word of note though, you're perfectly fine with accessing any and all /mnt/disk# and /mnt/share(s).

 

Cheers! That helps tremendously.

 

The shutting down of access to shares before stopping array shouldn't be a problem - the point of the vm's is that they can then access the user shares of unRAID via CIFS, so the normal way of shutting down the array should be sufficient (if I'm correct it shuts down SMB/CIFS shares first anyway).

 

At this stage only a couple of things to work on:

  • Auto-starting the vm's after everything has booted up ... I might use that startup script thingo you've posted, it looks neat.
  • Creating a script that will do what clicking 'stop array' does, as well as shutting down the vm's & then performing a shutdown of the server in one hit ... again I think one of your scripts there looks neat, I will use that as a starting point.
  • Once thats working ... get the UPS I have talking to the server ... its an old Cabac one with a new battery. Still have to get the serial <-> USB cable for it though. I think unMenu can do it, but when I tried to install it yesterday it didn't work at all for me, didn't have to time to investigate =(
  • Trying to get deluge (bittorrent server ... thats what one of the vm's is for) to pause all seeds when the share connection drops (ie when the array goes down). Otherwise it will instantly try to start downloading all my seeding torrents ...

 

I'll post notes as I get through all this stuff.

Link to comment

Replying to my own ... reply. I'm pretty sure deluge has a cli interface, so if I can add in an extra command to tell the deluge server to pause all torrents when the array goes down ... that would be neat. I can always manually start them again, but its the pausing when the array goes down that concerns me the most.

 

Food for thought.

Link to comment

Finally got unMenu set up & installed. Turned out the locally added share (ie mount.cifs //127.0.0.1/share /media/my_share) for mediatomb caused the initial commands that uu invoked (ie df --block-size=1000) to get stuck in a loop. Browsing to //tower:8080 would just stall 'waiting for server'.

 

Welp that seals it not using locally added shares!!

 

Also installed unMenu to the flash drive (/flash/unmenu) then added symlinks to the relevant directories off /boot (/boot/packages, /boot/unmenu etc). All seems to be working ok. Just need to get myself one of these USB <-> serial cables now ...

Link to comment

Got my script written for starting VM's on bootup. I found a much more comprehensive one (okay for some reason the forum doesn't like my link, it points to a pastebin entry), it seemed a bit too complicated for me. My script is made to be called by root but will just run the guests as the chosen user. (It calls them by UUID)

 

Some of it is a bit kludgey, I'm not the best of bash script writers. I've created a button for it in unmenu, which just calls the script.

 

I'm still a bit hesitant on starting the VM's automatically on boot, I'd like to get the timing correct. ie Only if the network interface & array is online.

 

Anyway, here's the script:

#!/bin/sh

VBOX_MANAGE=/usr/bin/VBoxManage
VBOX_HEADLESS=/usr/bin/VBoxHeadless
VBOX_USER=vmadmin  # kind of redundant considering I couldn't figure out how to use it
VMNAME=

for uuid in $(su vmadmin -c "VBoxManage list vms | sed -e 's/^.*{\(*.\)}$/\1/'")
do
  eval "su vmadmin -c \"VBoxManage list vms | sed '/{$uuid}$/!d' | sed -e 's/.{$uuid}$//' > /tmp/vmname.tmp\""
  VMNAME=`cat /tmp/vmname.tmp`
  echo "Starting $VMNAME ..."
  sudo -u $VBOX_USER -H -b $VBOX_HEADLESS -startvm $uuid
done

rm /tmp/vmname.tmp

(edit: improved it upon review ...)

 

 

Shutting down the VM's is made a bit simpler by both of them being Linux guests. I've set up 'passwordless' ssh logins using keychain, so its just a matter of sending a couple of shutdown commands to them. (I don't think they respond to ACPI events, I've never investigated this fully)

 

From there its not difficult to add them to rc.local_shutdown. Last step will be adding a command to pause all open torrents that access the array when the array goes down.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.