<?xml version="1.0"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:res="http://blogreen.org/TR/Resources" xmlns:bgn="http://blogreen.org" bgn:template-name="rss" version="2.0"><channel><title>Romain Tartière's Blog</title><link>http://romain.blogreen.org/blog/</link><description>Mostly technical blog posts from Romain Tartière's Blog.</description><link xmlns="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://romain.blogreen.org/blog/rss-full.xml"/><item><title>Updating a ZFS Mirror</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">A few days ago, while I was on the phone, my machine experienced a kernel panic.  The backtrace pointed a problem somewhere in the swap management code.  I was on a hurry at that time and rebooted the machine without taking the time dig in the problem deeper.</p><p xmlns="http://www.w3.org/1999/xhtml">On the next day, I eventually realised that an hard disk was logically missing on the system and the ZFS mirror it was belonging to was working in a degraded mode.  This disk holding a swap partition, the panic quite makes sense: some data was stored there and could not be paged-out anymore.</p><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword"># zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
data   294G  68,2G   226G    23%  1.25x  <strong>DEGRADED</strong>  -
tank  1,81T   300G  1,52T    16%  1.06x  ONLINE  -</pre><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword"># zpool status data
  pool: data
 state: <strong>DEGRADED</strong>
<strong>status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q</strong>
  scan: none requested
config:

NAME                                            STATE     READ WRITE CKSUM
data                                            DEGRADED     0     0     0
  mirror-0                                      DEGRADED     0     0     0
    gptid/36711e52-a69e-11de-8adf-0018f38af467  ONLINE       0     0     0
    15152536002702365387                        <strong>UNAVAIL</strong>      0     0     0  <strong>was /dev/gptid/602da1ae-c474-11de-960d-0008a14dbca1</strong>

errors: No known data errors</pre><p xmlns="http://www.w3.org/1999/xhtml">This disk already had problems in the past and I even had to <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/158630">improve <tt>sysutils/smartmontools</tt> periodic script to take into account SMART attributes that have been failing at some point in the past but have recovered since that time</a> on that disk.  This time, the disk is <em>really</em> dead, so no other choice than changing it.  Hopefully, I have a brunch of spare heard disks on the shelve, so I took two 500 GB disks to replace the two 320 GB of the degraded ZFS pool.</p><p xmlns="http://www.w3.org/1999/xhtml">I first replaced the broken disk with a new one, identified it using <tt>geom(8)</tt> and partitioned using basically the same settings I used when <a href="http://romain.blogreen.org/blog/2009/10/updating-freebsd-7-i386-to-8-amd64/">installing FreeBSD on full-ZFS</a>:</p><pre xmlns="http://www.w3.org/1999/xhtml"># geom disk list ada1
Geom name: ada1
Providers:
1. Name: ada1
   Mediasize: 500107862016 (465G)
   Sectorsize: 512
   Mode: r2w2e3
   descr: ST3500418AS
   ident: (null)
   fwsectors: 63
   fwheads: 16

# geom part create -s GPT ada1
ada1 created
# geom part add -s 128 -t freebsd-boot ada1
ada1p1 added
# geom part add -s 4G -t freebsd-swap ada1
ada1p2 added
# geom part add -t freebsd-zfs ada1
ada1p3 added
# geom part show ada1
=&gt;       34  976773101  ada1  GPT  (465G)
         34        128     1  freebsd-boot  (64k)
        162    8388608     2  freebsd-swap  (4.0G)
    8388770  968384365     3  freebsd-zfs  (461G)

# geom part bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
bootcode written to ada1</pre><p xmlns="http://www.w3.org/1999/xhtml">I then replaced the unavailable ZFS partition with the new one:</p><pre xmlns="http://www.w3.org/1999/xhtml"># zpool replace data 15152536002702365387 ada1p3
Make sure to wait until resilver is done before rebooting.

If you boot from pool 'data', you may need to update
boot code on newly attached disk 'ada1p3'.

Assuming you use GPT partitioning and 'da0' is your new boot disk
you may use the following command:

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0</pre><p xmlns="http://www.w3.org/1999/xhtml">… waited a few moments for resilvering to finish:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword">% zpool status data
  pool: data
 state: DEGRADED
<strong>status: One or more devices is currently being resilvered.  The pool will
	continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Mon Jan  2 19:26:44 2012
    330M scanned out of 68,2G at 4,07M/s, 4h44m to go
    329M resilvered, 0,47% done</strong>
