{"id":112,"date":"2004-08-09T08:30:34","date_gmt":"2004-08-09T06:30:34","guid":{"rendered":""},"modified":"2007-07-03T09:45:41","modified_gmt":"2007-07-03T07:45:41","slug":"sun-solaris-zfs","status":"publish","type":"post","link":"http:\/\/www.lookit.org\/blog\/?p=112","title":{"rendered":"Sun Solaris ZFS"},"content":{"rendered":"<p>Petit tutorial sur Sun Solaris ZFS, gestion du nouveau file system de SUN.<br \/><!--more--><\/p>\n<p>ZFS is easy, so let&#39;s get on with it!  It&#39;s time to create your first pool: <\/p>\n<pre>    # zpool create tank c1t2d0<br \/><\/pre>\n<p>You now have a single-disk storage pool named tank, with a single filesystem mounted at \/tank.  There is <em>nothing<\/em> else to do.<\/p>\n<p>If you want mirrored storage for mail and home directories, that&#39;s easy too:<\/p>\n<p>Create the pool:<\/p>\n<pre>    # zpool create tank mirror c1t2d0 c2t2d0<\/pre>\n<p>Create the \/var\/mail filesystem:<\/p>\n<pre>    # zfs create tank\/mail<br \/><br \/>    # zfs set mountpoint=\/var\/mail tank\/mail<br \/><\/pre>\n<p>Create home directories, and mount them all in \/export\/home\/&lt;username&gt;:<\/p>\n<pre>    # zfs create tank\/home<br \/><br \/>    # zfs set mountpoint=\/export\/home tank\/home<br \/><br \/>    # zfs create tank\/home\/ahrens<br \/><br \/>    # zfs create tank\/home\/billm<br \/><br \/>    # zfs create tank\/home\/bonwick<br \/><br \/>    # zfs create tank\/home\/eschrock<br \/><br \/>    &hellip;<\/pre>\n<p>Filesystems in ZFS are hierarchical: each one inherits properties from above. In this example, the mountpoint property is inherited as a pathname prefix. That is, tank\/home\/ahrens is automatically mounted at \/export\/home\/ahrens because tank\/home is mounted at \/export\/home. You don&#39;t have to specify the mountpoint for each individual user &mdash; you just tell ZFS the pattern.<\/p>\n<p>This is how we actually set up home directory and mail service on zion.eng, which has been running ZFS for over a year and a half.<\/p>\n<p>But wait, there&#39;s more!<\/p>\n<p>ZFS provides built-in compression.  To compress all home directories:<\/p>\n<pre>    # zfs set compression=on tank\/home<\/pre>\n<p>To give ahrens a 10G quota:<\/p>\n<pre>    # zfs set quota=10g tank\/home\/ahrens<\/pre>\n<p>To give bonwick a 100G reservation (membership has its privileges):<\/p>\n<pre>    # zfs set reservation=100g tank\/home\/bonwick<br \/><\/pre>\n<p>To automatically NFS-export all home directories read\/write:<\/p>\n<pre>    # zfs set sharenfs=rw tank\/home<\/pre>\n<p>To scrub all disks and verify the integrity of all data in the pool:<\/p>\n<pre>    # zpool scrub tank<\/pre>\n<p>To replace a flaky disk:<\/p>\n<pre>    # zpool replace tank c2t2d0 c4t1d0<br \/><\/pre>\n<p>To add more space:<\/p>\n<pre>    # zpool add tank mirror c5t1d0 c6t1d0<br \/><\/pre>\n<p>To move your pool from SPARC machine &#39;sparky&#39; to AMD machine &#39;amdy&#39;:<\/p>\n<pre>[on sparky]<br \/>    # zpool export tank<br \/><\/pre>\n<p>Physically move your disks from sparky to amdy.<\/p>\n<pre>[on amdy]<br \/>    # zpool import tank<br \/><br \/>http:\/\/www.opensolaris.org\/os\/community\/zfs\/intro\/<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Petit tutorial sur Sun Solaris ZFS, gestion du nouveau file system de SUN.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-informatique"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pWrTo-1O","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lookit.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}