Thursday, November 29, 2007

It happened again - disastrous data corruption. Last time it involved my email client (icedove) on my own Linux box. This time it was my wife's email client (Outlook Express) on her Windows machine.

It started when OE asked me, upon being closed, if I'd like it to compact its folders in order to save disk space. This kind of maintenance is recommended by Micro$oft in order to prevent corruption of the message storage files. Compacting is also known to cause corruption...

And guess what? it did. My wife's Inbox, very much like her desk, is filled with stuff - more than 8000 messages. After compacting was done, only 6000 messages were left - 9 months worth of emails were lost.

If this ever happens to you and you're running Windows XP and up than you may be able to restore the original dbx storage files - OE places a copy of the original files in the recycle bin before compacting (but with a .bak extension instead of .dbx).

I didn't know this at the time, so I went ahead and restored those email messages from the Bacula backup. As I described a while ago, I have an elaborate backup procedure that backs up individual email messages instead of the gigantic dbx files. After restoring the messages to a temporary folder on my wife's PC, I simply selected the missing messages (eml files) in Windows Explorer, and then dragged and dropped them into the Inbox folder in OE.

Sunday, November 25, 2007

One of the nice things about using a laptop as a desktop substitute is its battery. This proved important lately as we experienced several successive power failures. We finally managed to find the culprit - a faulty electrical appliance.

In the meantime I needed a way to disable backups when my laptop was running on batteries, because the the external USB backup disk runs on mains power. This is easy enough using the script on_ac_power (part of the powermgmt-base package) - define the following function

Wednesday, November 21, 2007

It took me a while to accept the fact that my backup disk is simply too small. It proved too small even after carefully selecting the files and directories to backup, and calculating the files and job retention periods, and backup rates, to match my 60GB disk. It only takes a few days of leaving large files lying around to fill up the backup disk - it has no slack.

I felt it was time to indulge myself and buy some hardware - I got a Western-Digital 250GB Elements USB external disk. It comes with no software at all, FAT32 formatted, and is readily recognized by my box.

I decided to format it after checking the disk with fsck.vfat (part of the dosfstools package) - it complained about differences between the FAT's on the disk, and about hidden sectors. The interesting bit of trivia regarding FAT32 is that you can't format a FAT32 volume larger than 32GB - get this - under Windows! Under Linux you just run the following:mkfs.vfat -F 32 -n volume_name /dev/sda1

(you should, obviously, replace /dev/sda1 with the correct device path). The generated file system (233GB in size) is perfectly usable on both Windows and Linux.

As it happens, I did not specify a volume label, and went on to copy the backup files from the old disk to the new disk. I (and my Linux box) only realized that the volume label was now empty, at the next reboot, two days later. So I needed a way to label the disk without formatting it. This can be done with mlabel (part of the mtools package) like this:

mlabel c:volume_label

But you must first edit /etc/mtools.conf to make sure that the drive letter c: maps to the correct Linux device path - in my case it was just a matter of un-commenting the following line:

drive c: file="/dev/sda1"

I don't know why this mapping is necessary, but that's how these tools work.

Slack is good.

[7 Feb. 2008] UPDATE: labeling a disk updates just one FAT, causing fsck.vfat to complain about differences between FAT's on the labeled disk - this seems to be perfectly harmless.

Saturday, November 3, 2007

I was playing around with the GNOME Swallow applet. It's a nice little toy that can "swallow" non-applet applications into the GNOME panel. I used it to convince wmforkplop and wmhdplop to show up in the bottom panel, and then decided it would be nicer to have them on the top panel.

I didn't realize at the time, but it turns out that hitting "cancel" on the swallow applet configuration dialog box, doesn't remove the applet from the panel - it only leaves it un-configured. The only way to actually remove it (when it's not configured) is by directly editing the list of panel applets that's kept in the GNOME configuration database. This can be done manually using gconf-editor, but following this guide I came up with a script to get rid of all the swallow applets on the bottom panel: