site geomag logo

December 03, 2003

Ok, I'm impressed (Captive Review)

Linux software generally has a reputation for having some great, novell ideas, but often lacking in the general 'spit and polish' - difficult to install, unreliable, and so on. However the latest program I have tried out - Captive, is a breath of fresh air - simple to install and set up, and It Just WorksTM. And not only that, it's probably one of the most useful and technically impressive projects I've seen in a long time ...

(I apolgise now for the condescending laymans speak / confusing technical babble - I was so impressed I felt the need to do a writeup of this program, and as such hope non-techies will appreciate the quality of Captive. anyway, I digress...)

What does it do?

You see, Captive allows Linux to read Windows format NTFS partitions. If you have a recent version of Windows installed on your hard drive (Win 2000 or XP), chances are it will store your files on disk in a format called NTFS. Linux stores it's files in a different format (comonly a format called ext3).

So What's the big deal?

These two formats (NTFS and ext3) are like two different languages, Japanese and German if you like. Now while the ext3 format is fully documented, NTFS is a proprioritary format invested by Microsoft, and so it is very difficult for other operating systems like Linux to understand it and read.

To give an example, imagine you are an english speaking person (difficult, I know), and you want to read a essay written in German. Now if you got hold of a German -> English dictionary, you could translate each word literally, and get the basic meaning of the essay. Now imagine the essay is in Japanese, and no-one will sell you a Japanese dictionary. Or offer to teach you Japanese. This is basically the problem faced when trying to read NTFS disks in Linux. The meaning of NTFS is only known by Microsoft, and although work has been made in being able to read NTFS, Linux cannot write files in NTFS format. (The language anology holds here: while you could probably work out what the Japanese essay said, given enough time and other pieces of writing that have already been translated from Japanese to English, writing it would be a much more difficult task)

So where does Captive fit in?

captive diagram
How it works

I said above that Linux can read NTFS files, but cannot write them. Well now it can, with the help of Captive. What captive basically does is allow Linux to use the Windows NTFS driver itself, so it can read and write NTFS disks.

To do this Captive has to do three things:

  1. Get a copy of the Windows NTFS driver
  2. Act like Windows so it can use the NTFS driver
  3. Pass the information it gets via the NTFS driver to Linux to use

The first of these tasks is achieved in quite a clever way - it uses the existing read only NTFS support in Linux to search the Windows hard disk for the driver files. This is relatively easy, but unlike many other Linux programs, Captive pretty much does this for you.

The second task is basically the hardest. Pretending to be Windows is very difficult; Windows is a huge and complex program, with over 40 Million lines of code in Windows XP. Fortunatly a number of other programs already go some of the way to pretending to be Windows, and so Captive's author's had a framework to start on. However a large amount of work was required to pull this all together - see the author's site for a technical description.

The net result is that Captive creates a mini-version of Windows running inside Linux. This mini-version of Windows (or a Sandbox to use the correct term) deals with the actual process of reading and writing the information from an NTFS disk, and then passes it to the normal Linux file handling functions. As Captive uses the 'real' NTFS driver, it's support for NTFS is complete.

If this is technical jargon is hurting your head, let's go back to our language analogy: Captive is basically kidnapping a Japanese-speaking person, getting them to read the Japanese essay, then taking the raw thoughts out of his brain so he can understand them (OK, my analogy is falling apart a bit, but it gives you an idea of the complexity of this program!).

So how is it so easy to use?

Well all you as a user of Captive have to do is install it, and run it's setup program. It does all the necessary searching for the NTFS driver, setting up it's Sandbox to talk to the Linux operating system, and even finds and makes available all NTFS disks you have on your PC. it literally took my 30 seconds from starting the install to browsing all my Windows files

Cool! So who wrote this then?

A single random guy called Jan Kratochvil, coding in his spare time.

Posted by Dave at December 3, 2003 11:35 PM | TrackBack
Comments

I was going to say:
"speaking for the non-techies, you lost use around: 'Captive allows Linux to read Windows format NTFS partitions'"
but then I actually read it and(unbelievable I know) I think I may have understood. Plus I really like the idea of pretending to be Windows.

But more importantly, where have the ten facts about you gone? And the little red dice? They were good. Are you inventing new, even more implausible facts?

Posted by Sarah at December 4, 2003 02:21 PM

Erm, they're still there - click on the About link at the top of the page

Posted by Dave at December 4, 2003 06:03 PM

actually. my version of about stops at "you can contact me at email/msn" (in the browser but not the source). admittedly i'm using a shite browser, but it happened in college too i think.

Posted by tara at December 4, 2003 11:13 PM

My problem exactly, right down to the quality of the browser at college.

Posted by Sarah at December 5, 2003 01:38 PM

Works fine in netscape... I hadn't noticed the dice before, they're cool.

Posted by Mike at December 5, 2003 02:04 PM

Oh, the joys of IE! - it worked fine in Mozilla, so I didn't spot what was basically a valid bit of HTML that IE doesn't like.... sigh

Posted by Dave at December 7, 2003 09:17 PM

They're back! Marvellous

Posted by Sarah at December 9, 2003 02:01 PM
Post a comment











Remember personal info?

Allowed HTML tags: <a href> <b> <br> <p> <strong> <em> <ul> <li> <blockquote>