Sunday, November 9, 2008

Browsing Time Machine backups

OS X Leopard Time MachineImage by antwanp via FlickrAlthough Time Machine is a fantastic consumer-targeted solution for backups whose simplicity is fantastic, it unfortunately has it's drawbacks. It saved me quite some time when my graphic card died but when I wanted to browse through my backups on another computer (in my case with Ubuntu 8.10), I was quite surprised over details of implementation.

It appers that although you can browse through your Users directory, you can't just dive into any subdirectory and copy the file you are looking for to your current computer.

What you have to do is this (thanks to Carson!):

You have to run command ls -l which returns something like this:

me@desktop:/media/disk/Backups.backupdb/Computer Name/Latest/Disk/Users/username$ ls -l

-r--r--r-- 9891110 root 10239884 0 2008-04-21 20:19 Applications
-r--r--r-- 9861491 root 10239885 0 2008-04-21 20:19 Desktop
-r--r--r-- 10192194 root 10239886 0 2008-04-21 20:19 Dev
-r--r--r-- 10197872 root 10239887 0 2008-04-21 20:19 Documents

Here you have to take notice of the number in italic formating (forget about the bold for now). This number normally represents the number of files in that directory but in case of Time Machine this number is a unique identifier. To really access your file, you have to go to the top level directory of you external hard drive and look for a directory .HFS+ Private Directory Data - note the . before the name because it is a hidden directory.

Then you can either run command ls in that directory (but it will take some time and you get a bunch of directories that tell you nothing of it's content) or you can just type cd dir_10192194 (in this case I decided to look into the latest content of directory Dev that is printed in bold font before) that correctly lists all files in it. Note that if you want to go to a subdirectory, you again have to repeat the process and reference it in .HFS+ Private Directory Data.

Therefore restoring to a Windows/Linux system is possible, it's just not something you really want to be doing (especially to restore a large number of files). For that I would probably write a Python script or a new bash command (cdtm as in change directory time machine) to ease the pain of constantly checking which directory you have to go into to find your files.

Which could be a nice little project after I get my Macbook Pro back...

Reblog this post [with Zemanta]

When your Macbook Pro's graphic card dies

Time Machine (Apple software)Image via WikipediaAs it was noted in major publications several times already, NVidia made quite a mistake when they produced N84/N86 graphic cards with faulty parts. So when I became an early adopter and bought myself a Macbook Pro in July of 2007, I was also given one of these graphic cards and until now it's performance was nothing but breath taking. Unfortunately it appers that my usage patterns (probably a bit above-average carrying around, but not everyday) have finally brought it to it's knees and on Friday evening it died.

Since in Slovenia we can't use Apple Care I was more than pleased when Apple announced that they will be extending the warranty for their graphic cards to two years - I was just a month or so over warranty.

With my mind at rest about possible costs of repair I decided it was time to see how can I make the newest backup of the data on the hard drive. Since I could clearly see that my MBP successfully log-ins and connect to my home WI-FI network (broadcasting ping helped with that - ping -b 192.168.1.255), my first thought was that I should use SSH to log into the computer and then begin the painful process of copying somewhere around 100GB of data over 802.11G WI-FI and to the USB hard drive. But this didn't work because I have closed port 22 for SSH. For a laptop, that seemed quite reasonable at the time.

After discussing options like taking disk out and use converter for SATA/IDE-to-USB to plug it into other computer, mounting my MBP as target disk on my friend's Mac, etc., I was finally struck with divine inspiration - "If it can connect to WI-FI then obviously everything starts as normal, therefore I can just use Time Machine". The second I thought about it I was thinking to myself "how couldn't I thought of that before"?

Few minutes on and Time Machine was happily making backups.

So remember kids: Use backup and use a backup solution that can do EVERYTHING on itself with no buttons like "Yes, make me a backup".
Reblog this post [with Zemanta]