Friday, January 09, 2009

rc8!

Well, it's been a long time coming, but TuxOnIce 3.0-rc8 is finally out. I'm hoping to get 3.0 itself out pretty quickly; hopefully next Monday or Tuesday.

Saturday, August 02, 2008

Where Do You Put Your Hibernation Image?

This is a lesson I keep forgetting and relearning: The position of your storage on your hard disk can make a huge difference to your throughput.

I was just discussing this on irc. A TuxOnIce user was only seeing about 17MB/s raw disk throughput, while hdparm -t reported 34MB/s. Why the difference?

It came down to the fact that he was using hdparm -t /dev/sda, rather than hdparm -t /dev/sda5. The speed shown by hdparm was thus that of the start (outside?) of the disk, rather than the area where the swap partition was stored.

Looking at my own hard disk, where the swap partition is also not the first partition, yields some interesting numbers:

hdparm -t /dev/sda yields approximately 50MB/s and hdparm -t /dev/sda3 (my swap partition) gives about 41MB/s. After compression, I should thus get about 15MB/s more if I put my swap first. On a 3GB image, that's around 5 seconds.

Power off your UPS after hibernating.

A recent email the Linux Kernel Mailing List sought a way to turn off a UPS after hibernating.

I haven't had the chance to give this a try yet, but think it should be possible with any recent TuxOnIce. Here are the steps:

1. Compile and install a TuxOnIce enabled kernel with the KeepImage mode compile time option enabled.
2. Create an initrd or initramfs that contains everything necessary to power off your UPS. This initrd/ramfs should be completely self contained. It should NOT mount your root (or other) filesystems. Test this initrd/ramfs by creating a separate Grub or Lilo menu entry.
3. On one of your partitions, create a small file that the file allocator can use. (You can use a swap partition instead, but it seems a waste of a partition table entry). Get the resume= command line parameter you need for this file and put it in the grub/lilo entry for the initrd/ramfs you created in step 2.
4. Modify the initrd/ramfs you created in step 2 so that, prior to doing the power off, it hibernates. In addition, modify it so that it enables the keep-image mode (echo 1 > /sys/power/tuxonice/keep_image) prior to doing the hibernate.
5. Now boot your kernel with the initrd/ramfs. It should hibernate rather turn off the UPS. This gets the powering off part ready.
6. Now boot with your normal kernel. Use the normal location for hibernating (NOT the file we set up in step 3).
7. Modify your /etc/hibernate/suspend2.conf so that it includes "ProcSetting alt_resume_param [value_from_step_]>" (Where "[value_from_step_3]" is replaced by the resume= value for the power-off-the-UPS-initrd/ramfs).

Now, when you hibernate, it should write the image as normal. Then, when the image has been written, it should start to resume from the image which you created in step 5. Once that image is resumed, the kernel will continue in your special initrd/ramfs with the commands to power off.
8. To go back to work, boot your normal kernel, as usual.

Labels: , ,

Wednesday, April 02, 2008

It's been a while, hasn't it?

It's been a while since my last post - roughly six months.

That's because I've had no shortage of work to keep me busy. Before I go to sleep tonight, I thought I've have a little rant, though :)

My laptop died in February, and I ended up buying a Dell XPS M1530. Love it, apart from Dell's slowness in providing a BIOS with proper virtualisation support. A new bios released a week or two ago fixed that, thankfully.

The laptop came with Vista, which I dutifully wiped, installing Fedora and more recently Ubuntu, under Vmware. Vista (being 32 bit in my case) worked under VMware prior to the BIOS update, but 64 bit Linux didn't.

Prior to this laptop, I used Windows 98 to run Libronix in a 5GB virtual disk. So when I installed Vista, I thought 10GB should be plenty. It wasn't long, though, before it started complaining about running out of disk space. "What?", I thought. I'd only installed Libronix and OpenOffice. Even with a couple of gigabytes of books, I shouldn't be running out of space! So I cleaned up and so on, but to no avail. Thankfully VMware lets you resize virtual disks quite easily. 15GB was soon set aside.

Time passed. Tonight I thought. "Hmmm. I suppose I'd better install those Windows Updates". Silly me. But before I knew it, I was low on disk space again. Apparently Windows expects a minimum of 15GB, and prompty chews most of that for c:\windows. In my case, c:\windows is taking 10GB of space. I could find that the side by side (sxs I think it's called) directory is chewing about half of that. I couldn't account for the other 5GB, even after telling Windows to show hidden files and so on.

Can you safely delete the 5GB in the sxs directory? "No way, Jose!" say a host of websites I Googled. Isn't that crazy though? What in the world is Windows doing, needing 5GB for what are supposedly legacy DLLs and such like. Where did all these legacy DLLs even come from?

So, now M$ has sucked 20GB of space for something that used to take 5GB, and I still can't get SP1 to successfully install. Apparently the mysterious error message code means there's not enough storage. Gosh. There's 5.37GB free (and falling)...

Friday, October 05, 2007

More Mythbox

My evenings tinkering with the mythbox have been fruitful.

It turns out that the tuning issue was a problem in MythTV. It wasn't storing the channel characteristics properly. Some fixing in phpmyadmin and we're up and running.

I also had problems with suspend to ram when I got around to trying that. It was pausing at resume until I pressed a key. Apparently there was some problem with the timer code, that's fixed in 2.6.23-rc9.

I also found that I'd broken the poor, neglected checksumming support in TuxOnIce (again), resulting in a hang when doing the atomic copy. I'll commit a fix in a while.

So, now the only things I need to do on the mythbox are wait for the support for the remote control, do a backup and finish sorting out the intricacies of watching TV again post suspend-to-ram. Or at least that's all that occurs to me right now :)

Wednesday, October 03, 2007

Colour TV Output Howto

There are lots of records of people having trouble getting colour TV output. Having just gotten it going, I thought I'd provide an additional pointer to the solution that worked for me:

http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=TVOut tells you to just include the following settings...
Section "Monitor"
Identifier "Monitor0"
HorizSync 30 - 50
VertRefresh 50.0 - 50.0
EndSection
Section "Device"
Identifier "Card0"
Driver "openchrome"
Option "ActiveDevice" "TV"
Option "TVType" "PAL"
Option "TVOutput" "S-Video"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Modes "720x576" "720x576Noscale"
EndSubSection
EndSection

Progress on the mythtv box.

The MythTV box is up and running. I'm reasonably happy with it, but still have work to do.

The harddrive controller's power management routines don't seem to be up to scratch - after the atomic copy when hibernating, no more data gets written. I'll have a closer look when I find some time.

The Digital 4 tuner didn't work until I tested it in another computer, running M$. Maybe I didn't hold my tongue right :). It's now working okay (bar the remote - the maintainer says he knows how it works but hasn't found the time yet to write the code). Being out in Cobden, the signal isn't magnificant. I have a Winfast DTV 2000H as well - I should compare them. Failing that, I have a friend who runs an aerial business; maybe I'll have to pay him to take a look at the reception.

Did I mention the configuration before?

- Morex ProCase Mini-ITX 2699 black, 60w Ext PSU, 1xRiser card
- Via EPIA Mini-ITX M/B LN10000EG w/1G C7 nanoBGA2 CPU, DDR2 RAM
- FusionHDTV DVB-t Dual Digital 4 TV Card, Two Channels, PiP, Power Up
- Apacer DDR2-667 PC2-5300 1.0GB, CL5, 64X8 RP
- HDD SATA, Samsung SpinPoint, 250GB, 8MB 7200 SP2504CN
- Wireless networking via a DLink G730AP (powered off USB port)
- Creative 2.1 Speakers
- Mythbuntu (I discovered there's a Fedora MythTV later)