<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ClearChain &#187; Projects</title>
	<atom:link href="http://www.clearchain.com/blog/categories/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://www.clearchain.com/blog</link>
	<description>-= Daily Happenings =-</description>
	<lastBuildDate>Wed, 05 Oct 2011 23:02:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Project Snappy</title>
		<link>http://www.clearchain.com/blog/posts/project-snappy</link>
		<comments>http://www.clearchain.com/blog/posts/project-snappy#comments</comments>
		<pubDate>Fri, 06 Mar 2009 01:12:37 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[UniSA]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snappy]]></category>
		<category><![CDATA[wcl]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=305</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/project-snappy"><img align="left" hspace="5" width="150" src="http://wcl.ml.unisa.edu.au/~snappybackup/images/2010/06/23/1526.jpg" class="alignleft wp-post-image tfe" alt="" title="Snappys Photos" /></a>One project I&#8217;ve been working on with fellow members of the Wearable Computer Lab (WCL) has been a project we&#8217;ve called &#8216;Snappy&#8217;. Snappy is simply an old Canon IXUS camera that is connected to an old Dell Laptop. It was setup to monitor the construction of a new building here at the University of South<a href="http://www.clearchain.com/blog/posts/project-snappy"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://wcl.ml.unisa.edu.au/~snappybackup/images/2010/06/23/1526.jpg"><img class="alignleft" style="border: 1px solid black;" title="Snappys Photos" src="http://wcl.ml.unisa.edu.au/~snappybackup/images/2010/06/23/1526.jpg" alt="" width="230" height="200" /></a>One project I&#8217;ve been working on with fellow members of the <a href="http://wcl.ml.unisa.edu.au">Wearable Computer Lab (WCL)</a> has been a project we&#8217;ve called <em>&#8216;Snappy&#8217;. </em>Snappy is simply an old Canon IXUS camera that is connected to an old Dell Laptop. It was setup to monitor the construction of a new building here at the <a href="http://unisa.edu.au">University of South Australia</a>. The building will be used for a number of things but in particular it will host the Visualisation Lab used by the WCL.</p>
<p>Snappy was something setup so the lab could see how construction was going and also so we could have some time lapse photography about the building being built.</p>
<p>Ironically, it appears that Snappy has grown. The VC of the Uni checks it, the architechs in Canberra are using it to monitor progress and a lot of the people involved are using it!</p>
<p>You see snappy consist of the camera and a web frontend to the photos snappy has taken. The frontend is a bunch of PHP scripts created by myself (Benjamin Close), Aaron Stafford, Ross Smith and Micheal Marner. Each one of us has worked on a part of either the scripts, the hardware or getting things working. Robert Speedie has been a big help in making this work as well. He has the contacts and funding to help it happen.</p>
<p>So if your interested in seeing Snappy, visit the url:</p>
<ul>
<li><a href="http://wcl.ml.unisa.edu.au/~snappybackup/">http://wcl.ml.unisa.edu.au/~snappybackup/</a></li>
</ul>
<p>and have a look. One of the photos he&#8217;s taken is below &#8211;  a great sunrise.</p>
<p style="text-align: center;"><a href="http://wcl.ml.unisa.edu.au/~snappybackup/images/2010/06/23/1526.jpg"><img class="aligncenter" title="Sunrise Snappy Style" src="http://wcl.ml.unisa.edu.au/~snappybackup/images/2010/06/23/1526.jpg" alt="" width="280" height="250" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/project-snappy/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LDAPAddressBook</title>
		<link>http://www.clearchain.com/blog/posts/ldapaddressbook</link>
		<comments>http://www.clearchain.com/blog/posts/ldapaddressbook#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:45:41 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=108</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/ldapaddressbook"><img align="left" hspace="5" width="150" src="http://www.clearchain.com/blog/images//2008/11/LDAPAB_stage_1-150x150.png" class="alignleft wp-post-image tfe" alt="LDAPAB_stage_1" title="LDAPAB_stage_1" /></a>LDAP is a great protocol. It allows multiple clients to obtain data about virtually anything that you can think of. The LDAPAddressBook project is a project to determine a LDAP Schema that works in the following clients: Mozilla Thunderbird Windows Address Book OS X Address Book Squirrel Mail In fact any client that supports LDAP.<a href="http://www.clearchain.com/blog/posts/ldapaddressbook"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>LDAP is a great protocol. It allows multiple clients to obtain data about virtually anything that you can think of. The LDAPAddressBook project is a project to determine a LDAP Schema that works in the following clients:</p>
<ul>
<li> Mozilla Thunderbird</li>
<li> Windows Address Book</li>
<li> OS X Address Book</li>
<li> Squirrel Mail</li>
</ul>
<p>In fact any client that supports LDAP.</p>
<p><span id="more-108"></span></p>
<p>By determining this schema, ClearChain can finally have a &#8216;go anywhere&#8217; addressbook.</p>
<p><script type="text/javascript">// <![CDATA[
  if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }
// ]]&gt;</script></p>
<h2><span class="editsection"> </span> <span class="mw-headline">Conceptual Layout </span></h2>
<h3><span class="editsection"> </span><span class="mw-headline">Stage 1</span></h3>
<p><a href="http://www.clearchain.com/blog/images//2008/11/LDAPAB_stage_1.png"><img class="aligncenter size-thumbnail wp-image-628" title="LDAPAB_stage_1" src="http://www.clearchain.com/blog/images//2008/11/LDAPAB_stage_1-150x150.png" alt="LDAPAB_stage_1" width="150" height="150" /></a></p>
<p>The idea is that everything is stored in a database. Databases are great for storing and manipulating information. Currently we use a MySQL database. Data is extracted from the database in xml format. This is actually ridiculously easy. MySQL (on the command line at least) supports output formats of xml. On the command line when connecting to the database you just throw in a &#8211;xml flag, for example:</p>
<pre>mysql --xml -u frank -p</pre>
<p>Then when you get any text back from any queries you run the results will be wrapped in xml. Even commands such as:</p>
<pre>mysql&gt; show databases;</pre>
<p>will return results marked up with xml, for example:</p>
<pre>&lt;?xml version="1.0"?&gt;

&lt;resultset statement="show databases;"&gt;
  &lt;row&gt;
        &lt;field name="Database"&gt;information_schema&lt;/field&gt;
  &lt;/row&gt;

  &lt;row&gt;
        &lt;field name="Database"&gt;addressbook&lt;/field&gt;
  &lt;/row&gt;

  &lt;row&gt;
        &lt;field name="Database"&gt;budget&lt;/field&gt;
  &lt;/row&gt;

  &lt;row&gt;
        &lt;field name="Database"&gt;dinner&lt;/field&gt;
  &lt;/row&gt;

  &lt;row&gt;
        &lt;field name="Database"&gt;mysql&lt;/field&gt;
  &lt;/row&gt;

  &lt;row&gt;
        &lt;field name="Database"&gt;wiki_thesis&lt;/field&gt;
  &lt;/row&gt;
&lt;/resultset&gt;</pre>
<p>This is awesome because it means that we can easily convert the xml into any format that we want in particular an LDAP schema that Thunderbird understands, an LDAP schema that Outlook understands, but also just as easily HTML, XHTML, plain text&#8230; you name it the xml can be converted to it simply with an xml transformation.</p>
<p>In the case of an LDAP server once the XML has been converted to the appropriate format existing LDAP data is blown away and then replaced by the new schema.</p>
<p><strong>NOTE:</strong> Through php the mysql calls do not support fetch results in xml format, except via an extension. For this reason I wrote a simple method that wraps the mysql like xml around the data set returned via the usual query call.</p>
<h3><span class="editsection"> </span><span class="mw-headline">Stage 2</span></h3>
<p><a href="http://www.clearchain.com/blog/images//2008/11/LDAPAB_stage_2.png"><img class="aligncenter size-thumbnail wp-image-629" title="LDAPAB_stage_2" src="http://www.clearchain.com/blog/images//2008/11/LDAPAB_stage_2-150x150.png" alt="LDAPAB_stage_2" width="150" height="150" /></a></p>
<p>The second stage of this project is to provide the various email clients and addressbooks with the ability to add and modify contacts in the database. This is more of a pipe dream at the moment, but should be relatively straight forward with an email client such as Thunderbird.</p>
<h2><span class="editsection"> </span><span class="mw-headline"> LDAP Schema </span></h2>
<p>This section details the various fields used by different applications for the address book. I&#8217;ve tried to map the fields to the official ldap schemas that exist. A full list that are supported by thunderbird is available at:  <a class="external free" title="http://www.mozilla.org/projects/thunderbird/specs/ldap.html" rel="nofollow" href="http://www.mozilla.org/projects/thunderbird/specs/ldap.html">http://www.mozilla.org/projects/thunderbird/specs/ldap.html</a></p>
<p>There is however a lot of undocumented mozilla/thunderbird specific attributes. <a href="http://www.pro-linux.de/t_office/mozilla_op20.schema">http://www.pro-linux.de/t_office/mozilla_op20.schema</a></p>
<p>Documents a complete mozilla schema but is yet to be tested</p>
<table style="border: 1px solid #aaaaaa; margin: 1em 1em 1em 0pt; background: #f9f9f9 none repeat scroll 0% 0%; border-collapse: collapse;" border="2" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<th> LDAP Schema</th>
<th> Field</th>
<th> Thunderbird</th>
<th> Outlook Express</th>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>givenName</td>
<td>Firstname</td>
<td></td>
</tr>
<tr>
<td>person</td>
<td>sn</td>
<td>Lastname</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>displayName</td>
<td>Display</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaNickname</td>
<td>Nickname</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>mail</td>
<td>Email</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaSecondEmail</td>
<td>Additional Email</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaUseHtmlMail</td>
<td>Prefers to receive message formated as</td>
<td></td>
</tr>
<tr>
<td></td>
<td>-</td>
<td>Screen Name</td>
<td></td>
</tr>
<tr>
<td>2.5.4.20(M)</td>
<td>telephoneNumber</td>
<td>Work (Phone)</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>homePhone</td>
<td>Home (Phone)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.23</td>
<td>faximileTelephoneNumber</td>
<td>Fax</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>pager</td>
<td>Pager</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>mobile</td>
<td>Mobile</td>
<td></td>
</tr>
<tr>
<td></td>
<td>-</td>
<td>Address (Ln1 HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomePostalAddress2</td>
<td>Address (Ln2 HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomeLocalityName</td>
<td>City (HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomeState</td>
<td>State/Provice(HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomePostalCode</td>
<td>Zip/Postal Code(HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomeCountryName</td>
<td>Country(HM)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaHomeUrl</td>
<td>Web Page(HM)</td>
<td></td>
</tr>
<tr>
<td>organizationPerson</td>
<td>title</td>
<td>Title (Wk)</td>
<td></td>
</tr>
<tr>
<td>inetOrgPerson</td>
<td>departmentNumber</td>
<td>Department (WK)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.10</td>
<td>o</td>
<td>Organization(Wk)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.18</td>
<td>postOfficeBox</td>
<td>Address (Ln1 Wk)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaPostalAddress2</td>
<td>Address (Ln2 Wk)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.7</td>
<td>l</td>
<td>City (Wk)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.8</td>
<td>st</td>
<td>State/Provice(Wk)</td>
<td></td>
</tr>
<tr>
<td>2.5.4.17</td>
<td>postalCode</td>
<td>Zip/Postal Code(Wk)</td>
<td></td>
</tr>
<tr>
<td></td>
<td>-</td>
<td>Country (Wk)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaWorkUrl</td>
<td>Web Page (Wk)</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaCustom1</td>
<td>Custom 1</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaCustom2</td>
<td>Custom 2</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaCustom3</td>
<td>Custom 3</td>
<td></td>
</tr>
<tr>
<td>mozillaAbPersonObsolete</td>
<td>mozillaCustom4</td>
<td>Custom 4</td>
<td></td>
</tr>
<tr>
<td></td>
<td>-</td>
<td>Custom 5</td>
<td></td>
</tr>
<tr>
<td>2.5.4.13</td>
<td>description</td>
<td>Notes</td>
<td></td>
</tr>
</tbody>
</table>
<h2><span class="editsection"> </span><span class="mw-headline"> OpenLdap </span></h2>
<p>In order to use create a schema for openldap that works for at least Thunderbird, download the schema linked above then make sure you have the following lines in your slapd.conf</p>
<pre>include         /usr/local/etc/openldap/schema/core.schema

# Add additional schema
include                 /usr/local/etc/openldap/schema/cosine.schema
include                 /usr/local/etc/openldap/schema/inetorgperson.schema
include                 /usr/local/etc/openldap/schema/mozilla_op20.schema</pre>
<h1><span class="editsection"> </span><span class="mw-headline">Contributors</span></h1>
<p><a class="external text" title="http://wcl.ml.unisa.edu.au/~staffora/index.php/Aaron_Stafford" rel="nofollow" href="http://www.hog3d.net/aaron.html">Aaron Stafford</a> has written a substantial amount of code for this project, including:</p>
<ul>
<li>HTML front end which communicates with the the database over PHP</li>
<li>XSL transformation that converts XML extracted from the database into the openldap ready text</li>
</ul>
<h2><span class="editsection"> </span><span class="mw-headline">Code Access</span></h2>
<p>Access to the code is currently restricted, but hopefully this will become a public upon request. If you are interested in seeing this project become public please drop us a line.</p>
<pre>git clone username@git.clearchain.com:/export/git/projects/ldapab</pre>
<p>On the mac you have to specify where you want it checked out to so use:</p>
<pre>git clone username@git.clearchain.com:/export/git/projects/ldapab ldapab</pre>
<p>If you are on a mac. It might be the case that you need to do this on any platform. I haven&#8217;t tested it anywhere else though.</p>
<h1><span class="editsection"> </span><span class="mw-headline">External Links</span></h1>
<p><a class="external free" title="http://www.plaxo.com/" rel="nofollow" href="http://www.plaxo.com/">http://www.plaxo.com/</a> &#8211; Plaxo is an interesting application. It lets you sync a whole bunch of different address books and calendar information from different application and online accounts. I have not used this but it appears to be a near perfect solution if you are prepared to hand over your usernames and passwords to another company. ldapab is designed to be managed by the person looking after their own contacts, not having someone else manage it for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/ldapaddressbook/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BGmailFS</title>
		<link>http://www.clearchain.com/blog/posts/bgmailfs</link>
		<comments>http://www.clearchain.com/blog/posts/bgmailfs#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:35:27 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[filesystems]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=102</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/bgmailfs"><img align="left" hspace="5" width="150" src="http://www.clearchain.com/blog/images//2008/11/bgmailfs-300x140.jpg" class="alignleft wp-post-image tfe" alt="bgmailfs" title="bgmailfs" /></a>This page documents a concept that was discussed between a number of members of the Wearable Computer Lab. As such we&#8217;ve not investigated whether the concept is in violation of the gmail usage terms and conditions. Hence please consider below nothing but an idea for now. If you have questions about this or would like<a href="http://www.clearchain.com/blog/posts/bgmailfs"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>This page documents a concept that was discussed between a number of members of the <a class="external text" title="http://wearables.unisa.edu.au" rel="nofollow" href="http://wearables.unisa.edu.au/">Wearable Computer Lab</a>. As such we&#8217;ve not investigated whether the concept is in violation of the gmail usage terms and conditions. Hence please consider below nothing but an idea for now. If you have questions about this or would like to implement it, please contact <a class="new" title="Benjamin" href="http://www.clearchain.com/blog/people/benjamin-close">Me</a>.</p>
<p><span id="more-102"></span></p>
<p><span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br />
</span></p>
<h1><span class="mw-headline">Background </span></h1>
<p>With the growing amount of personal data every person is starting to accumulate, one of the biggest problems lies in how to back the data up. The introduction of cheap broadband has made network bandwidth relatively quick, and also affordable. However, despite this, backups require disk space in alternative locations. With Google <sup>[1]</sup> now offering 3GB gmail<sup>[2]</sup> email accounts, one possibility is to backup your data in your email.</p>
<p>However emailing files to yourself in not only cumberson but also very error prone. Also with a maximum size limit <sup>[3]</sup> smaller than a number of files you may want to backup, things become even more complex. As a user you would have to send multiple emails, all containing sections of a file</p>
<h1><span class="mw-headline">Introducing the Backup Gmail FS </span></h1>
<p>Early on after the creation of gmail based filesystem<sup>[4]</sup> using a fuse <sup>[5]</sup>, I got to thinking gmail could be used to backup data via a file system.</p>
<p>The problem with the existing GMail FS is doesn&#8217;t deal with redundancy, has issues with large files, puts all the data content in one place and is limited to the size of 1 gmail account.</p>
<p><em>Backup Gmail FS</em> (BGMailFS for short) is the next step up. The aim of it is to feature:</p>
<ul>
<li> data redundancy</li>
<li> data security</li>
<li> self sizing filesystem</li>
<li> no limit on file size</li>
</ul>
<p>Each of these are detailed below.</p>
<h2><span class="mw-headline">Data Redundancy </span></h2>
<p>Considering this is aimed at storing backups, Data Redundancy is of prime consideration. As such taking some sort of approach where CRC&#8217;s of data is stored is important. Ideally spreading the data across multiple accounts in some time of mirror, or striped set.</p>
<h2><span class="mw-headline">Data Security </span></h2>
<p>The one problem to backup up to Google, is how much do you trust them? Whilst I know there motto is: <em>Don&#8217;t Be Evil</em> <sup>[6]</sup> I can&#8217;t help thinking that a giant company might take a sneak peak at my data. Since the data is backups, it could very well be IP sensitive.</p>
<p>Hence to combat this, using a method like the one describe in the <strong>Information Dispersal Algorithm</strong> (IDA)  <sup>[7]</sup> <sup>[8]</sup> proposed by Micheal Rabin in 1989, would enable us to distribute the data and also keep it secure. Though it does rely on the fact that various bits of data stored in different accounts are never pieced together (though encryption could help out there).</p>
<h2><span class="mw-headline">Self Sizing Filesystem </span></h2>
<p>One thing that would be great is to have the filesystem automatically grow when it&#8217;s size reaches a certain point. This is quite possible using gmail accounts. All you have to do is register another account and add it to the file system.</p>
<h2><span class="mw-headline">No Limit on File Size </span></h2>
<p>The one thing you don&#8217;t want is to only be able to have 20M max files in the file system. Hence the implementation must accommodate files of any size.</p>
<h1><span class="mw-headline">Possible Implementation </span></h1>
<p>With the idea embedded, it now comes down to how would you go about implementing something like this.</p>
<p>With the advent of ZFS<sup>[9]</sup> under FreeBSD things suddenly became much more possible.</p>
<h2><span class="mw-headline">ZFS, FreeBSD &amp; Geom </span></h2>
<p>ZFS is a great filesystem / logical volume manager. It supports resizing of the file system on the fly, software based parity &amp; double parity, read checksums, caching and compression. This makes it perfect for use as the frontend to the BGmailFS.</p>
<p>FreeBSD has had the ZFS fs ported to it by pjd. It&#8217;ll be an experimental feature in FreeBSD 7.0 and hopefully a fully fledged FS in 7.1. ZFS on FreeBSD to make use of the Geom storage system.</p>
<p>Geom is abstraction of the block devices available to the operating system. It consists of consumers and producers. A consumer makes use of a geom device. Ie a filesystem consumes a geom device. A producer provides the infrastructure for a consumer to write blocks.</p>
<p>Now under FreeBSD a zpool (the lvm size of zfs) is both a geom producer and a geom consumer. It consumes disks. It produces a storage pool.</p>
<h2><span class="mw-headline">Putting Things together </span></h2>
<p>So the question becomes how can we make use of zfs to provide the file system front end and somehow provide the backend which talks to gmail. The diagram below gives some insight to how this could fit together.</p>
<p><a href="http://www.clearchain.com/blog/images//2008/11/bgmailfs.jpg"><img class="size-medium wp-image-393 alignnone" title="bgmailfs" src="http://www.clearchain.com/blog/images//2008/11/bgmailfs-300x140.jpg" alt="bgmailfs" width="300" height="140" /></a><br />
The key behind the design is the the use of geom to map a gmail account to a geom producer. This can then be used with a ZFS ZPool to let zfs do most of the work.</p>
<p>The concept is simple. Someone implements</p>
<ul>
<li> The BGFSDeamon</li>
<li> The BGFSDriver</li>
<li> The BGFSCommand</li>
</ul>
<p>These all work together to end up giving the user a redunant file system.</p>
<h3><span class="mw-headline">BGFSDeamon </span></h3>
<p>This Daemon is responsible for mapping low level disk requests in to the relevant gmail account commands. For instance, when a write is done to a &#8216;disk&#8217; the relevant block is considered an email in a gmail account. It can be written either via SMTP or now gmail supports imap <sup>[10]</sup>, via imap. For security of data. This block may be spread between multiple gmail account using the IDA algorithm. Like wise a read obtains all the relevant pieces of the data block from the known accounts and presents the disk block back to the BGFSDriver.</p>
<p>Communication between the driver and the Daemon happen vio ioctls, preferably creating a mmaped region that both can read for efficiency.</p>
<h3><span class="mw-headline">BGFS Driver </span></h3>
<p>The driver is actually fairly simple. It works similar to how the fuse driver works but at a block level rather than a file system level. Ie every block request the driver gets to read/write a block, it passes via the device file back to the BGmailDeamon. The driver is really just a translation layer!</p>
<h3><span class="mw-headline">BGFSCommand </span></h3>
<p>This BGFSCommand is a command line tool that can be used for adding more space (ie more accounts), checking network communications or retiring accounts. It talks to the BGFSDeamon which actually does the work. Consider it like what <em>apachectl</em> is to <em>apache</em>.</p>
<h1><span class="mw-headline">After thoughts / Conclusion </span></h1>
<p>It&#8217;s ironic that after writing this page, there is many other possibilities that exist for BGmailFS. With most of the work done in the daemon, it&#8217;s entirely plausable that this same system could work with hotmail, yahoo or for that matter a separate daemon that listens on another machine somewhere. This may make even more sense as many people now run servers 24&#215;7 behind their broadband connection. Many of them have the same problem of how to backup their data securely.</p>
<p>Perhaps they could run one daemon, one kernel module and then it just works!</p>
<h1><span class="mw-headline">References </span></h1>
<ol class="references">
<li id="_note-0">↑ <a class="external free" title="http://google.com" rel="nofollow" href="http://google.com/">http://google.com</a></li>
<li id="_note-1">↑ <a class="external free" title="http://www.gmail.com" rel="nofollow" href="http://www.gmail.com/">http://www.gmail.com</a></li>
<li id="_note-2">↑ http://mail.google.com/support/bin/answer.py?answer=6589</li>
<li id="_note-3">↑ <a class="external free" title="http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html" rel="nofollow" href="http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html">http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html</a></li>
<li id="_note-4">↑ <a class="external free" title="http://fuse.sourceforge.net/" rel="nofollow" href="http://fuse.sourceforge.net/">http://fuse.sourceforge.net/</a></li>
<li id="_note-5">↑ <a class="external free" title="http://en.wikipedia.org/wiki/Don't_Be_Evil" rel="nofollow" href="http://en.wikipedia.org/wiki/Don't Be Evil">http://en.wikipedia.org/wiki/Don&#8217;t_Be_Evil</a></li>
<li id="_note-6">↑ <a class="external free" title="http://www.answers.com/topic/information-dispersal-algorithm" rel="nofollow" href="http://www.answers.com/topic/information-dispersal-algorithm">http://www.answers.com/topic/information-dispersal-algorithm</a></li>
<li id="_note-7">↑ <a class="external free" title="http://bryanmills.net/archives/2007/09/information-dispersal-algorithms/" rel="nofollow" href="http://www.cleversafe.org/dispersed-storage/idas">http://bryanmills.net/archives/2007/09/information-dispersal-algorithms/</a></li>
<li id="_note-8">↑ <a class="external free" title="http://www.opensolaris.org/os/community/zfs/" rel="nofollow" href="http://www.opensolaris.org/os/community/zfs/">http://www.opensolaris.org/os/community/zfs/</a></li>
<li id="_note-9">↑ <a class="external free" title="http://mail.google.com/support/bin/topic.py?topic=12760" rel="nofollow" href="http://mail.google.com/support/bin/answer.py?hl=en&#038;answer=75725">http://mail.google.com/support/bin/topic.py?topic=12760</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/bgmailfs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

