Sunday, April 15, 2007

Backup... Just in time

Even though I intended to write about something completely different (the first FindBugs bug detector I wrote), I decided to put this first, because of it having been more "important" to me in the last week.

Some background: About three years ago my girlfriend's notebook drive crashed. Even though she insists it was my fault, because I was using the computer at the time, it was the first hard drive in my immediate surroundings that actually had a real hardware defect. Call me lucky, but in all the time back to my first HD (must have been around 1992) I never really saw a broken hard drive.

Back then I was concerned about my own data and started backing up my files to DVDs. However I - as probably anyone does - soon grew tired of burning new disks, because the time never seemed to be right. Either I had not really changed too much, or there was simply no time to do it. So soon I forgot about it again.

Three weeks ago I heard about from a colleague that in one weekend he had lost all three of his computers at home (one PC, two Macs). One had a "simple" hard drive crash, the next one's PSU decided to incinerate itself, sending the full 230V through the machine's components, leaving little to salvage. The last machine just stopped working, but I do not really know why.

Not really succeeding to remember when I had last burned my more important data to DVDs (burning all of it including music and videos is just too impractical - and expensive - to do) I decided that I had to do something about my backup strategy - given that what I had done before even granted calling it that.

Last Saturday I bought a 500GB external USB hard drive. German computer magazine c't (some English pages here) presented an rsync based Visual Basic Script for data backups to external disks in 2006 (see article and the script). Even though the script it designed to be used on Windows and NTFS formatted backup disks still found the idea very interesting: Make one full backup and do incremental backups utilizing rsync's ability to create hard-links for files it finds in a previous backup. This effectively lets you see multiple backup directories on the backup drive, each of them virtually presenting a full backup, but at only the disk space cost of incremental backups. A quick search of the new brought me to www.rsnapshot.org/, a free utility written in perl and based on the very same principle.

I downloaded and installed the Ubuntu package and set it up to backup much more than I had previously burned to DVDs manually. In total it copied around 300GB to the external disk in the first run. The day after that (Sunday) I let it run again (have set up cron now). The second folder contains roughly the same amount of data, but the free space on the drive has not really been decreased. Great stuff :-)

Fast forward to Thursday - three more backup folders on the external drive - virtually the same free space. Editing my FindBugs blog post I see the external disk starting to work - daily backup run just started. A few minutes later I start to wonder why I hear strange noises from my PC. Looking a dmesg's output I see lots this:

Apr 12 03:22:52 yavin kernel: [17197689.492000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:22:52 yavin kernel: [17197689.492000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:22:54 yavin kernel: [17197690.604000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:22:54 yavin kernel: [17197690.604000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:22:54 yavin kernel: [17197690.604000] sd 1:0:0:0: SCSI error: return code = 0x8000002
Apr 12 03:22:54 yavin kernel: [17197690.604000] sdb: Current: sense key: Medium Error
Apr 12 03:22:54 yavin kernel: [17197690.604000]     Additional sense: Unrecovered read error - auto reallocate failed
Apr 12 03:22:54 yavin kernel: [17197690.604000] Info fld=0xbce4016
Apr 12 03:22:54 yavin kernel: [17197690.604000] end_request: I/O error, dev sdb, sector 198066192
Apr 12 03:23:47 yavin kernel: [17197744.520000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:23:47 yavin kernel: [17197744.520000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:23:49 yavin kernel: [17197745.640000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:23:49 yavin kernel: [17197745.640000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:23:50 yavin kernel: [17197746.756000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:23:50 yavin kernel: [17197746.756000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:23:51 yavin kernel: [17197747.872000] ata2: status=0x51 { DriveReady SeekComplete Error }
Apr 12 03:23:51 yavin kernel: [17197747.872000] ata2: error=0x40 { UncorrectableError }
Apr 12 03:23:52 yavin kernel: [17197748.980000] ata2: status=0x51 { DriveReady SeekComplete Error }

Long story short: One of my hard drives, a Samsung Spinpoint SP1614C (160GB SATA), suddenly died - only a few days after I had backed up everything on it...

When did you last back up your stuff?

No comments: