Time Machine and Linux

Previously I had written about using an Ubuntu server to host Apple Time Machine backups.   Now that I’ve retired the old server, I needed to re-do some of that work to get backups running again.  This time I decided to skip Part A – which was about enabling AFP to make it as Mac friendly as possible.  My new setup simply uses Samba to expose the previously created time machine volume as described in Part B of my old post.  This seems to be working just fine.

I learned the backup lesson the hard way, losing a 20Gig drive a few years ago.  There are in my office two dis-assembled hard drives: one which is the failed drive, and the second was a working same model number drive I bought on eBay.  The plan was to swap the controller board to hopefully save some of the data (it was my old web server).  It turns out that even though the drive models were the same, the internals were different – one drive had a single platter, the other a dual platter.  If this blog posting gives you that “yeah, I should really get my backup story sorted out” feeling, then go do something about it right now.  Hindsight is 20/20.

I meant to take a picture of that pair of drives to accompany this post, but failed to get a quick picture before I left the office.  I figured that I’d use the Creative Commons material from Flickr for this post.  It turns out that giving the correct attribution to the photo is a bit of a pain via Flickr (they should really fix that) – but there is a solution: www.ImageCodr.org.  With a few clicks and a cut and paste from the Flickr photo you want to use, you get an HTML snippet to use.

I had been using rsync to do backups on my old server, backing up from the main drive to one of the data drives.  As well, a number of the machines around the house would rsync backup over the network to the server.  On my new server I’m using rsnapshot, which is based on rsync but provides some nice scripting to give you a nice set of default behaviours.  Setting it up to do local backups from the server main drive to a mounted data drive was trivial.

Using rsync you can configure incremental backups – utilizing hard links to provide multiple full directory trees, with only a small increase in disk footprint.  Rsnapshot uses this facility to provide hourly, daily, and weekly backups – very similar to Time Machine’s backup story which as the data gets older, you get less granularity.  I’ve set it up with daily, hourly and monthly backups – after a few weeks it looks like this:

drwxr-xr-x 3 root root 4096 2009-04-21 00:30 daily.0
drwxr-xr-x 3 root root 4096 2009-04-20 00:31 daily.1
drwxr-xr-x 3 root root 4096 2009-04-19 00:30 daily.2
drwxr-xr-x 3 root root 4096 2009-04-18 00:31 daily.3
drwxr-xr-x 3 root root 4096 2009-04-17 00:31 daily.4
drwxr-xr-x 3 root root 4096 2009-04-16 00:30 daily.5
drwxr-xr-x 3 root root 4096 2009-04-15 00:30 daily.6
drwxr-xr-x 3 root root 4096 2009-04-14 00:30 weekly.0
drwxr-xr-x 3 root root 4096 2009-04-07 00:30 weekly.1

So while I’ve got many full file trees, through the use of hardlinks only 4.7Gig of storage is being used to have 9 copies of a 3.7Gig file tree.

The New Server

I had previously posted about the server than runs lowtek.ca and that it had been given me trouble.   Well, the new parts came pretty quickly and it was a good thing – as just last week the old server packed it in.  It turns out that the most likely reason for the instability was the CPU fan, as it totally seized on the failure day and my CPU temperature climbed up past 90C.  An $8 fan might have solved my immediate problem, and been a lot less headache — having temperature graphs of the server would have helped spot this, something I plan to do with the new one.

At least I had a good excuse to buy new hardware.img_1086 So here is a picture of it hanging out in my furnace room next to the water heater.  While the new system is based on a MiniITX mainboard, I’ve opted to use a full size ATX tower case to house it (the case was a free hand me down from a friend).

I did modify the case quite heavily.  The stock fan grills were simply holes drilled in the case – it was more grill than not, so the airflow was pretty poor.  A couple of minutes with the dremel removed the grills entirely.  I also opened up the front bezel to provide easy inflow of air for the lower case fan.  The upper case fan is mounted to a pair of drive bay covers I’ve glued together.

