home / blog

Myth box update notes

It’s time for an upgrade of my ageing Intel Dual Core 1.8GHz cellar-based mythtv box, it’s long overdue. Plan – fresh install of 64bit 12.04 and a minimal install to squeeze last drop of CPU/RAM.

First, get a minimal install, 64 bit version. Turns out there isn’t a separate x86_64 distribution but the AMD64 is the one to use, even on Intel chips.

# double-check we have 64bit support
grep --color lm /proc/cpuinfo

# download
wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/mini.iso

# destructive write to an old USB disk
dd if=mini.iso of=/dev/sde bs=1M
eject /dev/sde

Next, backup everything relevant. Almost everything, including /home is on separate data partitions / disks, so only have /etc and /var/www to worry about.

# settings and web area
tar czf /home/adam/backup.tar.gz /etc/ /var/www
# MySQL - mythtv mostly
mysqldump --all-databases -u root -p > /home/adam/db.sql

Next, change BIOS settings and boot of the USB disk. Follow the prompts, format existing installation, and select only one additional package – openssh, so we can continue the process remotely.

Next, reboot, connect remotely. Edit key configuration files with reference to backed-up config.

sudo apt-get install emacs
# add back data partitions
sudo emacs /etc/fstab 
sudo mkdir /data0 /data1 /data2 /data3
sudo ln -s /data0/home /home
# restore static IP
sudo emacs /etc/networking/interfaces

Now some software.

# services
sudo apt-get install --no-install-recommends mythtv xmltv-util mythweb zoneminder pptpd samba
# tools
sudo apt-get install --no-install-recommends git emacs php5-cli
# drivers / hardware
sudo apt-get install --no-install-recommends nvidia-current ethtool etherwake dvb-apps 
# desktop
sudo apt-get install --no-install-recommends ubuntu-desktop chromium-browser flashplugin-installer ubuntu-restricted mplayer mencoder
# show apps in unity
sudo apt-get install --no-install-recommends unity-place-applications

Restore database, this should be simple, but because we included all databases the import will brake the password for the debian-sys-maint user, and subsequent installs will fail with “Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)”.

# restore database
mysql -u root -p < /data0/home/adam/db.sql
# find the password
sudo grep password /etc/mysql/debian.cnf
mysql -u root -p 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'enter the password here'
sudo /etc/init.d/mythtv-backend restart

Mythtv password: This is stored in 3 different places!

# usually symlinked to ~mythtv/.mythtv/config.xml
sudo emacs /etc/mythtv/config.xml 
# used by backend
sudo emacs /etc/mythtv/mysql.txt
# mythweb
sudo emacs /etc/apache2/sites-available/mythweb.conf

Restore pptpd setup with reference to backed up config.

sudo emacs /etc/ppp/chap-secrets
sudo emacs /etc/ppp/pptpd-options
sudo emacs /etc/pptpd.conf
sudo emacs /etc/sysctl.conf
/etc/init.d/pptpd restart

Fullscreen fix. Run compliz settings manager (or cssm at CLI), then workarounds, then enable legacy fullscreen support.

sudo apt-get install compizconfig-settings-manager

Restore UIDs on home areas.

sudo chown -R adam:adam ~adam/
sudo chown -R mythtv:mythtv ~mythtv/ /data?/film/store
This entry was posted in geek. Bookmark the permalink.

Leave a Reply

Your email address will not be published.