MythTV Upgrade - Part 1

Introduction

I've been using MythTV for about 3 years now, both on Fedora Core and also on Ubuntu on my laptop. My first MythTV system was built with A LOT of help from Jarod Wilson's infamous How-To. A few months ago I built two MythTV systems for my family and decided to use MythDora4. It was so quick and easy that I decided to use MythDora for my own rebuild as well.

I should start off by saying that I don’t use MythTV for the PVR functionality. I use it solely as a digital jukebox. I watch TV shows and movies using MythVideo, MythMusic is always a big hit at parties, and occasionally I use MythImage for slideshows.

In the past I had all my media files on my WindowsXP box and used cifs to mount the windows shares on my MythTV box. I played music/videos directly through the share and performance was great even with a 10/100 Mbps NIC.

For this iteration, I decided to also upgrade to a 1.5TB RAID5 array so that I could start burning all of my DVD's to .ISO files. This way I can browse through my entire DVD collection digitally.

Lastly, I recently bought a Harmon/Kardon receiver and Polk Audio Center channel and Bookshelf speakers and slowly realized that I wasn’t going to be able to appreciate the new hardware unless I got digital audio working. (And yes… it is amazing)

Below, are my notes, impressions, etc for the entire setup. I am going to put as much detail as possible so that if I ever have to do this again I have it all in one place.



Hardware

Dell 8300 Tower, Dell BIOS A07
CPU: P4 2.8Ghz Hyperthreaded
Memory: 1.25Gb PC3200
Audio: M-Audio 5.1 Audio Card
Video: Nvidia GeForce 5200 AGP (VGA/DVI/SVIDIO)
Capture Card: Hauppauge PRV-150 Tuner Card
Network: 10/100/1000 Intel NIC
Storage:
(1) 40 GB HDD (IDE) (for the OS)
(2) 500GB IDE HDD's (for the RAID)
(2) 500GB SATA HDD's (for the RAID)


Configuring the OS

The install of the OS is really simple and extremely intuitive. The problems I ran into were caused by my additional disks, but were a result of a bug/lack of code/oversight/etc in the Dell BIOS. The motherboard has two IDE controllers, and two onboard SATA controllers. My buddies at work gave me the thumbs up on a RAID array that included two IDE and two SATA drives so that’s what I went ahead and did. I already had one 500 IDE, so I went and bought one more 500GB IDE and two 500GB SATA drives. This was good advice, and to fast forward, I did get it working, but Dell was not going to make it easy for me.

After tons of research trying to prove that I wasn’t crazy, I confirmed that on this Dell 8300 BIOS, if you use either or both of the SATA controllers, the BIOS will only let you boot off a SATA drive. This means that if I installed the MBR (Master Boot Record) on one of my IDE drives, no matter what I did in the BIOS, I could not boot off of it. Most BIOS’s would obviously let you choose whichever disk you would like, but of course that would make too much sense.

The most obvious option was to just install the MBR onto one of the SATA drives. However the whole point of using a separate system disk is that I want to make the RAID array and the OS completely independent of each other. If the disk that had the MBR on it died, I would be out of luck.

A more elegant solution to this problem which was proposed by my coworker, is to instal the MBR on both of the SATA disks, so that if one died, the other one would just pick up, but like I mentioned earlier, I wanted to keep the RAID seperate.

So what I finally decided to do was to install the MBR on a 128 MB USB disk. The end result is kind of a convoluted setup, but I think it’s a pretty cool solution. I like the cool factor that my machine won’t boot without that thumb drive in place, and of course this keeps my RAID array completely separate from the OS. Speaking of cool... I shortly found out that 5 drives in that stock Dell case was the farthest thing from it, but that will be a completely seperate article :)

So back to the installation. While installing the OS I choose to make my own partitioning scheme, which looked like this:
/boot partition on sdc (the USB disk) using all 128MB
/boot1 partition on hda (100MB)
/ partition went to hda as well (my 40GB system disk).
For all three I used the ext3 filesystem.
swap went on hda as well (2048 GB)

I then installed the OS, rebooted, and FINALLY saw that wonderful line “Grub loading… Please wait” or whatever it is.

So for this first boot both phase I and II of the boot loader took place on the USB drive. To play around I wanted to also see if I could get the actual kernel to boot from the system disk rather than the USB disk. To do that I had to do the following:

I edited the grub/grub.conf that was on the USB disk to look like this:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title MythDora-hda (2.6.20-1.2944.fc6)
root (hd5,0)
kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.20-1.2944.fc6.img
title MythDora-usb (2.6.20-1.2944.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.20-1.2944.fc6.img

I then copied the following files from /boot/ to /boot1:
config-2.6.20-1.2944.fc6
initrd-2.6.20-1.2944.fc6.img
symvers-2.6.20-1.2944.fc6.gz
vmlinuz-2.6.20-1.2944.fc6
System.map-2.6.20-1.2944.fc6

I then edited /etc/fstab to look like this:

LABEL=/ / ext3 defaults 1 1
/dev/hda1 /boot ext3 defaults 1 2
Devpts /dev/pts devpts gid=5,mode=620 0 0
Tmpfs /dev/shm tmpfs defaults 0 0
Proc /proc proc defaults 0 0
Sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hda2 swap swap defaults 0 0
/dev/cdrom /media/cdrom auto noauto,ro,user 0 0


Then I rebooted again. This time, grub still ran from the USB disk, but it looked at hd5,0 for the kernel, which on my machine is /dev/hda1. It found it and then mounted /dev/hda1 to /boot.

I am not sure which is better: Leaving the entire boot partition on the USB drive, for using this phased approach; but this is the way I left it. Let me know if you think it makes a difference.


The only current problem with the actual OS (MythDora4) is that atrpms recently deprecated the FC6 package repository so updating the system is kind of at a standstill until the next version of MythDora comes out. Luckily, http://g-ding.tv/?q=content/what-were-working, shows that the next release based on Fedora Core 8 will be coming soon. They are just waiting on the release of version 0.21 of MythTV.


So I'll leave off with that. Parts two and three will include the following topics:

Configuring the storage (RAID5 + XFS)
Configuring Digital Audio (S/PDIF over coax using alsa)

Still on the task list it to get the following working:

Configuring LIRC (Remote control)
Configuring VGA to Component Video

Comments

Popular posts from this blog

Exploiting Python Code Injection in Web Applications

Exploiting Server Side Request Forgery on a Node/Express Application (hosted on Amazon EC2)

Pentest Home Lab - 0x3 - Kerberoasting: Creating SPNs so you can roast them