Tuesday, August 21, 2012

Upgrading MythTV to Mythbuntu 12.04 64-bit

As described in the previous post, the time had come to upgrade my MythTV installation. It had been installed using Mythbuntu 10.10, 32-bit. I wanted to move to the most recent version, currently Mythbuntu 12.04. There were two options available to me: upgrading the current installation, or a new install of the latest version, and copying the previous MythTV database over to it. The first option was not too appealing. Doing a distribution upgrade is a fingers-crossed, hope-this-works process a good part of the time - although I have had pretty good fortune with it on my desktop PC. If I were to go this route, I couldn't just upgrade from 10.10 -> 12.04. It would have to be 10.10 -> 11.04 -> 11.10 -> 12.04. Three complete system upgrades in succession, which would likely leave a lot of cruft left over in the installation. Lots of points of failure. The final nail in the coffin was that I wanted to move to a 64-bit installation, to take advantage of the full 4GB of memory that was installed in the system.

So a clean install it was. To prepare, I copied a number of setup files to a safe place that wouldn't be overwritten during the install. Files like:


  • mdadm.conf, from /etc/mdadm, which had the RAID configuration information. 
  • xorg.conf, from /etc/X11, which had the custom modeline used to output to my (now ancient) CRT TV. 
  • ssmtp.conf, from /etc/ssmtp, for email notification in the case of errors.
  • apcupsd.conf, from /etc/apcupsd, the setup of the APC UPS monitoring software.
  • hardware.conf, from /etc/lirc, used by LIRC to set up the Media Centre remote control.
  • the MythTV database password, from /etc/mythtv/config.xml


Not all the files would end up being needed, but I felt safer having them handy, just in case.

The installation process started from a USB stick loaded with the Mythbuntu 12.04 installer, since I don't have an optical drive in it. No room, with three drives already there. I also hooked up a monitor instead of a TV, because that needs extra setup to output to a component connection.

Since there was some left over free space on the SSD, I installed to that, leaving the 10.10 install intact for now. It went remarkably smoothly. One thing I noted was that at the beginning, there is an option to update the installer. I clicked that, and the system seemed to do nothing for quite a while. Opening up a terminal window and running "top" showed that it was in fact doing something, so I waited until it finished. Once done, the installation process could begin. It would have been nice for it to have some sort of indication that it was doing something, though.

Partway through the process, it prompted for what sort of remote control is being used. I selected "Windows Media Center remote", and the thing was set up automatically. Brilliant! Didn't need that LIRC setup file listed above.

To get the system outputting to my TV properly, I just copied the old xorg.conf file to the /etc/X11 directory (I renamed the existing file, in case I needed it again) and rebooted with a sense of hope and anxiety. A minute or so later, the screen came to life! It worked!

The big one, that I was dreading, was getting the RAID array to be seen by the new install. I still consider myself quite the mdadm novice, so I was pleasantly surprised to find that the RAID array was picked up by the new install quite easily - after installing mdadm and lvm2. This command:

sudo mdadm --assemble --scan

was all that was needed for it to scan for any drives, re-assemble the array, and write a new mdadm.conf file. Easy!

Next was seeing if LVM could find the volumes created. Running

sudo lvm pvscan
sudo lvm vgscan
sudo lvm lvscan

detected all the physical volumes, volume groups, and logical volumes, respectively. Mounting the logical volume that held the recordings was successful - I could see them all. Adding the device entry to /etc/fstab seemed to work, eventually. On the first reboot it came up with an error message, mentioning there were serious problems with the mount. Not sure what it was, but a reboot afterwards seemed to make it happy. I had installed xfsprogs, to manage and defragment XFS filesystems; maybe that helped.

Going through some of the MythTV screens brought up some error messages that it couldn't write to the drive - it turned out to be a permissions issue for the files and directories on the array. Entering

sudo chown -R mythtv:mythtv /var/lib/mythtv

changed the ownership back to the mythtv user, and it seemed happy again.

Bringing the previous database over was a painless process as well. I followed the instructions here and here and the new database came over without drama.

So far it all looks good. I may have a tweak of the VDPAU settings to see if playback can be improved any - it looks fine, but the settings have just been carried over from the previous 0.23 version. Things may have changed in the current 0.25 release.

Now that the system is updated to 12.04, which is a Long Term Support (LTS) release of Ubuntu, I won't be caught out with an obsolete version after 18 months like I was with 10.10.

As a side note, one of the main reasons for moving to 64-bit was because the Zotac IONITX-A-U motherboard, with an Atom 330, was only showing 3GB of RAM installed, even though I had two, 2GB sticks in there. I thought this was a 32 bit software issue. After installing the 64-bit OS, the free memory remained the same. Even in the BIOS, it only reported 3072MB. Strange. A bit of searching around revealed this thread on Zotac's supprt forums. As it turns out, if 4GB is installed, 512MB is reserved for system use, and then there is the amount used by the onboard Nvidia ION graphics - which I had set to the maximum allowed 512MB. So only 3GB visible. It's OK, it still runs fine, but it would have been nice to be able to use a little extra.

