Software
Installation
Media
We'll need three pieces of installation media:
- The Fedora Core 3 installation set.
- The LokiProject software on CD.
- And a floppy disk with the Fedora Core 3 kickstart file.
Fedora Core 3
Of course, we'll be using Fedora Core 3 as our OS. It can be downloaded in either CD or DVD form factors, either directly from the Fedora Core Project, or via bittorrent. I'd recommend the DVD image via bittorrent route.
Bittorrent is an open protocol, implemented by a variety of clients, that provides fast downloads of large files. I like the
Azureus bittorrent client for Windows. The Fedora Core 3 DVD torrent can be found
here, which was found at
http://torrent.dulug.duke.edu/. Or you can download the CDs from the
Fedora Core Project. You'll need:
- FC3-i386-disc1.iso
- FC3-i386-disc2.iso
- FC3-i386-disc3.iso
- FC3-i386-disc4.iso
LokiProject
I can't afford the bandwidth to host the LokiProject installation set on my site, so I've built a bittorrent link that can be found here:
lpsa.01.iso.torrent.
After downloading the image or images, burn them to a CD or DVD, respectively. I like
Nero for all my optical media burning chores.
Floppy disk
Now that you have all the installation media on CD or DVD, insert the LokiProject CD and floppy into your workstation (the Linux or Windows machine your viewing this document on,) and copy the file:
platform/ks.cfg
...from the CD to the root of the floppy disk.
Fedora Core 3 Installation
Insert the Fedora Core 3 distribution disk into the optical drive and boot. At the first Linux installation prompt, insert the floppy disk you created above and enter:
linux ks=floppy
...provided you have the correct hardware, that should install completely and automatically, without incident. Remove the CD and floppy, and reboot as requested.
LokiProject Installation
After the system reboots, log in as:
username: root
password: changeme
Click the 'Red Hat' icon found in the lower left corner of the screen, then 'Run Command.' Enter:
xterm
...and you'll see the xterm window appear. Insert the LokiProject CD you created above into the optical drive. Make sure the CD is mounted by typing:
mount /media/cdrom
Note: Your system's CD drive could be listed as /media/cdrecorder. If that's the case use /media/cdrecorder instead of /media/cdrom. This applies anywhere you see /media/cdrom.
Change to the directory:
cd /media/cdrom/scripts
Type the command:
ls
...to make sure you can see the files and directories located there, specifically: one.pl, two.pl, and three.pl. Enter the command:
perl one.pl -c ../config/standalone.xml
This command upgrades the system with a known set of working software updates. At this script's completion, remove the CD and reboot the system. Log in again as root, insert and mount the LokiProject CD, start xterm, and change to the scripts directory, all as above. Now run the command:
perl two.pl -c ../config/standalone.xml
This script configures virtually everything else including:
- The user account
- Samba
- System Files
- Installing all the required drivers
- Configuring LIRC
- MySQL
Reboot and go on to the next section.
NOTE: For this release, log in again as root one last time, run xterm, and type:
passwd mythtv
...then enter:
changeme
...twice. For some reason, the mythtv account's password isn't being set correctly.
MythTV Configuration
Now we'll setup the MythTV system. This time, login as:
username: mythtv
password: changeme
Run xterm by double clicking its icon on the desktop. Type:
mythtvsetup
...then:
1) Select your preferred language.
2) Select "Yes Delete Card Settings"
3) Select "Yes Delete Channel Settings"
Make the following configuration changes to the sections and screens shown in the mythtvsetup application as directed below:
Section: General
Screen: Host-specific backend setup
Directory to hold recordings: /mnt/store/recordings
Directory to hold buffers: /mnt/store/buffer
Section: Capture Cards
Screen: New Capture card
Card type: MPEG-2 Encoder Card (PVR-250, PVR-350)
Default Input: Tuner 0
Section: Video Sources
Screen: New Video Source
Video Source Name: Cable
Enter the UserID and Password you used to subscribe to the DataDirect Service.
Click: Retrieve Lineup
Section: Input Connections
Click: [MPEG /dev/video0] (Tuner 0) -> None
Set the Video Source to: Cable
...escape out of this tool back to the xterm window and run the following command:
mythfilldatabase
...which will fill the database with all the programming information that DataDirect provides.
Finally, run the following command to switch to the root user:
su
...enter:
changeme
...for the password. Insert the LokiProject CD, make sure its mounted, change to the scripts directory as above, then run:
perl three.pl -c ../config/standalone.xml
...this last command sets the backend to run on boot and such things.
Remote Control Configuration
The 6131 configuration directions were derived from:
http://www.vulturesnest.net/mythtvremote.html
Open the OneForAll 6131 remote, add batteries, and perform the following actions:
1) Configure the PVR Button:
- Press the PVR button (to select the PVR device).
- Press and hold the SET button until the LED blinks twice, then release it.
- Enter 992. The LED should blink twice.
- Press the VCR button once.
- Press the PVR button once. The LED will blink twice.
- Press the PVR button. (Again, select the new secondary VCR device).
- Press and hold the SET button until the LED blinks twice, then release it.
- Enter 0081. The LED should blink twice.
2) Configure the undefined buttons on the remote:
- Press the device button you have programmed to VCR code 0081.
- Press and hold the SET button until the LED blinks twice, and release it.
- Press 994
- Tap the SET key. The LED should blink once.
- Enter a three-digit code from the table below.
- Press the corresponding remote control button from the table.
- Repeat for all of the buttons in the table (or, as many as you feel the need to program)
| 147 | Replay (Backwards curved arrow) |
| 178 | Skip (Arrow pointing right with vertical line) |
| 140 | Enter (1) |
| 113 | PIP |
| 145 | SWAP |
| 236 | Move |
| 240 | PVR Menu |
(1) This maps ENTER to act the same as SELECT (so that they send out the same code)
Additional Configuration
Since the software's been released, my QA department (spousal unit) has discovered some issues that need to be resolved.
All of these steps will have to be automated, but for now, here are the instructions.
Sound:
Log in as root as described elsewhere in the documentation.
Click through the following menu items:
Hat->Control Center->Sound & Multimedia->Sound System
Un-check the "Sound System" box.
Don't worry if it crashes...
Time:
Click through the following menu items:
Hat->System Settings->Date & Time
Network Time Protocol tab
Enable Time Protocol
Add: pool.ntp.org
Click OK...
Create the storage partition:
We'll need a partion of the hard drive to store all our TV shows and movies. I've chosen the XFS file system developed by Silicon Graphics because it handles large files efficiently. Luckily, our kernel comes with XFS support built in. We simply need to install some support tools that didn't make in on the first install. Download the following files to your system:
xfsdump-2.2.19-0_10.rhfc3.at.i386.rpm
xfsprogs-2.6.9-0_8.rhfc3.at.i386.rpm
From xterm install the packages using the command:
rpm -i xfsprogs
rpm -i xfsdump
...now we have everything we need to build the file system. Hopefully, you've selected a hard drive that's larger than 8GB, the size of our root partition. If not, stop, buy and install at least a 250GB drive. From the xterm window, logged in as root, enter the command:
fdisk /dev/hda
...now, enter the following keystrokes:
| n | Creates a new partition. |
| p | Creates a primary partition. |
| 3 | Creates partition number 3. 1 & 2 are the root and swap partitions. |
| enter | Accepts the default beginning of the partition. |
| enter | Accepts the default ending of the partition, that is, the remainder of the disk. |
| t | Set the type of a partion. |
| 3 | Select partition 3 |
| 83 | Creates a new partition. |
| w | Writes the partition table and exits. |
...reboot for good luck. When the system comes back up, log in as root again. Now we must place a file system on the partition we just created. Run xterm again and enter the following command:
mkfs.xfs /dev/hda3
Now, it'd be nice if our new volume was available after a reboot. To do this, we need to enter a command into the fstab file. Edit it with the command:
nedit /etc/fstab
...and enter the following line:
/dev/hda3 /mnt/data auto defaults 0 0
Autoload:
Download the file:
myth_load.sh
...and copy it to:
/home/mythtv/.kde/Autostart
...finally, go to the following directory with the command:
cd /home/mythtv/.kde/Autostart
...and run the command:
chmod +x myth-load.sh
...which configures the file to be executable.
Remote Control Fixes:
The original licrc file didn't support FFW & REV in movies. The following instructions fix that...
Download the file:
lircrc
...and over-write the file it at:
/home/mythtv/.mythtv/lircrc
...with this file. Now the FFW (>>

and REW (<<

buttons work by fast forwarding 30 seconds and rewinding 10. Furthermore, the skip button fast forwards 10 minutes and the replay button rewinds one minute.
mythfilldatabase Configuration:
The auto execution of mythfilldatabase within the GUI worked with Myth 0.17 but it doesn't now...
To fix this, download the following file:
crontab.txt
Log in as mythtv and run the xterm application. Execute the following command:
export EDITOR=nedit
...which sets your default text editor. nedit is part of the lokiproject distribution. Then run the command:
crontab -e
...and copy/paste the contents of crontab.txt into the nedit window. Save, exit and you're good to go. This configuration will update your TV programming database sometime after 11:00am. Why that time? I've been told that everyone updates their database sometime in the middle of the night. This should remove some of the load on the programming servers.
Posted by
brian on 10/24 at 01:52 AM
(1)
Comments •
Permalink
Logical Volume Manager
After releasing the software, my primary goal was getting the code in production at my home. Before I could do this, I had to get 600 gigs moved off my old hand built system so I could format the drives and start over. We'll, that took some work and you can read about it here:
This is not, technically, part of the LokiProject, but I thought people would like to hear about what I did to build an array for all my data...
A while ago I proved a theory that it was possible to simultaneously record and read NTSC video streams from a remote server over a 100MB network. Now the project's underway, I had an excuse to engineer that theory into a working solution.
Typically I run a very modest P3 500 with an enterprise Linux installation that supports a source control package I use. Its "enterprise" status gives me some comfort in it's stability and use as a software LVM platform. So I went down to Fry's and picked up a couple 400GB drives at ~$200 each and lashed them together into an 800GB Volume. This has worked very well with the exception that I only got about 720GB of storage out of it. More on that later.
I've never done this before so I took it slow, growing the volume and running frequent consistency checks. I started out by creating the LVM volume on a single drive. That's when I first noticed the loss of ~40GB, so I tried again by creating two 200GB partitions. That didn't help at all. So with a 400GB volume created I added the second drive and extended the volume to it. The process went uneventfully with the exception of these error reported by fsck.ext2 after the resize2fs command. Regretfully I didn't note the errors, but they occurred every time I expanded the volume and the errors seemed to indicate all the blocks were reporting incorrect free space size. It appears to work well after the errors were corrected though.
So the process I went through is this:
Install the two new 400GB drives, along side the existing 250GB drive with the OS on it.
Partition the first drive in half with fdisk, setting the partition types to 8e, the Linux LVM type.
Run pvcreate against each partition with the command:
pvcreate /dev/hdc1
pvcreate /dev/hdc2
...this adds some administrative data to each partition to support the LVM. Maybe that's were my 10% disk space loss went...
Create the Volume Group with the command:
vgcreate vg /dev/hdc1 /dev/dhc2
...this collects all the partitions into a single Volume Group with the name of 'vg'.
Now, we create the Logical Volume that'll appear as a single partition to our system. This was a bit tougher. I first ran:
vgdisplay vg
...to see how many PEs were available (see links below for an explanation of PEs) on the Volume Group. With that number, I ran the command:
lvcreate -l <FREE_PE_COUNT> vg /dev/vg/data
...which created the Logical Volume of the maximum size.
Now we'll put the file system on the volume. I did that with the command:
mkfs.ext3 -j /dev/vg/data
Finally we mount it to the file system. First create the mount point with the command:
mkdir /mnt/data
...then add the following line to the end of the /etc/fstab file:
/dev/vg/data /mnt/data ext3 defaults 0 0
...and mount it with the command:
mount /mnt/data
You should now be able to use the file system as usual. It's here that I copied about 300GBs of stuff to it from other machines. That took much of the night.
Now I wanted to extend the volume. I created a single, 400GB partition on the second drive with fdisk and assigned it's type to 8e as above, then created the Physical Volume with the command:
pvcreate /dev/hdd1
Then extend the Volume Group with:
vgextend vg /dev/hdd1
Then get the number of new extents with the command:
p>
vgdisplay vg
...and extend the Logical Volume with the command:
lvextend -l <FREE_PE_COUNT> /dev/vg/data /dev/hdd4
Now comes the stressful part. Expanding the file system. First dismount the file system with the command:
umount /dev/data
For good luck, verify the volume's in good shape with the command:
fsck.ext3 -f /dev/vg/data
I guess you can do this with ext3's journal enabled so you have to turn it off with the command:
tune2fs /dev/vg/data -O ^has_journal
Now extend the file system with the command:
resize2fs /dev/vg/data
...that'll take a while... Now that the file system's been extended, check it again with the command:
fsck.ext2 -f /dev/vg/data
...this is where I had all the free space errors, just fix them and carry on. Add the journal back to the file system with the command:
tune2fs -j /dev/vg/data
Mount the file system again with:
mount /mnt/data
Now I have another 360GB of space that I tested with a series of reads and writes. It all looked good. After copying the rest of my data to the volume I had a measly hundred gigs left. So I ran through the same extension process above with the spare 200GB partition on the first drive containing the operating system.
So it's been a week since I set this up and we've been reading and writing a lot of data without incident. I have one more 400GB drive that I'm tempted to add, but I think I really should invest in a proper RAID5 system to protect my data 
References
Learning Linux LVM, Part 1 on IBM's developerWorks
LVM HowTo
Posted by
brian on 10/24 at 01:50 AM
(3)
Comments •
Permalink