Wednesday, May 30, 2012

f-spot dead?

I've been using f-spot for quite some time now to manage my photo collection. When looking at their homepage, I noticed the last version was released somewhere in 2010 (?). In software terms, this makes f-spot ancient technology :) so I started to wonder.

Browsing through their mailinglist, I came across this thread. In short, f-spot isn't dead yet, but it is not actively maintained anymore. This means that stability issues and bugs probably won't get addressed any time soon. Fortunately, someone wrote a script to migrate the f-spot database to digikam. Maybe I should give this a try ... I'll keep you posted.

Friday, April 27, 2012

Using the Qube as a NAS device 2

In an earlier post I forgot to mention that installing NetBSD using the Restore CD option will wipe out your whole drive. So, before I started, I disconnected the hard drive and installed everything on the CF card. A basic installation of NetBSD does not require a lot of space. The 1 GB CF card was big enough for a basic install, but, to be able to use pkgsrc, I installed a 4 GB card.

After I verified the installation was working properly, I decided to connect the hard drive again. This is where the problems started :(

VIA Technologies VT83C572 USB Controller (USB serial bus, revision 0x02) at 
pci0 dev 9 function 2 not configured
tlp1 at pci0 dev 12 function 0: DECchip 21143 Ethernet, pass 4.1
tlp1: interrupting at level 2
tlp1: Ethernet address 00:10:e0:00:3c:5d
lxtphy1 at tlp1 phy 1: LXT970 10/100 media interface, rev. 3
lxtphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
wd0 at atabus0 drive 0: 
wd0: 977 MB, 1986 cyl, 16 head, 63 sec, 512 bytes/sect x 2001888 sectors
wd1 at atabus0 drive 1: 
wd1: 298 GB, 620181 cyl, 16 head, 63 sec, 512 bytes/sect x 625142448 sectors 
Kernelized RAIDframe activated
viaide0:0:1: lost interrupt
       type: ata tc_bcount: 512 tc_skip: 0
viaide0:0:1: bus-master DMA error: missing interrupt, status=0x61
viaide0:0:1: device timeout, c_bcount=512, c_skip0
wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn 0 tn 0 sn 0), retrying
viaide0 channel 0: reset failed for drive 0 drive 1
viaide0:0:1: lost interrupt
       type: ata tc_bcount: 512 tc_skip: 0
viaide0:0:1: bus-master DMA error: missing interrupt, status=0x61
viaide0:0:1: device timeout, c_bcount=512, c_skip0
wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn 0 tn 0 sn 0), retrying
... (several minutes, same message)
viaide0:0:1: lost interrupt
       type: ata tc_bcount: 512 tc_skip: 0
viaide0:0:1: bus-master DMA error: missing interrupt, status=0x61
viaide0:0:1: device timeout, c_bcount=512, c_skip0
wd1d: device timeout reading fsbn 1 (wd1 bn 1; cn 0 tn 0 sn 1), retrying
viaide0:0:1: lost interrupt
       type: ata tc_bcount: 512 tc_skip: 0
viaide0:0:1: bus-master DMA error: missing interrupt, status=0x61
viaide0:0:1: device timeout, c_bcount=512, c_skip0
wd1d: device timeout reading fsbn 1 (wd1 bn 1; cn 0 tn 0 sn 1), retrying
wd1: soft error (corrected)
wd1: no disk label
boot device: wd0
Hmmm, strange. This was definitely not a hardware problem, since the disk is fairly new and was working without any issues in Debian Lenny and Squeeze.

I suspected some kind of DMA problem, so I asked the friendly (yes, they are very friendly, not the RTFM kind) people for help. They suggested to recompile the kernel, and make it more suitable for running on my Qube. The following procedure describes how to do this on a recent Linux box (tried on openSUSE 12.1):

Go somewhere on the Linux machine, and do this:

mkdir src tools obj
cvs -d :pserver:anoncvs%anoncvs.netbsd.org@localhost:/cvsroot checkout -PA  -rnetbsd-5 src
This will get you the latest 5.x source tree.
Go to src/sys/arch/cobalt/conf/
Copy GENERIC to some other name, edit it and save it.
Go back to src
Now, create tools ./build.sh -m cobalt tools
Now, build the kernel ./build.sh -m cobalt -T ./tooldir.Linux-3.1.9-1.4-desktop-x86_64 -O ../obj kernel=MyKernel
After a while it will end up in the obj/sys/.../netbsd
Put the kernel (netbsd) in / on the Qube, and rename the old kernel netbsd.old You can choose which kernel is booted at the Qube's boot prompt, by simply typing its name (if you're connected to the serial console).

Disabling DMA in the kernel config (GENERIC) was fairly easy. Locate the following lines:

# IDE drives
# Flags are used only with controllers that support DMA operations
# and mode settings (e.g. some pciide controllers)
# The lowest order four bits (rightmost digit) of the flags define the PIO
# mode to use, the next set of four bits the DMA mode and the third set the
# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
# to use, and the last bit must be 1 for this setting to be used.
# For DMA and UDMA, 0xf (1111) means 'disable'.
# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
# (0xc=1100, 0xa=1010, 0xf=1111)
# 0x0000 means "use whatever the drive claims to support".
wd*             at atabus? drive ? flags 0x0000
Now, do what the documentation says and put 0xf to disable DMA:
wd*             at atabus? drive ? flags 0x0ff0
After compiling the kernel using the above procedure, the Qube boots just fine. What's more important; I can now actually use the machine as a NAS device. I already produced several backups using mondo on the Qube, without any problems.

Wednesday, April 25, 2012

Using the Qube as a NAS device 1

Some time ago I described my adventures in installing Debian (Lenny at that time) on an old Qube 2. It was cool to install it, but I didn't find a proper use for it. So it has been gathering dust for a while, until I decided to use it as a backup server for my desktop and wyse. So, this weekend I decided to fire up my favorite mondo script and create a backup for the wyse (before dist-upgrading it to squeeze).

Unfortunately this didn't work very well. The moment the network card in the Qube gets some load it starts to hang. After some time in the backup process, I couldn't ping the Qube any more. The serial console didn't respond either, so I think it died. Putting a newer network card in the box's free PCI slot did not solve my issues either. It seems that Debian (or maybe even Linux) is just not stable enough to cope with a lot of network traffic / load. So in short, Debian failed miserably turning the Qube in a decent (albeit slow) NAS.

After googling for a while, I found another valuable alternative to run on the Qube. Enter NetBSD.
Now, I've been using Linux for quite some time now and I know how to move around on the command line, but - I thought - NetBSD is a whole different league. Fortunately, NetBSD provides a very simple procedure to install the Qube using a so called Restore CD. The idea is simple:

  • find an old i386 machine that can boot from a CD-ROM;
  • connect the Qube with a cross-cable to the i386 machine;
  • boot the i386 machine with the Restore CD;
  • netboot the Qube
You will see that the Qube will netboot from the i386, which will allow you to start the install procedure. Just follow the instructions step by step and in the end, you will have a working Qube 2 running NetBSD.