Difference between revisions of "User:Mgpalmer"

From MythTV Official Wiki
Jump to: navigation, search
m (added user to User_Systems group)
m
 
(44 intermediate revisions by 2 users not shown)
Line 1: Line 1:
I see someone else here is already using my name, heh. ([[User:MikePalmer]])
+
My current mythtv system has a combined backend/frontend and a 2nd frontend both based on Fedora 17 and the repository version of mythtv (0.26 fixes).
  
I'm in Atlanta (Sandy Springs), GA, USA, and recently built my third MythTV box.
+
My previous mythtv system has a combined backend/frontend and a 2nd frontend both based on MythDora 12.23: [http://mythdora.com/ MythDora].
  
I originally started out with the KnoppMyth r5c7 distribution, and could not get a functional system before I discovered MythDora, which installed and worked on my hardware with trivial effort on my part. Not that I mind investing more than trivial effort... but the easier option was discovered before I put in the effort necessary to get KnoppMyth up and running. And I am lazy.
+
=My MythTV Systems=
[http://g-ding.tv/ MythDora web site]
+
I've had a working MythTV system since about June 2006. My first working MythTV system was based on MythDora 2.32.
  
 +
I currently have three systems now involved in my mythtv setup.
 +
* Primary system is a combined backend/frontend running MythDora 10.21.
 +
* Remote frontend only built with MythDora 10.21.
  
== Current Config ==
+
==Main Frontend/Backend==
Jan 2007 - MythDora 3.2 running on:
+
As of May 2007 my primary system is a combined backend/frontend running on:
 +
* Biostar NVIDIA GeForce 6100-M9
 +
* AMD64 x2 4200
 +
* 2 GB PC3200 DDR (4x 512MB modules in dual channel mode)
 +
I've reduced the storage to a single drive:
 +
* 500 GB Seagate SATA/300 HD - I'm running LVM and xfs on my /storage partition preallocating 512 MB for files with good success so far.
 +
For capturing content I have two tuners:
 +
* Hauppauge PVR500 dual analog tuner card
 +
* AverMedia A180 dvb - viewing ATSC on DirecPath (DirecTV reseller for multi dwelling units)
 +
The A180 currently sits idle. The PVR500 works out great since I have quite limited space for PCI cards.
 +
 
 +
==Remote Front End==
 +
An earlier mythtv system is now recycled for frontend only duty, allowing me to move the main unit out of the living room. It is configured with MythDora 10.21.
  
 +
The hardware includes
 
* Biostar NVIDIA GeForce 6100-M9
 
* Biostar NVIDIA GeForce 6100-M9
* AMD 64 3500
+
* AMD64 single core
 
* 1 GB PC3200 DDR (2x 512MB modules in dual channel mode)
 
* 1 GB PC3200 DDR (2x 512MB modules in dual channel mode)
* 2 x 500 GB Seagate SATA/300 HD
+
* nVidia 6200, DVI-HDMI cable
* Hauppauge PVR500 dual analog tuner card
+
 
* AverMedia A-180 dvb - viewing clear QAM-256 on Comcast cable basic
+
The user interface includes:
 
* MCE USB remote (bundled with PVR500)
 
* MCE USB remote (bundled with PVR500)
 
+
* Logitech Cordless Desktop EX110 (mouse & keyboard)
 
+
* ViewSonic N3751w 37" LCD display (HDMI inputs now dead after storm)
* [[ViewSonic N3751w]] 37" LCD display
 
 
* Yamaha HTR-5835 DTS 5.1
 
* Yamaha HTR-5835 DTS 5.1
  
== xorg.conf ==
+
==Digital Content - Channels==
Some sections from my xorg.conf:
+
DirecPath have discontinued putting these signals on the cable ~ Feb 2009.
 
+
Currently have an OTA capable tuner, but poor signal reception; I seem to be in a fringe area, and antenna options are quite limited in my apartment.
<pre>
 
Section "Monitor"
 
Identifier  "Monitor0"
 
VendorName  "ViewSonic"
 
ModelName    "N3751w 1360x768"
 
### Comment all HorizSync and VertSync values to use DDC:
 
# HorizSync    30 - 80
 
# VertRefresh  50.0 - 75.0
 
# DisplaySize  827 468
 
Option     "dpms"
 
EndSection
 
 
 
Section "Device"
 
Identifier  "Videocard0"
 
Driver      "nvidia"
 
VendorName  "EQS"
 
BoardName  "GF6200LE-128MTV-P"
 
EndSection
 
 
 
Section "Screen"
 
Identifier "Screen0"
 
Device    "Videocard0"
 
Monitor    "Monitor0"
 
DefaultDepth    24
 
# SubSection "Display"
 
# Viewport  0 0
 
# Depth    16
 
# Modes    "1360x768" "800x600" "640x480"
 
# EndSubSection
 
# SubSection "Display"
 
# Viewport  0 0
 
# Depth    24
 
# Modes    "1360x768"
 
# EndSubSection
 
EndSection
 
</pre>
 
 
 
== lircrc ==
 
My Hauppauge PVR-500 came with an OEM version of the MS USB remote. This is the current lircrc file I am using (modified from the delivered lircrc.mceusb2).
 
 
 
<pre>
 
# lircrc.mceusb
 
 
 
###################
 
#
 
#  MythTV
 
#
 
###################
 
 
 
# ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----
 
# mgp
 
#
 
# A full lircrc stanza includes:
 
# begin
 
#    prog  = ...
 
#    remote = ...
 
#    button = ...
 
#    repeat = ...
 
#    delay  = ...
 
#    config = ...
 
#    mode  = ...
 
#    flags  = ...
 
# end
 
 
 
# mpg mythPVR controls
 
# requires some additions to jumppoints (in mythweb)
 
# jumppoints managed with bu.sh/mysqldump script
 
 
 
begin
 
#power button script from http://wilsonet.com/mythtv/tips.php (modified)
 
    prog = irexec
 
    button = Power
 
    config = /usr/local/bin/mythpowerbutton.sh
 
end
 
 
 
#begin
 
# remote: Guide, KeyBinding: TVPlayback->GUIDE = S
 
#    prog = mythtv
 
#    button = TV
 
#    config = S
 
#end
 
 
 
begin
 
# remote: Green Flag, KeyBinding: TOGGLEASPECT = W (default)
 
    prog = mythtv
 
    button = Home
 
    config = W
 
end
 
 
 
begin
 
# remote: Recorded TV, JumpPoint: TV Recording Playback = $
 
    prog = mythtv
 
    button = RecTV
 
    config = $
 
end
 
 
 
begin
 
# remote: My TV, JumpPoint: Main Menu = @
 
    prog = mythtv
 
    button = TV
 
    config = @
 
end
 
 
 
begin
 
# remote: Live TV, JumpPoint: Live TV = ~
 
    prog = mythtv
 
    button = LiveTV
 
    config = ~
 
end
 
 
 
begin
 
# remote: My Pictures, JumpPoint: Myth Gallery = !
 
    prog = mythtv
 
    button = Pictures
 
    config = !
 
end
 
 
 
begin
 
# remote: My Music, JumpPoint: Play music = ` (back tick)
 
    prog = mythtv
 
    button = Music
 
    config = `
 
end
 
 
 
begin
 
# remote: My Videos, JumpPoint: Video Manager = #
 
    prog = mythtv
 
    button = Videos
 
    config = #
 
end
 
 
 
begin
 
# remote: Ch/Pg +, Keybinding: STRETCHINC = %
 
    prog = mythtv
 
    button = ChanUp
 
    repeat = 3
 
    config = %
 
end
 
 
 
begin
 
# remote: Ch/Pg -, Keybinding: STRETCHDEC = ^
 
    prog = mythtv
 
    button = ChanDown
 
    repeat = 3
 
    config = ^
 
end
 
 
 
# end mgp additions
 
# ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----
 
 
 
begin
 
    prog = mythtv
 
    button = One
 
    config = 1 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Two
 
    config = 2 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Three
 
    config = 3 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Four
 
    config = 4 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Five
 
    config = 5 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Six
 
    config = 6 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Seven
 
    config = 7 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Eight
 
    config = 8 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Nine
 
    config = 9 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Zero
 
    config = 0 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Back
 
    config = Esc
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Guide
 
    config = M 
 
end
 
 
 
begin
 
  prog = mythtv
 
  button = More
 
  config = I 
 
end
 
 
 
begin
 
  prog = mythtv
 
  button = VolDown
 
  repeat = 3
 
  config = F10 
 
end
 
 
 
begin
 
  prog = mythtv
 
  button = VolUp
 
  repeat = 3
 
  config = F11 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Up
 
    repeat = 3
 
    config = Up
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Down
 
    repeat = 3
 
    config = Down
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Left
 
    config = Left
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Right
 
    config = Right
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Play
 
    config = Return
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = OK
 
    config = Return
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Mute
 
    config = | 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Rewind
 
    config = Left 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Forward
 
    config = Right 
 
end
 
 
 
begin
 
  prog = mythtv
 
  button = Record
 
  config = R 
 
end
 
 
 
begin
 
  prog = mythtv
 
  button = Stop
 
  config = O 
 
end
 
 
 
begin
 
    prog = mythtv
 
    button = Pause
 
    config = P 
 
end
 
 
 
# Use for backwards commercial skip
 
begin
 
  prog = mythtv
 
  button = Replay
 
  config = Q 
 
end
 
 
 
# Use for forward commercial skip
 
begin
 
  prog = mythtv
 
  button = Skip
 
  config = Z 
 
end
 
 
 
  
###################
+
Previously I could receive the following digital (ATSC) channels directly from the cable connection:
#
 
#  MPlayer
 
#
 
###################
 
begin
 
  prog = mplayer
 
  button = Stop
 
  config = quit
 
end
 
  
begin
+
* 2-1 WSB-DT
  prog = mplayer
+
* 2-2 WSB-DT 2
  button = Play
+
* 5-1 WAGA-HD Fox
  config = seek +1
+
* 11-1 WXIA-DT
end
+
* 46-1 WGCL-HD
 
 
begin
 
  prog = mplayer
 
  button = More
 
  config = osd
 
end
 
     
 
begin
 
  prog = mplayer
 
  button = Replay
 
  config = seek -10
 
  repeat = 1
 
end
 
   
 
begin
 
  prog = mplayer
 
  button = Skip
 
  config = seek +10
 
  repeat = 1
 
end
 
  
begin
+
=To Do=
  prog = mplayer
+
Things I'd like to do next:
  button = Rewind
+
* Improve digital OTA reception
  config = seek -30
+
* Net boot my frontends
  repeat = 1
 
end
 
  
begin
+
=Moving my mythconverg to a remote MySQL server=
  prog = mplayer
+
Just for grins and skills I decided to set up a remote Linux server on which to run MySQL. Here are the things I did to get this working. This is Fedora centric, as MythDora is built on Fedora.
  button = Forward
 
  config = seek +30
 
  repeat = 1
 
end
 
  
begin
+
One advantage to having the database on a remote system is that it now running on a different disk spindle, so disk thrashing is reduced. Another advantage is there is less chance of hosing my database during system updates/upgrades.
    prog = mplayer
 
    button = Pause
 
    config = pause
 
end
 
   
 
begin
 
  prog = mplayer
 
  button = VolUp
 
  config = volume +1
 
  repeat = 1
 
end
 
  
begin
+
==Setup MySQL==
  prog = mplayer
+
First, set up the database server machine. Install MySQL. It looks like mythtv-0.21 will be dropping MySQL v3 and v4 support. Ensure you use v5 of MySQL.
  button = VolDown
 
  config = volume -1
 
  repeat = 1
 
end
 
  
begin
+
After installing, set mysqld to run at boot time, and turn it on now:
  prog = mplayer
+
# chkconfig mysqld on
  button = Mute
+
# service mysqld start
  config = mute
 
end
 
  
###################
+
Then change the root password for MySQL:
#
+
# mysql -u root mysql
# Xine
+
  mysql> update user set Password=PASSWORD('ROOT_PWD') where user='root';
#
+
mysql> flush privileges;
###################
+
mysql> quit
# Xine lirc setup
 
begin
 
prog = xine
 
button = Play
 
repeat = 3
 
config = Play
 
end
 
  
begin
+
Get a copy of mc.sql from your mythtv machine. I found mine at
prog = xine
+
/usr/share/doc/mythtv-docs-0.20.2/database/mc.sql
button = Stop
+
Then put it in the database with
repeat = 3
+
$ mysql -u root -p < /your/path/to/mc.sql
config = Stop
+
(This will prompt you for the mysql-root password.)
end
 
  
begin
+
Add a mythtv user to your mysql install. http://dev.mysql.com/doc/refman/5.0/en/adding-users.html
prog = xine
 
button = Back
 
repeat = 3
 
config = Quit
 
end
 
  
begin
+
Move any other config stuff you might have. I'm using Jarod's recommended my.cnf additions. From his site:
prog = xine
 
button = Pause
 
repeat = 3
 
config = Pause
 
end
 
  
begin
+
Under the [mysqld] section add:
prog = xine
+
key_buffer = 16M
button = Up
+
table_cache = 128
repeat = 3
+
sort_buffer_size = 2M
config = EventUp
+
myisam_sort_buffer_size = 8M
end
+
query_cache_size = 16M
  
begin
+
Additionally, I added a mythtv user to my Linux server system and edited the uid/gid values to be the same as on the MythDora system (1000/1000). This makes for more readable file owner/groups on both systems, especially as the same server holds my NFS partitions.
prog = xine
 
button = Down
 
repeat = 3
 
config = EventDown
 
end
 
  
begin
+
==Prepare a database dump==
prog = xine
+
The following occurs on the mythtv backend system that is currently running the database. At this point I shut down my mythtv system so that the database would not be changed during the following steps. I also ran the database optimizer.
button = Left
+
# killall mythfrontend
repeat = 3
+
# service mythbackend stop
config = EventLeft
+
# /usr/local/bin/optimize_mythdb.pl
end
+
I then dumped the database and turned off the mysqld server on this system.
 +
$ mysqldump -u myth_user -p --extended-insert --databases mythconverg > mythdb.sql
 +
# service mysqld stop
 +
# chkconfig mysqld off
  
begin
+
==Load mythconverg on new server==
prog = xine
+
After transfering this backup file to the new MySQL server machine, I was ready to import it to the new MySQL server.
button = Right
+
$ mysql -u root -p mythconverg < mythdb.sql
repeat = 3
+
(this will prompt for the mysql root user's password)
config = EventRight
+
And allow mythtv to have remote access to this database with
end
+
$ mysql -u root -p mythconverg
 +
(prompts for password)
 +
mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
 +
mysql> flush privileges;
 +
mysql> quit;
  
begin
+
==Configure mythbackend to use remote database==
prog = xine
+
We're finally ready to bring it all together. Back on the mythtv backend system you need to configure access for the remote MySQL database server and restart mythbackend.
button = OK
 
repeat = 3
 
config = EventSelect
 
end
 
  
begin
+
Access to the MySQL server on my MythDora system was configured in the mysql.txt file, found on my system in several places: /.mythtv/mysql.txt, /root/.mythtv/mysql.txt, and ~mythtv/.mythtv/mysql.txt. The change to make is
prog = xine
+
DBHostName=<mysql_server_name_or_IP>
button = Home
+
I made this change to all 3 copies of mysql.txt found on my system.
repeat = 3
 
config = Menu
 
end
 
  
begin
+
Now I restarted the backend and frontend and verified all was well.
prog = xine
+
# service mythbackend start
button = Forward
+
$ mythfrontend
repeat = 3
+
(watch some recordings, etc.)
config = SpeedFaster
 
end
 
  
begin
+
=Convert filing system from ext3 to xfs=
prog = xine
+
MythDora automatically creates an LVM partition for the major storage of mythtv mounted as /storage, and formats it as ext3. xfs is a better performing filing system for large files. Here's how I converted my /storage to xfs.
button = Rewind
 
repeat = 3
 
config = SpeedSlower
 
end
 
  
begin
+
{{Note box| msg=Must be root for the following}}
prog = xine
 
button = VolUp
 
repeat = 3
 
config = Volume+
 
end
 
  
begin
+
Converting MythDora /storage to xfs:
prog = xine
+
* be root
button = VolDown
+
* make sure to have xfs-tools installed (if needed: # yum install xfsprogs)
repeat = 3
+
* shut down access to /storage (myth[front|back]end, maybe mysql, etc., or init 1)
config = Volume-
+
* unmount any NFS mounts
end
+
* cp -a /storage (to a safe place on another volume)
 +
* mkfs.xfs /storage
 +
* cp -a (saved /storage to) /storage
 +
* edit /etc/fstab to account for the new fs type
 +
* restart stuff (myth[front|back]end, etc., or init 5)
  
begin
+
I used a feature of xfs to preallocate disk space in 512 MB increments. This reduces the total number of extents that a file will consume, especially with multiple files growing (more than 1 program recording simultaneously). This was accomplished with this line in my fstab:
prog = xine
+
/dev/sdb1    /storage    xfs    defaults, allocsize=512m 0 0
button = Mute
+
Files created after this change will contain far fewer extents than previously. Verify with
repeat = 3
+
$ cd /storage/recordings
config = Mute
+
$ filefrag <file_name>
end
 
  
begin
+
=Add Another Disk to /storage LVM=
prog = xine
+
At install time MythDora creates recording space for MythTV in a separate partition configured as LVM and mounted on ''/storage''. Once disk space started filling up and I began losing shows before they were watched, I found this to be quite useful. Here's how I added a new disk to my system's ''/storage''. I've done this both for an ext3 formatted ''/storage'' (default configuration) and an xfs formatted ''/storage''.
button = ChanUp
 
repeat = 3
 
config = EventNext
 
end
 
  
begin
+
I first made sure to watch up as much TV as possible and delete everything I could to minimize the time required to backup and restore data. These instructions assume you've already installed the disk into the computer chassis and performed any data backup you will be doing.
prog = xine
+
{{Warning box|If your mythtv data (or pictures, music, etc.) in ''/storage'' is important to you, then make sure to perform a backup beforehand.}}
button = ChanDown
+
You may need to unmount ''/storage''. This will require stopping mythfrontend and mythbackend, as well as any other processes that might be using this partition.
repeat = 3
+
# killall mythfrontend
config = EventPrior
+
# /sbin/service mythbackend stop
end
+
# umount /storage
 +
If you have trouble with this, then try single user mode:
 +
# init 1
 +
Get volume group name with mount and lvdisplay, which look something like this:
 +
# mount
 +
...
 +
/dev/mapper/VolGroup00-LogVol01 on /storage type xfs (rw,allocsize=512m)
 +
...
 +
# lvdisplay /dev/VolGroup00/LogVol01
 +
  --- Logical volume ---
 +
  LV Name                /dev/VolGroup00/LogVol01
 +
  VG Name                VolGroup00
 +
  LV UUID                rEftR4-7mDC-6Vng-IyHO-a1eM-w15F-FlN1bA
 +
  LV Write Access        read/write
 +
  LV Status              available
 +
  # open                1
 +
  LV Size                453.72 GB
 +
  Current LE            14519
 +
  Segments              1
 +
  Allocation            inherit
 +
  Read ahead sectors    0
 +
  Block device          253:1
 +
On MythDora 3.2 I found the volume group name to be ''videovg'' instead.
  
begin
+
Use ''pvcreate'' to initialize the device for use with LVM. You will need your device name; on my system it was ''/dev/sdb''.
prog = xine
+
# pvcreate /dev/sdb
button = More
+
Use ''vgextend'' to add this device to the volume group.
repeat = 3
+
# vgextend VolGroup00 /dev/sdb
config = OSDStreamInfos
+
Then use lvextend to make the new space available. You'll need to know how much space you have to add.
end
+
# pvs /dev/sdb
</pre>
+
# lvextend -L +465.75G /dev/VolGroup00/LogVol01
 +
Now for formatting. With xfs formatting you only need:
 +
# xfs_growfs /storage
 +
While for ext2/3 you'll need a more involved procedure.
 +
single user mode: init 1 (since otherwise the volume group is busy)
 +
unmount the volume group: umount /dev/videovg/videolv01
 +
force checking disc: e2fsck -f /dev/videovg/videolv01
 +
resize the volume group: resize2fs /dev/videovg/videolv01
 +
remount: mount /dev/videovg/videolv01
 +
check: df -h
 +
return to multiuser mode: init 5
 +
OR reboot: init 6
  
 
[[Category:User_Systems]]
 
[[Category:User_Systems]]
 +
[[Category:MythPeople]]

Latest revision as of 13:40, 27 March 2013

My current mythtv system has a combined backend/frontend and a 2nd frontend both based on Fedora 17 and the repository version of mythtv (0.26 fixes).

My previous mythtv system has a combined backend/frontend and a 2nd frontend both based on MythDora 12.23: MythDora.

My MythTV Systems

I've had a working MythTV system since about June 2006. My first working MythTV system was based on MythDora 2.32.

I currently have three systems now involved in my mythtv setup.

  • Primary system is a combined backend/frontend running MythDora 10.21.
  • Remote frontend only built with MythDora 10.21.

Main Frontend/Backend

As of May 2007 my primary system is a combined backend/frontend running on:

  • Biostar NVIDIA GeForce 6100-M9
  • AMD64 x2 4200
  • 2 GB PC3200 DDR (4x 512MB modules in dual channel mode)

I've reduced the storage to a single drive:

  • 500 GB Seagate SATA/300 HD - I'm running LVM and xfs on my /storage partition preallocating 512 MB for files with good success so far.

For capturing content I have two tuners:

  • Hauppauge PVR500 dual analog tuner card
  • AverMedia A180 dvb - viewing ATSC on DirecPath (DirecTV reseller for multi dwelling units)

The A180 currently sits idle. The PVR500 works out great since I have quite limited space for PCI cards.

Remote Front End

An earlier mythtv system is now recycled for frontend only duty, allowing me to move the main unit out of the living room. It is configured with MythDora 10.21.

The hardware includes

  • Biostar NVIDIA GeForce 6100-M9
  • AMD64 single core
  • 1 GB PC3200 DDR (2x 512MB modules in dual channel mode)
  • nVidia 6200, DVI-HDMI cable

The user interface includes:

  • MCE USB remote (bundled with PVR500)
  • Logitech Cordless Desktop EX110 (mouse & keyboard)
  • ViewSonic N3751w 37" LCD display (HDMI inputs now dead after storm)
  • Yamaha HTR-5835 DTS 5.1

Digital Content - Channels

DirecPath have discontinued putting these signals on the cable ~ Feb 2009. Currently have an OTA capable tuner, but poor signal reception; I seem to be in a fringe area, and antenna options are quite limited in my apartment.

Previously I could receive the following digital (ATSC) channels directly from the cable connection:

  • 2-1 WSB-DT
  • 2-2 WSB-DT 2
  • 5-1 WAGA-HD Fox
  • 11-1 WXIA-DT
  • 46-1 WGCL-HD

To Do

Things I'd like to do next:

  • Improve digital OTA reception
  • Net boot my frontends

Moving my mythconverg to a remote MySQL server

Just for grins and skills I decided to set up a remote Linux server on which to run MySQL. Here are the things I did to get this working. This is Fedora centric, as MythDora is built on Fedora.

One advantage to having the database on a remote system is that it now running on a different disk spindle, so disk thrashing is reduced. Another advantage is there is less chance of hosing my database during system updates/upgrades.

Setup MySQL

First, set up the database server machine. Install MySQL. It looks like mythtv-0.21 will be dropping MySQL v3 and v4 support. Ensure you use v5 of MySQL.

After installing, set mysqld to run at boot time, and turn it on now:

# chkconfig mysqld on
# service mysqld start

Then change the root password for MySQL:

# mysql -u root mysql
mysql> update user set Password=PASSWORD('ROOT_PWD') where user='root';
mysql> flush privileges;
mysql> quit

Get a copy of mc.sql from your mythtv machine. I found mine at

/usr/share/doc/mythtv-docs-0.20.2/database/mc.sql

Then put it in the database with

$ mysql -u root -p < /your/path/to/mc.sql

(This will prompt you for the mysql-root password.)

Add a mythtv user to your mysql install. http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

Move any other config stuff you might have. I'm using Jarod's recommended my.cnf additions. From his site:

Under the [mysqld] section add:

key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M

Additionally, I added a mythtv user to my Linux server system and edited the uid/gid values to be the same as on the MythDora system (1000/1000). This makes for more readable file owner/groups on both systems, especially as the same server holds my NFS partitions.

Prepare a database dump

The following occurs on the mythtv backend system that is currently running the database. At this point I shut down my mythtv system so that the database would not be changed during the following steps. I also ran the database optimizer.

# killall mythfrontend
# service mythbackend stop
# /usr/local/bin/optimize_mythdb.pl

I then dumped the database and turned off the mysqld server on this system.

$ mysqldump -u myth_user -p --extended-insert --databases mythconverg > mythdb.sql
# service mysqld stop
# chkconfig mysqld off

Load mythconverg on new server

After transfering this backup file to the new MySQL server machine, I was ready to import it to the new MySQL server.

$ mysql -u root -p mythconverg < mythdb.sql
(this will prompt for the mysql root user's password)

And allow mythtv to have remote access to this database with

$ mysql -u root -p mythconverg
(prompts for password)
mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
mysql> flush privileges;
mysql> quit;

Configure mythbackend to use remote database

We're finally ready to bring it all together. Back on the mythtv backend system you need to configure access for the remote MySQL database server and restart mythbackend.

Access to the MySQL server on my MythDora system was configured in the mysql.txt file, found on my system in several places: /.mythtv/mysql.txt, /root/.mythtv/mysql.txt, and ~mythtv/.mythtv/mysql.txt. The change to make is

DBHostName=<mysql_server_name_or_IP>

I made this change to all 3 copies of mysql.txt found on my system.

Now I restarted the backend and frontend and verified all was well.

# service mythbackend start
$ mythfrontend
(watch some recordings, etc.)

Convert filing system from ext3 to xfs

MythDora automatically creates an LVM partition for the major storage of mythtv mounted as /storage, and formats it as ext3. xfs is a better performing filing system for large files. Here's how I converted my /storage to xfs.


Important.png Note: Must be root for the following

Converting MythDora /storage to xfs:

* be root
* make sure to have xfs-tools installed (if needed: # yum install xfsprogs)
* shut down access to /storage (myth[front|back]end, maybe mysql, etc., or init 1)
* unmount any NFS mounts
* cp -a /storage (to a safe place on another volume)
* mkfs.xfs /storage
* cp -a (saved /storage to) /storage
* edit /etc/fstab to account for the new fs type
* restart stuff (myth[front|back]end, etc., or init 5)

I used a feature of xfs to preallocate disk space in 512 MB increments. This reduces the total number of extents that a file will consume, especially with multiple files growing (more than 1 program recording simultaneously). This was accomplished with this line in my fstab:

/dev/sdb1    /storage    xfs    defaults, allocsize=512m 0 0

Files created after this change will contain far fewer extents than previously. Verify with

$ cd /storage/recordings
$ filefrag <file_name>

Add Another Disk to /storage LVM

At install time MythDora creates recording space for MythTV in a separate partition configured as LVM and mounted on /storage. Once disk space started filling up and I began losing shows before they were watched, I found this to be quite useful. Here's how I added a new disk to my system's /storage. I've done this both for an ext3 formatted /storage (default configuration) and an xfs formatted /storage.

I first made sure to watch up as much TV as possible and delete everything I could to minimize the time required to backup and restore data. These instructions assume you've already installed the disk into the computer chassis and performed any data backup you will be doing.

Warning.png Warning: If your mythtv data (or pictures, music, etc.) in /storage is important to you, then make sure to perform a backup beforehand.

You may need to unmount /storage. This will require stopping mythfrontend and mythbackend, as well as any other processes that might be using this partition.

# killall mythfrontend
# /sbin/service mythbackend stop 
# umount /storage

If you have trouble with this, then try single user mode:

# init 1

Get volume group name with mount and lvdisplay, which look something like this:

# mount
...
/dev/mapper/VolGroup00-LogVol01 on /storage type xfs (rw,allocsize=512m)
...
# lvdisplay /dev/VolGroup00/LogVol01
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                rEftR4-7mDC-6Vng-IyHO-a1eM-w15F-FlN1bA
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                453.72 GB
  Current LE             14519
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:1

On MythDora 3.2 I found the volume group name to be videovg instead.

Use pvcreate to initialize the device for use with LVM. You will need your device name; on my system it was /dev/sdb.

# pvcreate /dev/sdb

Use vgextend to add this device to the volume group.

# vgextend VolGroup00 /dev/sdb

Then use lvextend to make the new space available. You'll need to know how much space you have to add.

# pvs /dev/sdb
# lvextend -L +465.75G /dev/VolGroup00/LogVol01

Now for formatting. With xfs formatting you only need:

# xfs_growfs /storage

While for ext2/3 you'll need a more involved procedure.

single user mode: init 1 (since otherwise the volume group is busy)
unmount the volume group: umount /dev/videovg/videolv01
force checking disc: e2fsck -f /dev/videovg/videolv01
resize the volume group: resize2fs /dev/videovg/videolv01
remount: mount /dev/videovg/videolv01
check: df -h
return to multiuser mode: init 5
OR reboot: init 6