My MythTV system - the story so far

For the past 18 moths or so I've been running a MythTV system in the lounge, which has been an excellent performer. It has liberated us from TV advertisements and from having to be home in time to watch a particular show. It has been slowly enhanced and upgraded over that time to be quite a capable machine, exceeding what could be purchased from a store.

Following on from one of the earlier build posts, one thing done was purchasing a larger wireless antenna. For under $20, it allowed the antenna to be moved to a position with better reception to the wireless router, and with a stronger signal. There have been very few connection dropouts since putting that in. The eventual goal is to have a hard-wired ethernet connection, but that will be some time down the track if I ever get the house wired up for it.

Another issue was with a hard drive upgrade. Originally with the 2TB Samsung disk, I upgraded it to a Hitachi 5K3000 3TB drive. It ran well for about three months, but then I came down to the lounge one morning and the system wasn't happy. There were drive errors of one kind or another. I grabbed the 2TB Samsung drive again (which had been serving a happy retirement in my desktop PC), and luckily was able to copy all the recordings over to it. It was fortunate that I hadn't filled the extra space either.

So the system was back to its original storage drive, until the warranty fix came back from Hitachi. About three weeks later, a replacecment drive showed up - this time it was a 3TB 7K3000, the next model up. Also, since this happened after the Thailand floods, one of those drives was now worth nearly $400, quite a bit different from the ~$160 I paid.

Now I had a refurbished 3TB drive and a 2TB drive with a year's heavy usage already on it. This made me a little nervous. It was time to move to a RAID1 system. I used the linux mdadm software RAID, with some LVM volumes on top of it. It is a while back now, but the install went OK I can't quite remember the tutorial I used, but these two have quite a lot of information on doing so. The performance hit from running RAID and LVM was not noticeable on the system, either. If desired, you can also set up email notifications if a drive fails or some other problem arises with the array - see here, here and here. One thing to note if you use gmail to send the notifications: if your password has a "#"in it, ssmtp will read the rest of the line as a comment and you'll get all sorts of strange errors. Oh yes, it's best to set up a secondary gmail account to do this, with nothing important in it, since you have to keep the password in a text file.

Since the system worked well, I didn't bother with updating it. It wasn't open to the wider internet (to access via MythWeb). But it was time for a change, and Mythbuntu 10.10 was no longer supported. It was time for an upgrade to a newer version - which will be detailed in another post.

Tuesday, October 18, 2011

Ubuntu 11.10 - Getting KeePass2 working with Chrome again

Rather rashly this time around, I updated my system to the latest version of Ubuntu, 11.10, the day it came out. The upgrade itself went fairly smoothly, although I was disappointed to find that the plugin that links my password manager of choice, Keepass2 with my browser of choice, Google Chrome, stopped working. It just popped up an error box saying it didn't recognise the plugin any more. KeePass still worked, it just was no longer able to communicate with Chrome.

After a bit of searching I couldn't find anyone else with the same issue, and I stumbled upon this answer almost by accident. The secret is that the KeePassHttp.plgx plugin, which is what used to work with Ubuntu 11.04, is not what you want any more. What you do want are two .dll files instead. I went through the following steps to get it working again:

1. From the KeePassHttp website, I downloaded the whole package (it gives a choice of a .zip or tar.gz), click either button. Ignore that the page says "Sorry, there aren't any downloads for this repository." There are!

2. Open the package file you just downloaded - double-clicking it will open it in Archive Manager.

3. Open some of the subdirectories in that folder until you find the two files called "KeePassHttp.dll" and "Newtonsoft.Json.dll". Select those two files and drag them to the Desktop. This will extract those two files, making them ready for the next step.

4. Open up a terminal window. Assuming the files are on your desktop, you can use the following command to copy them to the /usr/lib/keepass2 directory:

sudo cp ~/Desktop/*.dll /usr/lib/keepass2

While you are in a terminal window, rename the KeePassHttp.plgx file so KeePass doesn't throw that error up when you open it:

sudo mv /usr/lib/keepass2/KeePassHttp.plgx \ /usr/lib/keepass2/KeePassHttp.plgx.temp

5. If you now open KeePass2, it shouldn't throw up the error box, and if you go to Tools -> Plugins... the plugin should now appear!

One other thing I did was re-install KeePass2. With the latest release, there is no need to use the separate PPA repository as you did in previous versions of Ubuntu. It is now in the main Universe repository. What I did was uninstall KeePass2, remove the jtaylor PPA repository under software sources (either in update manager or synaptic, if you have that installed), and re-install it from the default Ubuntu repository.

I'm not sure if this is needed for the above solution to work, but I did it just to tidy things up a bit. With less repositories to check, updates go a bit quicker too. With any luck it will also install the correct packages required, that may have changed since 11.04.

Monday, July 11, 2011

Follow-up on 11.04

Well, it's been quite some time now using Ubuntu 11.04. What are my thoughts of using the Unity interface?

Let's put it this way - I've switched back to Ubuntu Classic and have almost forgotten about Unity. Just didn't enjoy it. It was especially clunky when running two screens, with the icon bar down the left side of the screen. That icon bar had a name, didn't it? I've forgotten, it's been pushed out of my memory.

In recent weeks, I've tried out CrunchBang Linux on the laptop. It's a minimal, stripped-down distro based on Debian. It's nice and quick on that, and I'm quite warming to the way the Openbox window manager does things. Being a lightweight distro, there are things that aren't in an Ubuntu install, like a suspend function. I have to do some research into enabling that - whether something has to be installed or not.

Not sure on whether I would put it on the desktop yet. For one, it is based on a fairly old 2.6.32 kernel, that doesn't fully support the solid-state drives' TRIM command. There is an experimental kernel that is an option that comes up when you first install - the "cb-welcome" script is excellent, asking whether to install various commonly-used programs.

One other thing is whether DigiKam would install properly. I have it installed, grudgingly, on this Ubuntu system because it's the next best thing to forking out big bucks on Bibble or Adobe Lightroom. Grudgingly, because it's a KDE program, a buttload of extra KDE-related cruft is installed along with it. I don't want to clog up a nice, fast Crunchbang install with that.

We'll see.

Thursday, May 12, 2011

Thoughts on Ubuntu 11.04 and Unity

After waiting for a few weeks until the commotion died down somewhat, I thought I would have a look at the latest version of Ubuntu, version 11.04, codenamed Natty Narwhal. A major feature of this release is the new desktop environment/interface, known as Unity. This has created a lot of controversy on the internet, which initially made me hesitant to upgrade. Lots of people have complained that it removes a lot of functionality, that things are not where they once were, and so on. I thought that rather than just stick with the old version stubbornly, or switch to the KDE environment, I would actually install it and use it for a week or two, before passing judgement.

First of all, I used my laptop as a guinea pig. There is nothing of importance on it that isn’t backed up elsewhere, so if everything got hosed it would not be too much of a drama to do a clean install. Bringing up the update manager, I clicked the “Upgrade Now” button that has been teasing me for the last few weeks. The upgrade process started, and I left it to its own devices to scan the system, download, install and configure the latest versions of everything.

Much to my pleasure, when it was finished and after rebooting, the system actually started and loaded up the shiny new Unity desktop. All the effects were running, and this is machine had a fairly old ATI card and runs the open-source radeon drivers. It’s a bit of a departure from previous versions of Ubuntu, so I can see the concern other users have. A bit of experimental clicking around brought up my first problem - how do I launch more than one instance of a program, such as the terminal window? Clicking the terminal button on the side pane (which was there because it was configured as a button on the task bar on the previous install, along with Chrome) again just brought the existing terminal window to focus.

What?

That’s not going to be much use, I thought - so a consultation of the Google was called for. Turns out, giving the icon a click with the middle mouse button is the secret to opening additional instances.

I recommend searching around for some Unity guides or tutorials  - a good selection is at this site to get an idea on how to use it. Some sort of guide or walkthrough should have been included with the default install - a link on the desktop or something, as this is a pretty big step. There’s a bit of a learning curve, but I think it has a lot of promise. Another little gem I found out was the use of the Windows key (or Super key) - a quick press brings up the dash where you can type in a program’s name, similar to the functionality in Windows 7; a longer press bring up the launcher, holding it down longer puts numbers on the icons that you can then use as shortcut keys to launch the programs.

Also check out this page of things to do/tweak after installing.

After one afternoon’s usage, I get the feeling that it’s not a massive backward step as people are saying, but a different way of doing things. It’s like the step from Windows XP to Vista or Windows 7 - things are in different places now, there’s some adjustment required, but after using the new features it’s difficult going back to the old way.

After mucking about with the laptop for a bit, I thought I would do a trial install on my main system. Still not willing to risk the main install, I grabbed an old hard drive, put that in my system and unplugged my existing drives. I then started the install process from CD, from scratch.

One of the concerns I had was that Unity is a part of Compiz - the desktop effects package that does not run on the open-source nouveau drivers for Nvidia cards. I have been running those on my desktop since they allowed the suspend functionality to work - the binary nvidia drivers did not do that. So this was going to be the big test - if suspend didn’t work on the new version, I would probably give the upgrade a miss or try KDE perhaps.

After quite a while of downloading updates and various components during the install (the default mirror must have had a really slow connection), the install completed and I rebooted. First impression - the loading screen actually worked properly. The nvidia drivers might finally be playing nice! Login screen came up, followed by the desktop. Going to the nvidia-settings program confirmed that the binary drivers are in use, so it was time to see if suspend worked or not. Clicking the suspend option in the main menu, the system actually powered down. No blank screen with blinking cursor in the corner, like in previous versions. I was impressed. I’d be even more impressed if the system came back up again. Hitting the power switch, the drive span back up, up came the password prompt to unlock the system. Entering the password brought the desktop back up, with a minor bit of graphical glitchiness on the side pane, but once I moved the mouse over it, it all came good. Success!

One thing I noticed was the behaviour of the launcher with a multi-monitor configuration. the way I have my screens set up, the second screen is off to the left of the main screen. So if I move the mouse to the left edge of the main screen, to bring up the launcher, if I move any further left onto the second screen, the launcher disappears again. Might have to look into that, whether I can move it to the right edge or something.

So far, that is my experience with 11.04. Further discoveries, from a longer period of use, will be posted in the future.

Thursday, March 17, 2011

Using a solid state drive in a MythTV box - does it make a difference?

The other day I finally got around to installing a solid-state hard drive (a 40GB Intel X25-V) into my MythTV box, to see what sort of difference it would make in day-to-day running. Of course, I only have the root partition on it, no recordings. I still have the 2TB drive for them. What prompted the move was the occasional sluggishness to respond when going through menus, and the odd pause or stutter when hitting the "i" or Info button on the remote. It would also sometimes get a brief pause when it popped up the notice that a commercial break was about to start.

I figured that it was down to too much being asked of the main storage drive - asking it to respond snappily when it is recording four or five episodes and playing back another is just too much.  What if there was a second drive that could take care of the actual running of the machine, just leaving the big drive as a bit bucket to store media on?

Taking the Intel SSD from my main desktop (I had bought a 60GB OCZ Vertex to replace it), there was a spot ready for it in the Lian Li PC-Q07 case - right under the main drive. It wouldn't get a whole lot of air, so I'm glad it's a cool-running SSD. I copied the root partition from the 2TB drive onto it, as well as creating a swap partition. Partition sizes were kept down - 16GB for the root partition, 3GB for swap, leaving more than half free for the drive to use for wear-levelling. Overkill, but Mythbuntu doesn't need much room for its base installation. Eventually I got it working and booting from the ssd (after much swearing - how I did it may be covered in a future post) and I could check out the results.

And has it made a difference? A small one, but it's noticeable. Going through menu screens is a little quicker, more responsive. During playback, hitting the info button brings up the playback time without any stutters. Ending playback brings you back to the menu quicker. It's made the interface seem that little more polished. I'd say that it's not the fact there's a solid-state drive that has made the difference, more the fact that there is a second disk that's able to take some of the load off the storage one. I am not able to test it with another type of drive (frankly I can't be stuffed), but there are advantages in power consumption in going for an SSD.

Saturday, February 19, 2011

Potential problem syncing Tomboy Notes

A problem I had the other day was getting the Tomboy Notes application to sync correctly with my other PCs and the Ubuntu One service. The thing that triggered it was editing a note using the Ubuntu One web interface - basically editing the note  stored on Ubuntu's servers. When I later tried to sync my notes on the PC, the application said the sync failed, please check below for error messages. When I checked the messages below, there weren't any. Rather frustrating.

Looking on the troubleshooting section of the Ubuntu wiki, towards the bottom of the page, it mentions the commands required to start Tomboy with debug messages. As follows below:

Getting debug info

  1. Quit Tomboy
  2. Applications->Accessories->Terminal, and run:
    • tomboy --debug > ~/tomboy_debug.log

One thing to note: to quit Tomboy, I had to right-click on the Tomboy icon on the panel and select "remove from panel". Check in the System Monitor (System -> Administration -> System Monitor) that the tomboy process is no longer running.

When I ran the above command, tried to sync (unsuccessfully) and checked the log file, it came up with an error of:


[ERROR 19:51:49.776] Synchronization failed with the following exception: String was not recognized as a valid DateTime.
  at System.DateTime.Parse (System.String s, IFormatProvider provider, DateTimeStyles styles) [0x00000] in :0 


Doing a search on this message revealed a couple of other people who had the same issue. One such user was here, and one of the answers pointed to this bug report here.

The solution required for me wasn't quite as drastic as what they tried - backing up all notes, deleting them from the Ubuntu One web interface and locally on the machine, syncing, then re-creating all notes. I just deleted the one note I edited from the web interface and on my local machine, and sync worked again. I recreated the note, tried re-syncing, and it all worked fine.

The moral to the story is, don't use the web interface to edit your notes. It could cause problems.