This case has 6 x 5.25 drive bays, and 3×3.5 bays.  My system drive lives down in the bottom and the data drives are up where the top fan is.

I also cut a fan vent in the side panel to blow down onto the mainboard itself.  This I did with a jigsaw, and I think it turned out well considering it was my first attempt a something like this.

img_1071This older ATX tower case had all of the right connections for this new motherboard.  Power, reset and HDD connectors hooked up no problem.  The power LED was a 3 pin connector vs. the required 2 pin connector.  Karl was able to hook me up with a spare HDD connector that I spliced onto the power LED.

Since there were mounting locaimg_1074tions for 2 more exhaust fans, I couldn’t help myself and added two more at the top/back of the case.

If we count fans, I’ve got 5 case fans, 1 more in the power supply, and a chipset fan on the mainboard.  Overkill?  Yes. Required?  No, probably not.  There seem to be plenty of folk out there running exactly the same board with very minimal cooling.

My motivation here was the current system failing due to heat death, and I’d like this new system to run problem free for years.  The extra cost of a few fans isn’t a big deal, and its very quiet relative to the furnace.  I may further duct / optimize the cooling as the measurements thus far don’t show much of a delta from other peoples numbers on the net.

One more picture of the guts, to give you a sense of how small the MiniITX board is:

img_1070The transition from the old system to the new one should have been as simple as dropping in the drives and booting.  Unfortunately the old version of Ubuntu (Dapper) didn’t have support for the new Atom board and couldn’t make use of its network drivers etc.

Worse still, the system drive refused to boot in the new machine.  It is something that still has me scratching my head.  I even went to the effort of cloning the boot drive onto another which I had proven would boot with the new system – and still no go.  It was almost as if the MBR was in an unexpected location.  Last week I lost a bunch of sleep.

img_1075Above is a picture of the old server while it was cloning the boot drive (which as I mentioned, turned out to be a waste of time).  After five hours of beating my head on the problem, I simply moved the data drives to the new system – and did a clean install on a fresh boot drive.  The old server continued to host lowtek.ca on the old system drive using the external fan to keep the CPU cool.

Yesterday I turned off the old server.  Here are a few URLs that I found helpful in the migration:

As I host a number of wordpress blogs here migrating them required a database backup / restore.  I simply copied over the /var/www directory data instead of re-installing the blog software itself.

Backup:

mysqldump --add-drop-table -h localhost -u sql_username \
--password=sql_passwd sql_database_name > blog.bak.sql

Create DB on new host:

$ mysql -u root -p

mysql> CREATE DATABASE sql_database_name;

mysql> GRANT ALL PRIVILEGES ON sql_database_name.* TO “sql_username”@”localhost”
-> IDENTIFIED BY “sql_passwd”;

mysql> FLUSH PRIVILEGES;

mysql> exit

Restore:

mysql -h localhost -u sql_username  -p sql_database_name < blog.bak.sql

Well, if you’re still hanging in there – let’s talk about power consumption.  I borrowed Trent’s Kill-A-Watt meter and did some measuring.  My home desktop machine draws around 150Watts, and up to 200Watts of power when loaded (and using the CD drive).  The old server machine used 2W in standby, 120W during boot (loaded) and 112W steady state.  The new machine uses 1W in standby, a peak of 100W at boot (when the drives are spinning up), and 60W steady state.

In conclusion: Server machines need to have monitoring setup to track potential problems (temperature).  Migration of your data is less painful if you keep an install log with notes and links (thank goodness I did one last time).  New hardware usually needs a new software install, don’t fight it.

eWaste and Nostalgia

We’re busy moving our home office from one room in the house to another.  My home office was very similar to my work office, full of random junk — so far the new home office is fairly tidy, but this has come at a cost – I’ve had to part company with some of my beloved junk.