config:

	NAME                                            STATE     READ WRITE CKSUM
	data                                            DEGRADED     0     0     0
	  mirror-0                                      DEGRADED     0     0     0
	    gptid/36711e52-a69e-11de-8adf-0018f38af467  ONLINE       0     0     0
	    <strong>replacing-1</strong>                                 UNAVAIL      0     0     0
	      15152536002702365387                      UNAVAIL      0     0     0  was /dev/gptid/602da1ae-c474-11de-960d-0008a14dbca1
	      ada1p3                                    ONLINE       0     0     0  <strong>(resilvering)</strong>

errors: No known data errors</pre><p xmlns="http://www.w3.org/1999/xhtml">… then shut the system down, replaced the working 320 GB disk by a new 500 GB one and booted into FreeBSD again:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword">% zpool status data
  pool: data
 state: <strong>DEGRADED</strong>
<strong>status: One or more devices could not be opened.  Sufficient replicas exist for
	the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q</strong>
  scan: resilvered 68,2G in 1h58m with 0 errors on Mon Jan  2 21:25:42 2012
config:

	NAME                     STATE     READ WRITE CKSUM
	data                     DEGRADED     0     0     0
	  mirror-0               DEGRADED     0     0     0
	  3635039039460500206    <strong>UNAVAIL</strong>      0     0     0  was /dev/gptid/36711e52-a69e-11de-8adf-0018f38af467
	    ada1p3               ONLINE       0     0     0

errors: No known data errors</pre><p xmlns="http://www.w3.org/1999/xhtml">Same story with the other disk:</p><pre xmlns="http://www.w3.org/1999/xhtml">geom part create -s GPT ada0
ada0 created
# geom part add -s 128 -t freebsd-boot ada0
ada0p1 added
# geom part add -s 4G -t freebsd-swap ada0
ada0p2 added
# geom part add -t freebsd-zfs ada0
ada0p3 added
# geom part show ada0
=&gt;       34  976773101  ada0  GPT  (465G)
         34        128     1  freebsd-boot  (64k)
        162    8388608     2  freebsd-swap  (4.0G)
    8388770  968384365     3  freebsd-zfs  (461G)

# geom part bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
bootcode written to ada0
# zpool replace data 3635039039460500206 ada0p3
Make sure to wait until resilver is done before rebooting.

If you boot from pool 'data', you may need to update
boot code on newly attached disk 'ada0p3'.

Assuming you use GPT partitioning and 'da0' is your new boot disk
you may use the following command:

	gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0</pre><p xmlns="http://www.w3.org/1999/xhtml">When done, I saw that the available space on the <tt>data</tt> zpool was still the same:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword"># zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
data   <strong>294G</strong>  65,3G   229G    22%  1.19x  ONLINE  -
tank  1,81T   300G  1,52T    16%  1.08x  ONLINE  -</pre><p xmlns="http://www.w3.org/1999/xhtml">This is due to the <tt>autoexpand</tt> property set to <em>off</em> by default and that should be set to <em>on</em> before replacing disks if this feature is desired.</p><pre xmlns="http://www.w3.org/1999/xhtml"># zpool set autoexpand=on data</pre><p xmlns="http://www.w3.org/1999/xhtml">Hopefully, it is possible to use the <tt>zpool(8)</tt>'s <tt>online</tt> command to make ZFS take into account the extra space available for the pools:</p><pre xmlns="http://www.w3.org/1999/xhtml"># zpool online -e data ada0p3</pre><pre xmlns="http://www.w3.org/1999/xhtml" class="highlight-keyword"># zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
data   <strong>460G</strong>  65,3G   395G    14%  1.20x  ONLINE  -
tank  1,81T   300G  1,52T    16%  1.06x  ONLINE  -</pre>]]></description><link>http://romain.blogreen.org/blog/2012/01/updating-a-zfs-mirror/</link><category>FreeBSD</category><category>Sysadmin</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2012/01/updating-a-zfs-mirror/</guid><pubDate>Wed, 04 Jan 2012 11:27:08 GMT</pubDate></item><item><title>Thomson ST2030 Feature Key Sheet Template</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml"><a href="http://www.technicolor.com/">Technicolor</a>'s (ex. Thomson's) <a href="http://www.technicolorbroadbandpartner.com/telephony-solutions/products/product-detail.php?id=87">ST2030</a> <acronym title="Session Initiation Protocol">SIP</acronym> phone features 10 <em>feature keys</em> that can be used as <em>fast call keys</em> to reach a configured number by a single key-press.</p><p xmlns="http://www.w3.org/1999/xhtml" class="figure"><img src="http://romain.blogreen.org/images/st2030-feature-key.png" alt="[ST2030 Feature Keys location]" height="278" width="254"/><br/>Location of <em>Feature Keys</em> on the ST2030.</p><p xmlns="http://www.w3.org/1999/xhtml">I finally decided to configure these keys with proper numbers instead of browsing my directory each time I want to make a call.  But the phone only ships with a single paper sheet to hand-write the names corresponding to the configured numbers and my hand-writing is somewhat like what would produce a drunk cow with Creutzfeldt–Jakob disease.  I browsed the Internet for a sheet template to fill-in, print and cut, but was unable to find some.</p><p xmlns="http://www.w3.org/1999/xhtml">So, I took <a href="http://inkscape.org">Inkscape</a> and did one myself.  For your convenience, I make it available as the original <acronym title="Scalable Vector Graphics">SVG</acronym> file (so that you can fill-it before printing) and a <acronym title="Portable Document Format">PDF</acronym> file for those who like hand-writing:</p><ul xmlns="http://www.w3.org/1999/xhtml">
    <li><a href="http://romain.blogreen.org/files/thomson-st2030-feature-key-sheet-template.svg">Thomson ST2030 Feature Key Sheet Template <acronym title="Scalable Vector Graphics">SVG</acronym></a>;</li>
