The MediaServer is the central storage location for all of the A/V files to be served. The intent is that it will also run any automated applications to get new media files (mainly via BitTorrent? ).

Hardware:

I had an AMD Athlon 1900, Asus motherboard, 1gb RAM, 120gb Seagate Barracuda HD, and a CD/DVD drive already. I picked up a gigabit ethernet card ($25), 420watt Antec silent power supply ($79), two Promise TX2 ATA 133 PCI adapters ($45/ea) and 4 160gb Seagate PATA drives (purchased over the course of a few months using various rebates - the drives ended up all being in the ~$50 range) to be set up as a RAID 5 array. I set up the machine with the 120gb drive as the boot/system drive (I had purchased it for a TiVo? upgrade I've not gotten around to). The Promise cards have two IDE channels per card and I set each drive to be the master and attached each one to it's own channel (IDE cannot access two devices on the same bus at the same time - so doubling up drives would slow things down significantly).

I used a generic full-height case I had laying around as well, with two large fans in front of the drive bays. I added one of those bling-bling fan controllers that takes up a 5.25" slot and includes fan and temp readouts and alarms. I also added a few LEDs for hard drive monitoring on the Promise controllers. Turns out that those long gray CD audio cables that I seem to have accumulated dozens of are perfect for the job. A little trimming with an Xacto knife and they fit over the HD LED pins on the Promise cards just fine. Likewise, off-the-shelf LEDs fit right into the other end just fine as well. It just takes a little trial and error to get the polarity straight. TO DO Figure out how to add LM_sensors support and be able to have a system daemon monitor this stuff remotely.

I decided to upgrade part of the home lan to gigabit ethernet in case it was required for streaming HDTV content to the MediaPC in the HomeTheater and I'd thought prices were down on gigabit hardware. Turns out that while gigabit cards are cheap, switches are not. I've got an 8 port switch at the HomeTheater and another 12 port switch in the basement. 8 port switches as of this writing are ~$80 and 16 port switches are $300. We'll just have to hold out and see if we really need it.

The whole shebang will be stuck in the basement plugged into a UPS in case of blackouts.

Total cost: ~$400 Raid size: 441gb

Software:

OS

The OS choices were:
  • OpenBSD? 3.6 - My usual OS of choice, but a PITA to configure. I wanted more or less plug and play this time 'round. Plus I couldn't get it to work with the Promise cards.
  • Red Hat Fedora - Not really clear on just what you get with this. Are 'the general public' even allowed to run it? Where do I get it? Too many questions, not enough answers.
  • Debian - My friend gave it high marks as his RAID server OS. Libranet 2.8.1 was pitched as having a good installer, so I gave it a try.

RAID

In setting up the RAID, I referred to the docs [http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html here] and the forum post [http://forum.libranet.com/viewtopic.php?t=4710&highlight=raid here].

I did struggle a bit with getting RAID working under Debian. The basic procedure goes something like this:

  1. cfdisk all of the RAID disks with filetype FD (Raid Autodetect), then run mkfs.ext3 on each one.
  2. recompile the kernel with RAID support (and dont forget to add in large RAM support if you've got more than 800mb of RAM)
  3. install the mdadm RAID admin package (a little better than raidctl)
  4. use mdadm to create the raid.
  5. run mkfs.ext3 on the RAID to create one big large file system

I think my big stumbling block was I fired up the RAID kernel before I cfdisk'd the drives, so the kernel would try to automount the drives before the RAID was ready to be built. to get around this, I booted back to the previous kernel (bless Libranet for adding the previous kernel to Grub after a new kernel compile!)

I set up the RAID to automount under /home/share (via editing fstab) and set up SAMBA to share /home/share. TO DO The SAMBA config is not correct, the share folder is not visible, but can be accessed directly. I'd like to set it up as anonymous read-only and have a few accounts with write access.

General Customization

Immediately after getting the install up and running and X configured, I installed Firefox and added it to the KDE shell launch menu. Be sure to do this as the user you want to use, rather than as root or you'll be fighting privaledge issues every step of the way.

Torrents

To handle downloading torrents, I went with Azureus - I had plenty of experience with it under Windows and I knew there was a raw Java version available that would work under *nux. Again, install as the user you wish to run as to avoid privaledge conflicts. Tweaks I did to Azureus:
  • Installed the excellent plugin called RSSFeed (even better than the previously documented RSS Importer plugin) that I use to scrape several RSS feeds for TV shows and Essential Mixes.
  • Set up Azureus to monitor an Incoming folder for new torrents so I can download torrents elsewhere and scp them into the folder without needing to fire up any UI. TO DO Set up FTP to make the Incoming folder an anonymous drop box so I dont have to SCP files over.
  • Set Azureus to move completed downloads to an 'incoming' folder on the RAID drive so they're visibile from other machines for categorizing and management.
  • Added the Swing WEB UI plugin for HTTP access to Azureus.
  • Added the Status Mailer plugin to email me when downloads are complete.

This solution is ''almost'' perfect. The only real problems currently are a lack of post-processing (moving files after download, adding them to iTunes, etc.) and that a few of the torrent RSS feeds I love require cookies enabled to download (wtf?!) and Azureus/RSSFeed don't support that yet (nor do any other apps other than directly accessing via browser, as near as I can tell).

VNC

For remote management, I discovered that you can run VNC as a server without requiring it to attach to an existing Xwindows session (initially, I was pissed about this, then I realized it was even better than having an open X session on the machine all the time). Here's the steps I followed (taken from the [http://www.amule.org/wiki/index.php/How_to_launch_VNC_with_aMule_at_Linux_boot Amule] site.
Run (as root):

apt-get install vncserver xvncviewer flwm

There is no support for ~/.vnc/xstartup so, instead, use $vncStartup in .vncrc to determine a xstartup-script (this replaces your ~/.xsession file).

For more information, read man vnc.conf

For example, in a Woody/Sarge/Sid:
Login as the user who is going to run aMule
mkdir ~/.vnc/
Create the ~/.vnc/xstartup file, with the next content


/usr/bin/flwm &
/usr/bin/amule &
/usr/bin/amule &

With sone versions of vncserver, it's necessary to launch at least twice the aMule. The flwm is an optional window manager.

Create the file ~/.vncrc with the next content:
Login as the user and run xvncviewer :1 to create the password file and debug possible probelms (the logs are under the ~/.vnc/ dir

$vncStartup = "/home/amule/.vnc/xstartup";
$geometry ="800x600";

(replace /home/amule for the home of the user running VNC)

To show the aMule window, run: xvncviewer localhost:1

If you want to autostart a VNC session on system startup, you can put a line in /etc/init.d/bootmisc.sh like this:


su username -c vncserver


Replace username with the name of the user that you want to launch vnc. (Added by ghent) 
I tweaked the files to launch Azureus and KDE instead of aMule and flwm and run in 1024x768 as Azureus is pretty UI-heavy.

UPDATE I've since migrated to RedHatFedora? FC4. VNC is installed as part of the Misc Servers package. The updated steps for getting it to auto-launch under Fedora are as follows:

  • Login as the user and run vncserver once to set up the initial configuration.
  • type vncserver kill :1 to kill the server
  • In the user's home folder, edit the .vnc/xstartup file and uncomment the two lines for normal desktop and comment out the remaining lines. Then add ~/azureus/azureus & to the end of the file.
  • in /etc/rc.d/rc.local and add su username -c vncserver to the end of the file (replacing username with the user who will be hosting the VNC server.

That should do it.

General To Do

iTunes

Right now, I have iTunes running on a G4 cube and plan to point it to the shared folder on the MediaServer. In the past, I've known iTunes to be pretty finicky about that (if iTunes cannot see the library on startup, it defaults to the home folder), so maybe some server-based solution is in order (I'm locked to iTunes because I have some ITMS songs and more than half of the connection is AAC and I love my iPod :)). There's a program called daapd that shares your library via the iTunes music protocol. It doesn't seem to provide any actual song management functionality, it just shows the library as a Shared Music Library in the iTunes interface and allows you to stream tunes. As a shared library, you can't sync the songs to the iPod, so that's pretty much a deal-breaker. Still, it's something to play with.

Podcasting

I'm a big fan of listening to podcasts on my morning commute. My current solution is a registered copy of iPodderX (Thanks coverville!) on my Cube which I sync the iPod with in the morning. I'd like to get a Podcasting client set up on the server, but I'm not sure how to get iTunes to add the files automatically. I'm pretty sure the podcasting clients on OS-X call an AddSongToLibrary? API. If I install daadp, are there hooks there?

Automated File Management

Right now, there file system is in a state of disarray. With applications adding files automatically from a variety of sources, and player applications not providing much in the way of categorization (Windows Media Center particularly), file management is a big issue. Windows MCE categorizes video files by folder, so there needs to be some automated script to move video files around. Music files are handled by their meta tags, but so many of mine are poorly tagged or not tagged at all. Currently, it's all a manual process that eats too much free time.

-- ChrisWeiss - 11 Feb 2005

Topic revision: r2 - 29 Oct 2005 - 15:59:04 - ChrisWeiss
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback