<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2014-01-23T22:18:38Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>pnacl vs Debian Jessie</title>
<issued>2014-01-23T22:18:38Z</issued>
<modified>2014-01-23T22:18:38Z</modified>
<id>https://gamma.unpythonic.net/01390515518</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01390515518"/>
<content type="text/html" mode="escaped">

If you get an error like
&lt;pre &gt;
** Signal 6 from trusted code: pc=2abee0b751e5
&lt;/pre&gt; when building pnacl software then it may be because your &lt;tt &gt;/run/shm&lt;/tt&gt; is
mounted noexec.  You can fix it (for your current boot only) with: &lt;tt &gt;sudo
mount -o remount,exec /run/shm
&lt;/tt&gt;
As /run/shm is not mounted from /etc/fstab, I'm unsure how to make a durable fix.

&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/naclports/issues/detail?id=90#c6&quot;&gt;Related naclports bug&lt;/a&gt;
</content>
</entry>
<entry>
<title>Benchmarking ungeli on real data</title>
<issued>2013-12-13T23:26:29Z</issued>
<modified>2013-12-13T23:26:29Z</modified>
<id>https://gamma.unpythonic.net/01386977189</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01386977189"/>
<content type="text/html" mode="escaped">

Since the goal of &lt;a href=&quot;https://gamma.unpythonic.net/01385778545&quot;&gt;this little project&lt;/a&gt; is to actually
read my geli-encrypted zfs filesystems on a Linux laptop, I had to get a USB
enclosure that supports drives bigger than 2TB; I also got a model which
supports USB 3.0.  The news I have is:

&lt;p&gt;Ungeli and zfs-on-linux work for this task.  I was able to read files and
verify that their content was the same as on the Debian kFreeBSD system.

&lt;p&gt;The raw disk I tested with (WDC WD30 EZRX-00DC0B0) gets ~155MiB/s at the start,
~120MiB at the middle, and ~75MiB/s at the end of the first partition according
to zcav.  Even though ungeli has had no serious attempt at optimization, it
achieves over 90% of this read rate when zcav is run on &lt;tt &gt;/dev/nbd0&lt;/tt&gt; instead
of &lt;tt &gt;/dev/sdb1&lt;/tt&gt;, up to 150MiB/s at the start of the device while consuming
about 50%CPU.

&lt;p&gt;(My CPU does have AES instructions but I don't know for certain whether my
OpenSSL uses them the way I've written the software.  I do use the envelope
functions, so I expect that it will.  &amp;quot;openssl speed -evp aes-128-xts&amp;quot; gets
over 2GB/s on 1024- and 8192-byte blocks)

&lt;p&gt;Unfortunately, zfs read speeds are not that hot.  Running md5sum on 2500 files
totalling 2GB proceeded at an average of less than 35MB/s.  I don't have a
figure for this specific device when it's attached to (k)FreeBSD via sata, but
I did note that the same disk scrubs at 90MB/s.  On the other hand, doing a
similar test on my kFreeBSD machine (but on the raidz pool I have handy, not a
volume made from a single disk) I also md5sum at about 35MB/s, so maybe this is
simply what zfs performance is.

&lt;p&gt;All in all, I'm simply happy to know that I can now read my backups on either
Linux or (k)FreeBSD.
</content>
</entry>
<entry>
<title>Decrypting geli volumes with portable software</title>
<issued>2013-11-30T02:29:05Z</issued>
<modified>2013-11-30T02:29:05Z</modified>
<id>https://gamma.unpythonic.net/01385778545</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01385778545"/>
<content type="text/html" mode="escaped">

The geli infrastructure is strongly linked with FreeBSD and I didn't discover
any documentation of the data formats.  So, in the wake of my 
&lt;a href=&quot;https://gamma.unpythonic.net/01385346693&quot;&gt;concerns about being able to read backups on Linux&lt;/a&gt;
I read a lot of freebsd source code and now I've written a portable (I hope)
userspace program which can decrypt at least a toy geli-encrypted volume.

&lt;p&gt;It's called &lt;a href=&quot;https://github.com/jepler/ungeli&quot;&gt;ungeli&lt;/a&gt; and I'm going
to try letting it live on github instead of a personal git repo.  So far it's a
toy in that I've only tested it on a toy volume, the performance is not tuned, but
it does seem to work and due to is smallness (&amp;lt;600SLOC at present) it may be a
useful second reference if you too wish to understand geli.

&lt;p&gt;&lt;b&gt;Update&lt;/b&gt;: I added nbd support and squashed some bugs.  Now I've
succeeded in retrieving files from a geli-encrypted zfs volume on Linux
using zfs-on-linux:
&lt;pre&gt;
# ./ungeli -j geli-passfile npool.img /dev/nbd0 &amp;
# zpool import -d /dev -o readonly=on npool      # (imports /dev/nbd0)
# cat /npool/example/GPL-3
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc.  &amp;lt;http://fsf.org/&amp;gt;
...
&lt;/pre&gt;

</content>
</entry>
<entry>
<title>Encrypted ZFS for off-site backups</title>
<issued>2013-11-25T02:31:33Z</issued>
<modified>2013-11-25T02:31:33Z</modified>
<id>https://gamma.unpythonic.net/01385346693</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01385346693"/>
<content type="text/html" mode="escaped">
As I &lt;a href=&quot;https://gamma.unpythonic.net/01381324272&quot;&gt;recently discussed&lt;/a&gt;,
I use zfs replication for my off-site backups, manually moving volumes
from my home to a second location on a semi-regular schedule.