Hanging about in the closet was my 3rd ever computer, a 486/33.  I bought this in the very early 90’s – and was certainly the 1st kid on the block with a machine of this caliber.  I was working as a COOP student at QNX back then, and this my new machine was equivalent to the ‘really fast fileserver’ they had in the lab.  This 486 was paired up with my external USRobotics 14.4k modem that looked a little like a stealth bomber.  Let’s take a look inside:

img_0873

Under the mess of cables you can see that the ISA expansion slots are nearly full.  This is a sharp contrast with new computers which much more commonly have almost all functions implemented on the motherboard, in this old PC everything is supplied by a specific add on card.

First up is img_0877the IDE card, supporting the floppy drive and CD-Rom (which was an add on much later in this computers life).  If you look carefully at the first picture above, you might notice that there is a 5.25″ floppy drive in there.

The next card is img_0878-1an Adaptec 1542b controller card, this was purchased in combination with a 1G SCSI drive at a combined cost of nearly $2000.  At the time, if you wanted a large drive you had to use SCSI – and in addition, the operating system I was running (386BSD) only had support for a limited set of hardware, the 1542b being one of the supported cards.

Next up img_0881is a Microsoft bus mouse card.  This was before PS/2 mice, and way before USB ports.  In truth, the bus mouse card was added many years after when I had stopped using this machine as a unix (server) machine and had started to use it as a desktop (Windows).

img_0882Of course, we need some serial ports to hook up that external modem.  I’m pretty sure that this card had a pair of 16550 UARTs on it allowing the use of the higher modem speeds.  This card used a 2nd expansion slot on the back of the PC case to house the 2nd serial port and game port.

Then we move on toimg_0879-1 the video card.  Again this was not the original card in the machine but an upgrade I added later on.  This particular card was a v24 bitblaster S3 card – capable of running XWindows fairly well at the time.

The last expansion card to mention would be the img_0880-1sound card, a classic SoundBlaster card.  Again this was a very late addition to the machine when it did its last stint of service as a Win95 machine.

Let’s take one last peek under the hood at the motherboard itself and the installed RAM.  And yes – that’s a total of 32MB of RAM stuff into all those slots.  It is also interesting to look at how much copper is visible on the mainboard – you could probably build several new machines from the materials used on this one board.

img_0883

While it hadn’t seen regular use in the last 4 years or so, this machine did boot fine the other day.  Considering the core hardware is was more than 17years old, I think that’s a pretty impressive track record for any computer.  Today my cell phone has more MIPS than this computers, so it was certainly time for it to go.  Sadly, the last boot of this machine was to bring up DBAN to wipe the hard drive.

img_0884

It was certainly time to have this machine leave the house, as I didn’t even own a keyboard that fit into the old AT plug at the back.  Luckily (some would argue) I’ve got an AT keyboard stashed in my office at work.

Once I showed up at work with a PC that was needing to be recycled, several others came out of the woodwork.  The result was quite a pile which we managed to cram into Trent’s Smart Car obeying the unwritten rule that lunch trips should be done using the most dangerous transport possible.

smartYup, 5 desktop PCs and a 9lb Dell laptop in a black bag – and both Trent and myself fit in there too.

It turns out the the local eWaste rules are about to change.  We took this pile of stuff by ComputerRecyclers which used to have a really nifty store where you could browse around in the still useful but old parts – but it turns out they have no storefront anymore.  Another local recycler has a better description of what is about to happen as of the start of April, and apparently the new rules prevent them from running an outlet store.  The good news here is that they will be apparently taking back a wider range of items, all at no cost (even monitors).

I suspect most people didn’t bother to read through all of this nostalgia – but if you did, take a moment to think about all the cool hardware you’ve had pass through your hands over the years and if you’re so inclined, post a comment about it.  Also, if you happen to have old electronic hanging around – please take the extra time to dispose of them properly so they don’t end up in the landfill.