<li><a href="http://romain.blogreen.org/files/thomson-st2030-feature-key-sheet-template.pdf">Thomson ST2030 Feature Key Sheet Template <acronym title="Portable Document Format">PDF</acronym></a>.</li>
</ul><p xmlns="http://www.w3.org/1999/xhtml">If you don't have a precise idea of which numbers you call often, you can extract this information from <a href="http://www.asterisk.org/">Asterisk</a>'s log file.  In my case, my calls come from the <em>internal</em> context so I just did this to get the top-20 of the numbers I call:</p><pre xmlns="http://www.w3.org/1999/xhtml">% cat /var/log/asterisk/cdr-csv/Master.csv | grep '<strong>internal</strong>' | cut -d, -f3 | \
    sed -e 's|+33|0|' | sort | uniq -c | sort -nr | head -n 20</pre>]]></description><link>http://romain.blogreen.org/blog/2011/12/thomson-st2030-feature-key-sheet-template/</link><category>Sysadmin</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2011/12/thomson-st2030-feature-key-sheet-template/</guid><pubDate>Thu, 29 Dec 2011 15:44:32 GMT</pubDate></item><item><title>I'm on the Radio</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">Earlier this year, 4 friends and I joined together with the goal of having our very own radio show.  The first show was recorded in late November and was on air in the beginning of October.  From that date, every two week, a new issue is broadcasted live on <a href="http://clermont.radio-campus.org">Radio Campus Clermont-Ferrand</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">The show is called <q><a href="http://malamanteau.fr">Les
							aventures du comte de Malamanteau</a></q> (French for
					<em>Earl Malamanteau's Adventures</em>), and is mostly music
					centered: during one hour, a selection of music from a given
					country (a different one for each issue) is aired. So far,
					we have visited <a href="http://malamanteau.fr/2011-10-05-afrique-du-sud/">South Africa</a>, <a href="http://malamanteau.fr/2011-10-19-kenya/">Kenya</a>, <a href="http://malamanteau.fr/2011-11-02-tunisie/">Tunisia</a>, <a href="http://malamanteau.fr/2011-11-16-liban/">Lebanon</a>,
					<a href="http://malamanteau.fr/2011-11-30-ukraine/">Ukraine</a> and <a href="http://malamanteau.fr/2011-12-14-finlande/">Finland</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">A website has been setup for listeners to have access to
					broadcasted shows and gathering more information about the
					music we chose and location we visited: <a href="http://malamanteau.fr">malamanteau.fr</a>.</p><p xmlns="http://www.w3.org/1999/xhtml" class="figure"><a href="http://malamanteau.fr"><img src="http://romain.blogreen.org/images/malamanteau.fr.png" alt="Screenshot of the        home-page of malamanteau.fr"/></a></p><p xmlns="http://www.w3.org/1999/xhtml">The website
					is generated using <a href="http://blogreen.org/">Blogreen</a>, a project I
					started bazillon years ago and that recently reached a form
					that makes it usable (after being re-thought from scratch a
					couple times). Basically, Blogreen is a tool for building
					websites from free-form <acronym title="eXtensible Markup Language">XML</acronym> data.
					If you consider your data to be some <em>models</em>,
					regarding the facts that the system expects you to provide
					<em>views</em>, Blogreen is basically the
					<em>controller</em> of an <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym>
					<acronym title="Model-View-Controller">MVC</acronym> data processing system.</p><p xmlns="http://www.w3.org/1999/xhtml">The documentation is currently somewhat sparse, so if you
					are interested in the project, you'd better subscribe to the
					<a href="mailto:blogreen-announce-request@blogreen.org?subject=subscribe">blogreen-announce</a>
					mailing-list to be informed of major news (documentation
					availability, releases (maybe one day), …) or if you are interested
					in <em>how it works</em>, to the <a href="mailto:blogreen-devel-request@blogreen.org?subject=subscribe">blogreen-devel</a>
					mailing-list for commit messages.</p>]]></description><link>http://romain.blogreen.org/blog/2011/12/i-m-on-the-radio/</link><category>Blogreen</category><category>The Real Life</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2011/12/i-m-on-the-radio/</guid><pubDate>Wed, 21 Dec 2011 14:35:00 GMT</pubDate></item><item><title>TeXLive 2011 on FreeBSD</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">A few weeks ago, I updated the <a href="https://code.google.com/p/freebsd-texlive/">freebsd-texlive project</a> to make TeXLive 2011 (the latest verison) available as ports for <a href="http://www.freebsd.org/">FreeBSD</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">In order to help users who don't want to install the whole TeXLive collection (~2000 ports), <a href="http://freebsd-texlive.googlecode.com/svn/trunk/Tools/scripts/texlive-port-seek">a basic script</a> has been developed to ease-up finding which port provides some file required by a given package.</p><p xmlns="http://www.w3.org/1999/xhtml">As usual, feedback is welcomed!</p>]]></description><link>http://romain.blogreen.org/blog/2011/08/texlive-2011-on-freebsd/</link><category>FreeBSD</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2011/08/texlive-2011-on-freebsd/</guid><pubDate>Fri, 26 Aug 2011 02:10:00 GMT</pubDate></item><item><title>Additional note for a proper shebang</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">I recently encountered a shell script lacking some functionality I wanted to rely on, and started editing it to provide a patch for the author.</p><p xmlns="http://www.w3.org/1999/xhtml">The first line of the script was:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="sh_sh">#!/bin/bash -x</pre><p xmlns="http://www.w3.org/1999/xhtml">Those who know me might imagine how my eyes were bleeding (the other may want to read my previous entry about <a href="http://romain.blogreen.org/blog/2008/04/you-bash-users-are-driving-me-crazy/">writing portable shebang for shell scripts</a>), but this shows another problem one may encounter when porting a shell script with an invalid shebang.</p><p xmlns="http://www.w3.org/1999/xhtml">Let's assume the script has bashisms and we want to use bash to run it.  According to my previous post, you may want to write this:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="sh_sh">#!/usr/bin/env bash -x</pre><p xmlns="http://www.w3.org/1999/xhtml">Unfortunately, this won't work: env(1) will look for a binary names <q>bash -x</q> in the <tt>$PATH</tt> and fail:</p><pre xmlns="http://www.w3.org/1999/xhtml">env: bash -x: No such file or directory</pre><p xmlns="http://www.w3.org/1999/xhtml">There is however a simple solution: the <tt>set</tt> builtin(1). The right syntax is:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="sh_sh">#!/usr/bin/env bash