&lt;p&gt;Of course, I would rather that if one of these drives were stolen or lost
that the thief not have a copy of all my data.  Therefore, I use &lt;a href=&quot;http://en.wikipedia.org/wiki/Geli_%28software%29&quot;&gt;geli&lt;/a&gt; to encrypt
the entire zpool.</content>
</entry>
<entry>
<title>My ZFS replication script</title>
<issued>2013-10-09T13:11:12Z</issued>
<modified>2013-10-09T13:11:12Z</modified>
<id>https://gamma.unpythonic.net/01381324272</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01381324272"/>
<content type="text/html" mode="escaped">

On my &lt;a href=&quot;https://gamma.unpythonic.net/debian-kfreebsd-zfs&quot;&gt;new Debian GNU/kFreeBSD system&lt;/a&gt;, my
backup strategy has changed.
On the previous system, I relied on incremental dumps and a DAT160 tape
drive, which has an 80GB uncompressed capacity.  When you have a few
hundred gigabytes of photos to back up, this is an inconvenient
solution.  On the new system, I am using multiple removable 3TB hard
drives and a set of scripts built around zfs send/receive.

&lt;p&gt;Cron runs the &lt;tt &gt;rep.py&lt;/tt&gt; script 4 times a day, which does a &lt;tt &gt;zfs
send | zfs receive&lt;/tt&gt; pipeline for each filesystem to be backed up.  On a
semi-regular basis (I haven't yet decided on what schedule to do this
on; with tape backups I did it less than once a month even though it was
comparatively easier), I remove the drive to an off-site location,
return the other drive from off-site, and insert it.  (There's also
fiddling with &lt;tt &gt;zpool import/export&lt;/tt&gt;, of course)

&lt;p&gt;The &lt;tt &gt;rep.py&lt;/tt&gt; script relies on the &lt;tt &gt;zfs&lt;/tt&gt; python module, also of my
own creation.  This module has facilities for inspecting and interacting
with zfs filesystems, e.g., to list filesystems and snapshots, to create
and destroy snapshots, and to run replication pipelines.

&lt;p&gt;The &lt;tt &gt;rep.py&lt;/tt&gt; script needs to be customized for your system.
Customization items are:

&lt;p&gt;&lt;pre &gt;
TARGETS = ['bpool', 'cpool']
SRCS = ['mpool', 'rpool']
&lt;/pre&gt;

&lt;p&gt;&amp;quot;SRCS&amp;quot; is a list of zpools which are replicated.  &amp;quot;TARGETS&amp;quot; is a list of
zpools to which backups are replicated.  The first available pool out of
TARGETS is chosen. (so if more than one TARGET is inserted, only one
will ever be used)

&lt;p&gt;You can designate individual filesystems as not replicated by setting
the user property net.unpy.zreplicator:skip to the exact string &amp;quot;1&amp;quot;,
i.e.,
&lt;pre &gt;zfs set net.unpy.zreplicator:skip=1 examplepool/junkfiles&lt;/pre&gt;

&lt;p&gt;&lt;p&gt;&lt;b&gt;Files currently attached to this page:&lt;/b&gt;
&lt;table cellpadding=5 style=&quot;width:auto!important; clear:none!important&quot;&gt;&lt;col&gt;&lt;col style=&quot;text-align: right&quot;&gt;&lt;tr bgcolor=#eeeeee&gt;&lt;td&gt;&lt;a href=&quot;https://media.unpythonic.net/emergent-files/01381324272/rep.py&quot;&gt;rep.py&lt;/a&gt;&lt;/td&gt;&lt;td&gt;1.5kB&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor=#dddddd&gt;&lt;td&gt;&lt;a href=&quot;https://media.unpythonic.net/emergent-files/01381324272/zfs.py&quot;&gt;zfs.py&lt;/a&gt;&lt;/td&gt;&lt;td&gt;12.7kB&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;

&lt;p&gt;License: GPLv2+
</content>
</entry>
<entry>
<title>More new hardware: Lenovo Thinkpad T530</title>
<issued>2013-04-04T12:50:30Z</issued>
<modified>2013-04-04T12:50:30Z</modified>
<id>https://gamma.unpythonic.net/01365079830</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01365079830"/>
<content type="text/html" mode="escaped">
My old laptop, a &lt;a href=&quot;https://gamma.unpythonic.net/dell-d830&quot;&gt;Dell Latitude D830&lt;/a&gt;, was just shy of 5
years old, and I
decided the time was right to buy a new laptop.  So far, so good.</content>
</entry>
<entry>
<title>GPG Key</title>
<issued>2013-04-02T14:15:09Z</issued>
<modified>2013-04-02T14:15:09Z</modified>
<id>https://gamma.unpythonic.net/01364912109</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01364912109"/>
<content type="text/html" mode="escaped">
I've been spending some time working on Debian stuff, particularly packaging
and porting for Debian kFreeBSD.  Some time in the future I might wish to
become a Debian Maintainer, and a step along the way is to begin using a GPG
key.

&lt;p&gt;To that end, here's the fingerprint of my key, which is also uploaded to
sks-keyservers.net:</content>
</entry>
<entry>
<title>New hardware</title>
<issued>2012-12-10T20:21:23Z</issued>
<modified>2012-12-10T20:21:23Z</modified>
<id>https://gamma.unpythonic.net/01355170883</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01355170883"/>
<content type="text/html" mode="escaped">

I'm in the process of setting up a new machine to be a home server.  I'll
include more boring details about this &lt;a href=&quot;https://gamma.unpythonic.net/debian-kfreebsd-zfs&quot;&gt;here&lt;/a&gt;.
Trust me, it's pretty dry reading.
</content>
</entry>
</feed>
