<?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>Werk &#187; BSD</title>
	<atom:link href="http://werk.feub.net/tag/bsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://werk.feub.net</link>
	<description>Pourquoi Werk? ^.^</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:18:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>freebsd : mount_nullfs</title>
		<link>http://werk.feub.net/2009/12/freebsd-mount_nullfs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=freebsd-mount_nullfs</link>
		<comments>http://werk.feub.net/2009/12/freebsd-mount_nullfs/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 06:07:33 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[mount_nullfs]]></category>
		<category><![CDATA[nullfs]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=261</guid>
		<description><![CDATA[Sous GNU/Linux, j&#8217;utilisais assez les mount --bind pour monter un système de fichiers à un autre endroit de l&#8217;arborescence. Ceci étant une spécificité Linux, il n&#8217;existe pas sous FreeBSD. Mais il y a nullfs qui fait à peu près la même chose. Voici comment utiliser mount_nullfs pour &#8211; par exemple &#8211; monter une sous-arborescence music [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://werk.feub.net/medias/2010/03/freebsd-logo_64.png" alt="" width="64" height="64" class="ico-float-left" />Sous GNU/Linux, j&#8217;utilisais assez les <code>mount --bind</code> pour monter un système de fichiers à un autre endroit de l&#8217;arborescence. Ceci étant une spécificité Linux, il n&#8217;existe pas sous FreeBSD. Mais il y a <a href="http://www.freebsd.org/cgi/man.cgi?query=nullfs&#038;apropos=0&#038;sektion=0&#038;manpath=FreeBSD+8.0-RELEASE&#038;format=html">nullfs</a> qui fait à peu près la même chose. Voici comment utiliser <a href="http://www.freebsd.org/cgi/man.cgi?query=mount_nullfs&#038;apropos=0&#038;sektion=0&#038;manpath=FreeBSD+8.0-RELEASE&#038;format=html">mount_nullfs</a> pour &#8211; par exemple &#8211; monter une sous-arborescence <code>music</code> sous le home de <em>toto</em> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mkdir /usr/home/toto/music</span>
<span style="color: #666666; font-style: italic;"># mount_nullfs /dataraid/zfsdata/music /usr/home/toto/music</span></pre></div></div>

<p>
L&#8217;arborescence <code>/dataraid/zfsdata/music</code> est désormais <em>aliasée</em> et ainsi disponible dans le <em>home</em> de <em>toto</em>. La grosse différence entre ceci et un lien symbolique est que le chemin de cette nouvelle arborescence est réellement vu à l&#8217;endroit indiqué <code>/usr/home/toto/music</code>. Ainsi :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /usr/home/toto/music/</span>
<span style="color: #666666; font-style: italic;"># realpath .</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alex<span style="color: #000000; font-weight: bold;">/</span>music
<span style="color: #666666; font-style: italic;"># stat .</span>
<span style="color: #000000;">134283012</span> <span style="color: #000000;">107</span> drwxr-xr-x <span style="color: #000000;">342</span> fabien wheel <span style="color: #000000;">0</span> <span style="color: #000000;">345</span> <span style="color: #ff0000;">&quot;Dec 22 03:01:29 2009&quot;</span> <span style="color: #ff0000;">&quot;Dec 19 17:00:43 2009&quot;</span> <span style="color: #ff0000;">&quot;Dec 19 17:00:43 2009&quot;</span> <span style="color: #ff0000;">&quot;Dec  9 20:32:31 2009&quot;</span> <span style="color: #000000;">4096</span> <span style="color: #000000;">27</span> <span style="color: #000000;">0</span> .</pre></div></div>

<p>
Le <code>realpath</code> retourne bien notre système de fichiers et non celui d&#8217;origine sous <code>/dataraid/zfsdata/music</code>. <code>stat</code> quant à lui nous indique qu&#8217;il s&#8217;agit bien d&#8217;un répertoire et non d&#8217;un lien symbolique.
</p>
<p>
Pour faire ce montage (en lecture-écriture) automatiquement au démarrage dans le <code>fstab</code>, ajouter cette ligne :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dataraid<span style="color: #000000; font-weight: bold;">/</span>zfsdata<span style="color: #000000; font-weight: bold;">/</span>music    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>toto<span style="color: #000000; font-weight: bold;">/</span>music nullfs  rw      <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2009/12/freebsd-mount_nullfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc (Feed is rejected)
Page Caching using apc
Object Caching 209/233 objects using memcached

Served from: werk.feub.net @ 2012-02-09 00:13:58 -->