set -x</pre>]]></description><link>http://romain.blogreen.org/blog/2011/04/additional-note-for-a-proper-shebang/</link><category>Sysadmin</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2011/04/additional-note-for-a-proper-shebang/</guid><pubDate>Sat, 02 Apr 2011 13:43:00 GMT</pubDate></item><item><title>Typesetting Korean with TeXLive</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">Today, I received a request for <a href="http://code.google.com/p/freebsd-texlive/issues/detail?id=15">adding support for ko.teX to the FreeBSD TeXLive ports</a>. I created 3 ports for this purpose: <a href="http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-util/">print/kotex-util</a>, <a href="http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-macros/">print/kotex-macros</a> and <a href="http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-fonts-all/">kotex-fonts-all</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">I did some basic testing locally, but I don't read Korean, thus I could not test beyond the (minimalistic) examples. I am therefore looking for FreeBSD TeXLive users who are able to write Korean to help testing this package.  If you are one of them, please give it a try and report any success or failures <a href="http://code.google.com/p/freebsd-texlive/issues/detail?id=15">on the issue page</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">To install these experimental ports, the easiest way is using <tt>devel/subversion</tt>:</p><pre xmlns="http://www.w3.org/1999/xhtml">% svn co http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-util/
% cd kotex-util
% make
% sudo make install
% cd ..
% svn co http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-macros/
% cd kotex-macros
% make
% sudo make install
% cd ..
% svn co http://freebsd-texlive.googlecode.com/svn/branches/ports/print/kotex-fonts-all/
% cd kotex-fonts-all
% make
% sudo make install
% cd ..</pre><p xmlns="http://www.w3.org/1999/xhtml">Thanks!</p>]]></description><link>http://romain.blogreen.org/blog/2011/02/typesetting-korean-with-texlive/</link><category>FreeBSD</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2011/02/typesetting-korean-with-texlive/</guid><pubDate>Sun, 06 Feb 2011 12:13:31 GMT</pubDate></item><item><title>TeXLive 2010 on FreeBSD</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">I definitively have a lack of time at the moment.  Since this blog last entry is about <q>Hey guys, I have just pushed TeXLive 2009 in the <a href="http://code.google.com/p/freebsd-texlive/">freebsd-texlive</a> project</q>, I guess I have to take the time to write this short post:</p><p xmlns="http://www.w3.org/1999/xhtml">One month ago, I pushed TeXLive 2010 to the <a href="http://code.google.com/p/freebsd-texlive/">freebsd-texlive</a> repository.  Moreover, because <a href="http://www.freshports.org/ports-mgmt/portshaker/">portshaker</a> is now in the FreeBSD ports tree, <a href="http://code.google.com/p/freebsd-texlive/wiki/Installing">installing bleeding-edge TeXLive on FreeBSD</a> has never been so easy!</p>]]></description><link>http://romain.blogreen.org/blog/2010/11/texlive-2010-on-freebsd/</link><category>FreeBSD</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2010/11/texlive-2010-on-freebsd/</guid><pubDate>Mon, 01 Nov 2010 12:13:31 GMT</pubDate></item><item><title>TeXLive 2009 on FreeBSD</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">I recently updated the <a href="https://code.google.com/p/freebsd-texlive/">freebsd-texlive project</a> to make TeXLive 2009 (the latest verison) available as ports for <a href="http://www.freebsd.org/">FreeBSD</a>.</p><p xmlns="http://www.w3.org/1999/xhtml">I used <a href="http://romain.blogreen.org/Blog/2009/05/TeXLive_for_FreeBSD_updated">a script for update TeXLive 2008 on a regular basis</a>, but since these new ports feature <tt>pkg-plist</tt> files, I had to setup an update jail.  So updates for FreeBSD TeXLive ports will be generated daily at 5:30 CET.</p><p xmlns="http://www.w3.org/1999/xhtml">I am also thinking about pushing the <tt>portshaker(8)</tt> utility in the FreeBSD ports tree in order to make it easier to track this project along with others (e.g. BSD#).</p><p xmlns="http://www.w3.org/1999/xhtml">Feedback is welcomed!</p>]]></description><link>http://romain.blogreen.org/blog/2010/04/texlive-2009-on-freebsd/</link><category>FreeBSD</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2010/04/texlive-2009-on-freebsd/</guid><pubDate>Mon, 12 Apr 2010 09:14:00 GMT</pubDate></item><item><title>gpg: OpenPGP card not available: IPC write error</title><description><![CDATA[<p xmlns="http://www.w3.org/1999/xhtml">If you reach this page searching the internet for this error and did not find anything usefull, it might be because the error you want to search is actually <q><em>Unknown</em> IPC command</q>.</p><p xmlns="http://www.w3.org/1999/xhtml">Basically, you may not have <tt>gpg-agent(1)</tt> running.  The man page gives a few pointer on how to run it, here is my way to do so, in <tt>${HOME}/.zshenv</tt>:</p><pre xmlns="http://www.w3.org/1999/xhtml" class="sh_sh">if ! pgrep -U `id -u` gpg-agent &gt;/dev/null 2&gt;&amp;1; then
    eval `gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info"`
else
    eval `cat "${HOME}/.gpg-agent-info"`
    export GPG_AGENT_INFO
fi</pre><p xmlns="http://www.w3.org/1999/xhtml">Hope this will help someone :-)</p>]]></description><link>http://romain.blogreen.org/blog/2010/04/gpg-openpgp-card-not-available-ipc-write-error/</link><category>Sysadmin</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2010/04/gpg-openpgp-card-not-available-ipc-write-error/</guid><pubDate>Fri, 09 Apr 2010 08:35:00 GMT</pubDate></item><item><title>ZFS: unsupported ZFS version 14 (should be 13)</title><description><![CDATA[<h2 xmlns="http://www.w3.org/1999/xhtml">How I got there?</h2><p xmlns="http://www.w3.org/1999/xhtml">After updating to the latest development version of GNOME thanks' to <a href="http://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi">MarcusCom ports</a> I wanted to log out and back in but X refused to restart because of the in-heavy-development <a href="http://nouveau.freedesktop.org/wiki/">Nouveau video driver</a>.  I run in this problem every once a while and a full reboot solve this problem.  However, the system did not boot:</p><pre xmlns="http://www.w3.org/1999/xhtml">ZFS: unsupported ZFS version 14 (should be 13)
ZFS: unsupported ZFS version 14 (should be 13)
NO ZFS pools located? can't boot</pre><p xmlns="http://www.w3.org/1999/xhtml">Okay, I recall running the following to update my full-ZFS system from ZFS 13 to 14 a while ago:</p><pre xmlns="http://www.w3.org/1999/xhtml">zpool upgrade -a</pre><p xmlns="http://www.w3.org/1999/xhtml">I completly  forgot about updating the GPT bootloader accordingly and thus it was unable to use the version of ZFS on my disks.</p><h2 xmlns="http://www.w3.org/1999/xhtml">The FreeBSD 8.0-STABLE livefs</h2><p xmlns="http://www.w3.org/1999/xhtml">The FreeBSD projects provides snapshots of -STABLE version of the Operating System (I am running FreeBSD 8.0-STABLE) and the livefs disk contains the fixit environement which would allow me to solve my problems.</p><p xmlns="http://www.w3.org/1999/xhtml">I so used my laptop to look for such an ISO image and burn it, unfortunately, the bootp and dns servers are run by the machine that was down.  Hopefully, I had a web browser oppenned on this system and it had the address of google's servers in it's cache.  I could search for my ISP DNS and add them to <tt>/etc/resolv.conf</tt>. I was then able to download the image and burn it.</p><h2 xmlns="http://www.w3.org/1999/xhtml">Fixing</h2><p xmlns="http://www.w3.org/1999/xhtml">By default, the livefs will not have ZFS support unless you ask for it before starting. In other word, at the boot menu, <em>Escape to loader prompt</em> and type:</p><pre xmlns="http://www.w3.org/1999/xhtml">OK <strong>load zfs</strong>
OK <strong>boot</strong></pre><p xmlns="http://www.w3.org/1999/xhtml">When the <tt>sysinstall(8)</tt> menu appears, select <em>Fixit</em> / <em>CDROM/DVD</em>. At the <tt>Fixit#</tt> prompt, you will have to search for your zfs pools, mount your filesystems, locate the new version of the bootloader and install it.  This is basically a transcript of what I did (<a href="http://romain.blogreen.org/blog/2009/10/updating-freebsd-7-i386-to-8-amd64/">I previously described my setup in this blog</a>):</p><pre xmlns="http://www.w3.org/1999/xhtml">Fixit# zpool import -f data <em># at this point I had to leave and return in the Fixit environement</em>
                            <em># because by ZFS root was hiding the livefs root.</em>
Fixit# zfs set mountpoint=/mnt data
Fixit# gpart bootcode -p /mnt/boot/gptzfsboot -i 1 ad10
Fixit# gpart bootcode -p /mnt/boot/gptzfsboot -i 1 ad12
Fixit# zfs set mountpoint=legacy data
Fixit# zfs umount -a
Fixit# logout</pre><p xmlns="http://www.w3.org/1999/xhtml">Note to myself: in the future <strong>do not forget</strong> to update the bootloader when updating my ZFS filesystems.</p>]]></description><link>http://romain.blogreen.org/blog/2010/02/zfs-unsupported-zfs-version-14-should-be-13/</link><category>FreeBSD</category><category>Sysadmin</category><guid isPermaLink="true">http://romain.blogreen.org/blog/2010/02/zfs-unsupported-zfs-version-14-should-be-13/</guid><pubDate>Sat, 27 Feb 2010 16:27:00 GMT</pubDate></item></channel></rss>

