{"id":7985,"date":"2013-04-29T00:00:00","date_gmt":"2013-04-28T15:00:00","guid":{"rendered":"http:\/\/oichinote.com\/plus\/?p=7985"},"modified":"2017-06-14T20:29:12","modified_gmt":"2017-06-14T11:29:12","slug":"install-freebsd-with-full-zfs","status":"publish","type":"post","link":"https:\/\/oichinote.com\/plus\/2013\/04\/install-freebsd-with-full-zfs.html","title":{"rendered":"FreeBSD9\u3067Full ZFS\u30b7\u30b9\u30c6\u30e0\u4f5c\u6210\u306e\u5b9f\u9a13[\u8ffd\u8a18\u3042\u308a]"},"content":{"rendered":"<p>FreeBSD\u52c9\u5f37\u30b7\u30ea\u30fc\u30ba\u306e\u4e00\u74b0\u3067\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/oichinote.com\/plus\/2012\/11\/studying-freebsd.html\" rel=\"_RAclick\">FreeBSD\u306e\u52c9\u5f37\u4e2d: \u30d7\u30e9\u30b9\u03b1\u7a7a\u9593<\/a> <em>(2012\u5e7411\u67083\u65e5)<\/em><\/li>\n<\/ul>\n<p>FreeBSD\u3067\u306e\u9b45\u529b\u3068\u8a00\u3048\u3070\u3001\u3084\u306f\u308a\u3001ZFS\u3002\u8272\u3005\u8abf\u3079\u3066\u3044\u305f\u3089\u3001boot\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u4ee5\u5916\u3092\u3001ZFS\u306b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u304c\u51fa\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/yet-another-su.txt-nifty.com\/endeavor_nt340freebsd\/2012\/05\/freebsd-9zfs-66.html\" target=\"_blank\">FreeBSD 9\u3067\u30d5\u30ebZFS\u30b7\u30b9\u30c6\u30e0: FreeBSD Try, Error and Error<\/a><\/li>\n<li><a href=\"https:\/\/www.bsdconsulting.co.jp\/CGI\/BSDC.CGI?CNT=FREEBSDSTUDY_2012120701\" target=\"_blank\">BSD Consulting, Inc.<\/a><\/li>\n<li><a href=\"https:\/\/www.dan.me.uk\/blog\/2012\/01\/22\/booting-from-zfs-raid0156-in-freebsd-9-0-release\/\" target=\"_blank\">Booting from ZFS RAID0\/1\/5\/6 in FreeBSD 9.0-RELEASE | Dan\u2019s Blog<\/a><\/li>\n<\/ul>\n<p>\u5927\u5909\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u8cc7\u6599\u3092\u5143\u306b\u3001FreeBSD\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5b9f\u9a13\u3092\u3057\u307e\u3057\u305f\u3002\u5b9f\u9a13\u3068\u8a00\u3046\u306e\u306f\u3001Parallels\u306b\u3001\u6b21\u306e\u30b9\u30da\u30c3\u30af\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u3063\u3066\u3001\u5b9f\u969b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>\u30e1\u30e2\u30ea &#8230; 4GB<\/li>\n<li>HDD0(SSD) &#8230; 9GB (\u30b7\u30b9\u30c6\u30e0\u3001\u30b9\u30ef\u30c3\u30d7\u3001ZIL\u7528)<\/li>\n<li>HDD1 &#8230; 1GB (\u30c7\u30fc\u30bf\u7528\u3002RAIDZ)<\/li>\n<li>HDD2 &#8230; 1GB (\u30c7\u30fc\u30bf\u7528\u3002RAIDZ)<\/li>\n<li>HDD3 &#8230; 1GB (\u30c7\u30fc\u30bf\u7528\u3002RAIDZ)<\/li>\n<li>HDD4 &#8230; 1GB (\u30c7\u30fc\u30bf\u7528\u3002RAIDZ)<\/li>\n<li>USB\u30e1\u30e2\u30ea &#8230; 32GB (L2ARC\u7528)<\/li>\n<\/ul>\n<p>(\u8ffd\u8a18 2014-03-30 20:31 \u5b9f\u969b\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001L2ARC\u306bSSD\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059\u3002USB\u30e1\u30e2\u30ea\u306f\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3002)<\/p>\n<p>\u3053\u306e\u30b9\u30da\u30c3\u30af\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u3001\u3068\u308a\u3042\u3048\u305a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8d77\u52d5\u78ba\u8a8d\u3057\u305f\u307e\u3067\u3067\u3001\u4f7f\u3044\u8fbc\u3093\u3067\u306f\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u5b9f\u9a13\u306f\u3067\u304d\u307e\u3057\u305f\u3002\u307e\u305f\u3001\u30b9\u30ef\u30c3\u30d7\u30fb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u6e96\u5099\u306f\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066ZFS\u30d7\u30fc\u30eb\u306b\u7f6e\u304f\u3064\u3082\u308a\u3067\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001\u6b21\u306e\u624b\u9806\u3067\u3057\u305f\u3002\u4e00\u5fdc\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u8d77\u52d5\u307e\u3067\u306f\u78ba\u8a8d\u3067\u304d\u305f\u306e\u3067\u3059\u304c\u3001\u79c1\u304cZFS\u3092\u5b8c\u5168\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u9593\u9055\u3063\u305f\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u306e\u6642\u306f\u3001\u304a\u77e5\u3089\u305b\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4e0a\u8a18\u4e8c\u3064\u306e\u8cc7\u6599\u3092\u8aad\u3093\u3060\u4e0a\u3067\u3001\u79c1\u306a\u308a\u306e\u6539\u826f\u3092\u52a0\u3048\u305f\u30b7\u30b9\u30c6\u30e0\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>ZIL\u306e\u30b5\u30a4\u30ba\u306f\u30e1\u30a4\u30f3\u30e1\u30e2\u30ea\u306e\u534a\u5206\u306b\u3057\u305f\n<ul>\n<li><a href=\"http:\/\/docs.oracle.com\/cd\/E24845_01\/html\/819-6260\/gbscy.html#gfgaa\" target=\"_blank\">ZFS \u306e\u65b0\u6a5f\u80fd &#8211; Oracle Solaris ZFS \u7ba1\u7406\u30ac\u30a4\u30c9<\/a> <em>(\u30ed\u30b0\u30c7\u30d0\u30a4\u30b9\u306e\u6700\u5927\u30b5\u30a4\u30ba\u306f\u7269\u7406\u30e1\u30e2\u30ea\u30fc\u306e\u30b5\u30a4\u30ba\u306e\u7d04 1\/2 \u306b\u306a\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002)<\/em><\/li>\n<\/ul>\n<\/li>\n<li>L2ARC\u306e\u30b5\u30a4\u30ba\u306f\u3001\u30e1\u30a4\u30f3\u30e1\u30e2\u30ea\u3088\u308a\u3082\u5927\u304d\u304f\u3057\u305f\n<ul>\n<li><a href=\"https:\/\/wiki.freebsd.org\/ZFSTuningGuide\" target=\"_blank\">ZFSTuningGuide &#8211; FreeBSD Wiki<\/a><\/li>\n<\/ul>\n<\/li>\n<li>L2ARC\u306fUSB\u30e1\u30e2\u30ea\u306b\u7f6e\u3044\u305f\n<ul>\n<li>ZIL\/L2ARC\u306fSSD\u306b\u7f6e\u304f\u306e\u304c\u52b9\u679c\u7684\u3060\u304c\u3001\u5927\u5bb9\u91cf\u306eSSD\u306f\u9ad8\u3044<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>(\u8ffd\u8a18 2014-03-30 20:31 \u5b9f\u969b\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001L2ARC\u306bSSD\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059\u3002USB\u30e1\u30e2\u30ea\u306f\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3002)<\/p>\n<p>ZIL\/L2ARC\u306b\u3064\u3044\u3066\u306f\u3001\u6b21\u306e\u8cc7\u6599\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/www.slideshare.net\/satorumiyazaki\/hbstudy12-zfs\" target=\"_blank\">ZFS\u3067\u30b9\u30c8\u30ec\u30fc\u30b8<\/a><\/li>\n<li><a href=\"http:\/\/moca.espresso.gr.jp\/wiki\/wiki.cgi?page=Solaris+zfs\" target=\"_blank\">Solaris zfs &#8211; FreeStyleWiki<\/a><\/li>\n<\/ul>\n<p>\u6b21\u306e\u9806\u5e8f\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002<\/p>\n<ol>\n<li>\u30b7\u30b9\u30c6\u30e0\u7528\u30c7\u30a3\u30b9\u30af\u306e\u6e96\u5099<\/li>\n<li>L2ARC\u7528\u306eUSB\u3092\u6e96\u5099<\/li>\n<li>\u30c7\u30fc\u30bf\u7528\u30c7\u30a3\u30b9\u30af\u306e\u6e96\u5099<\/li>\n<li>ZFS\u30ab\u30fc\u30cd\u30eb\u306e\u30ed\u30fc\u30c9<\/li>\n<li>\u30b7\u30b9\u30c6\u30e0\u7528\u30d7\u30fc\u30eb(rpool)\u306e\u4f5c\u6210<\/li>\n<li>\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306e\u4f5c\u6210<\/li>\n<li>ZIL\u3068L2ARC\u306e\u8a2d\u5b9a<\/li>\n<li>rc.conf\u3068loader.conf\u306e\u8a2d\u5b9a<\/li>\n<li>\u30b7\u30b9\u30c6\u30e0\u7528\u30d7\u30fc\u30eb(rpool)\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a<\/li>\n<li>\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a<\/li>\n<li>\u30b7\u30b9\u30c6\u30e0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<\/ol>\n<p>\u305d\u308c\u3067\u306f\u3001\u9806\u306b\u8aac\u660e\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<h3>1. \u30b7\u30b9\u30c6\u30e0\u7528\u30c7\u30a3\u30b9\u30af\u306e\u6e96\u5099<\/h3>\n<p>\u307e\u305a\u306f\u3001\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u30c7\u30d0\u30a4\u30b9\u540d\u3092\u8abf\u3079\u3001GPT\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u5207\u308a\u307e\u3059\u3002boot\u7528\u3001\u30b7\u30b9\u30c6\u30e0\u7528\u3001ZIL\u7528\u306e3\u3064\u3067\u3059\u3002<\/p>\n<pre># dmesg | grep MB\r\n# gpart destroy ada0\r\n# gpart create -s gpt ada0\r\n# gpart add -s 64k -t freebsd-boot ada0\r\n# gpart bootcode -b \/boot\/pmbr -p \/boot\/gptzfsboot -i 1 ada0\r\n# gpart add -s 2G -t freebsd-zfs -l zil ada0\r\n# gpart show\r\n# gpart add -s 7G -t freebsd-zfs -l zroot ada0<\/pre>\n<p>\u6700\u5f8c\u306e7G\u304c\u3001\u30b7\u30b9\u30c6\u30e0\u7528\u306b\u306a\u308a\u307e\u3059\u3002\u5b9f\u969b\u306b\u306f\u3001&#8221;-s 7G&#8221;\u3067\u306f\u306a\u304f\u3001&#8221;gpart show&#8221;\u3067\u8abf\u3079\u305f\u30b5\u30a4\u30ba\u3001&#8221;-s 14679869&#8243;\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002gpart show\u3067free\u3068\u306a\u3063\u3066\u3044\u308b\u5927\u304d\u3055\u3092\u76f4\u63a5\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u30012\u56de\u76ee\u4ee5\u964d\u540c\u3058\u30c7\u30a3\u30b9\u30af\u306b\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408\u3001gpard destroy\u306b\u5931\u6557\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002&#8221;-F&#8221;\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308b\u3068\u3001\u5f37\u5236\u7684\u306bdestroy\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2. L2ARC\u7528\u306eUSB\u3092\u6e96\u5099<\/h3>\n<p>l2arc\u7528\u306b\u306f\u3001USB\u30e1\u30e2\u30ea\u3092\u5272\u5f53\u3066\u3066\u3044\u307e\u3059\u3002\u672c\u5f53\u306fSSD\u306b\u524d\u63d0\u3067\u7d44\u3080\u306e\u304c\u826f\u3044\u3067\u3059\u304c\u3001\u5927\u5bb9\u91cf\u306eSSD\u306f\u9ad8\u3044\u306e\u3067\u3001\u4ee3\u308f\u308a\u306bUSB\u30e1\u30e2\u30ea\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u58ca\u308c\u305f\u3089\u3001\u8cb7\u3044\u76f4\u305b\u3070\u826f\u3044\u3057\u3002<\/p>\n<p>(\u8ffd\u8a18 2014-03-30 20:31 \u5b9f\u969b\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001L2ARC\u306bSSD\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059\u3002USB\u30e1\u30e2\u30ea\u306f\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3002)<\/p>\n<pre># gpart destroy da0\r\n# gpart create -s gpt da0\r\n# gpart show\r\n# gpart add -s 60532925 -t freebsd-zfs -l l2arc da0<\/pre>\n<h3>3. \u30c7\u30fc\u30bf\u7528\u30c7\u30a3\u30b9\u30af\u306e\u6e96\u5099<\/h3>\n<p>\u30c7\u30fc\u30bf\u30d7\u30fc\u30eb\u7528\u306e\u30c7\u30a3\u30b9\u30af\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u6a5f\u68b0\u7684\u306b\u4f5c\u696d\u3092\u9032\u3081\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001GPT\u3092\u7834\u58ca\u3057\u307e\u3059\u3002<\/p>\n<pre># gpart destroy ada1\r\n# gpart destroy ada2\r\n# gpart destroy ada3\r\n# gpart destroy ada4<\/pre>\n<p>GPT\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre># gpart create -s gpt ada1\r\n# gpart create -s gpt ada2\r\n# gpart create -s gpt ada3\r\n# gpart create -s gpt ada4<\/pre>\n<p>ZFS\u3068\u3057\u3066\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u3001\u30e9\u30d9\u30eb\u540d\u3092\u4e0e\u3048\u307e\u3059\u3002<\/p>\n<pre># gpart add -t freebsd-zfs -l disk0 ada1\r\n# gpart add -t freebsd-zfs -l disk1 ada2\r\n# gpart add -t freebsd-zfs -l disk2 ada3\r\n# gpart add -t freebsd-zfs -l disk3 ada4<\/pre>\n<h3>4. ZFS\u30ab\u30fc\u30cd\u30eb\u306e\u30ed\u30fc\u30c9<\/h3>\n<p>ZFS\u95a2\u9023\u306e\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u306a\u3044\u3068\u3001zpool, zfs\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n<pre># kldload opensolaris\r\n# kldload zfs<\/pre>\n<h3>5. \u30b7\u30b9\u30c6\u30e0\u7528\u30d7\u30fc\u30eb(rpool)\u306e\u4f5c\u6210<\/h3>\n<pre># zpool create -o altroot=\/media rpool \/dev\/gpt\/zroot\r\n# zfs create rpool\/root\r\n# zfs create rpool\/root\/tmp\r\n# zfs create rpool\/root\/var\r\n# zfs create rpool\/root\/usr\r\n# zfs create rpool\/root\/usr\/local\r\n# zfs create -o compression=lzjb -o setuid=off rpool\/root\/usr\/ports\r\n# zfs create -o compression=off -o exec=off -o setuid=off rpool\/root\/usr\/ports\/distfiles\r\n# zfs create -o compression=off -o exec=off -o setuid=off rpool\/root\/usr\/ports\/packages<\/pre>\n<p>\/usr\/ports\u306f\u3001\u5727\u7e2e\u3092\u304b\u3051\u308b\u8a2d\u5b9a\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h3>6. \u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306e\u4f5c\u6210<\/h3>\n<pre># zpool create upool raidz1 \/dev\/gpt\/disk0 \/dev\/gpt\/disk1 \/dev\/gpt\/disk2 \/dev\/gpt\/disk3\r\ncannot mount '\/upool': failed to create mountpoint\r\n# zpool status -v upool<\/pre>\n<p>\u30a8\u30e9\u30fc\u306f\u51fa\u305f\u3051\u308c\u3069\u3001upool\u81ea\u4f53\u306f\u3067\u304d\u3066\u3044\u308b\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>(\u8ffd\u8a18 2017-06-14 20:01 &#8220;\/&#8221;\u304cread only\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001&#8221;\/upool&#8221;\u3092\u4f5c\u308c\u306a\u304b\u3063\u305f\u3068\u8a00\u3046\u30a8\u30e9\u30fc\u3067\u3059\u3002)<\/p>\n<pre># zfs create upool\/home\r\n# zfs set mountpoint=\/media\/usr\/home upool\/home<\/pre>\n<p>mount\u3059\u308b\u306e\u306f\u30012\u6bb5\u76ee\u306b\u3057\u307e\u3059\u3002\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092zfs recv\u3067\u30ea\u30b9\u30c8\u30a2\u3059\u308b\u6642\u306b\u7c21\u5358\u306b\u3059\u308b\u70ba\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u3001\u6b21\u306e\u30da\u30fc\u30b8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308bPDF\u306e45\u30da\u30fc\u30b8\u76ee\u3092\u3054\u89a7\u4e0b\u3055\u3044\u3002(\u8ffd\u8a18 2017-06-14 20:01 https\u3067\u3064\u306a\u3050\u6642\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u3002\u63a5\u7d9a\u306f\u3084\u3081\u3066\u304a\u3044\u305f\u65b9\u304c\u7121\u96e3\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002)<\/p>\n<ul>\n<li><a href=\"https:\/\/www.bsdconsulting.co.jp\/CGI\/BSDC.CGI?CNT=FREEBSDSTUDY_2012120701\" target=\"_blank\">BSD Consulting, Inc.<\/a><\/li>\n<\/ul>\n<h3>7. ZIL\u3068L2ARC\u306e\u8a2d\u5b9a<\/h3>\n<p>ZIL\u3068L2ARC\u306f\u3001\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306b\u5bfe\u3057\u3066\u52b9\u304f\u69d8\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre># zpool add upool cache gpt\/l2arc\r\n# zpool add upool log gpt\/zil<\/pre>\n<h3>8. rc.conf\u3068loader.conf\u306e\u8a2d\u5b9a<\/h3>\n<p>ZFS\u30b7\u30b9\u30c6\u30e0\u3092\u8d77\u52d5\u6642\u306b\u30de\u30a6\u30f3\u30c8\u3059\u308b\u70ba\u306e\u65b9\u6cd5\u3067\u3059\u3002\u30de\u30a6\u30f3\u30c8\u306b\u306f\u3001zpool.cache\u3068\u8a00\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u5fc5\u8981\u3060\u305d\u3046\u3067\u3059\u3002\u305d\u308c\u3092\u4f5c\u308b\u70ba\u306e\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<pre># mkdir -p \/media\/root\/boot\r\n# mkdir -p \/media\/root\/boot\/zfs\r\n# mkdir -p \/media\/root\/etc\r\n# echo 'zfs_enable=\"YES\"' &gt;&gt; \/media\/root\/etc\/rc.conf\r\n# echo 'zfs_load=\"YES\"' &gt;&gt; \/media\/root\/boot\/loader.conf\r\n# echo 'vfs.root.mountfrom=\"zfs:rpool\/root\"' &gt;&gt; \/media\/root\/boot\/loader.conf\r\n# mount -t tmpfs tmpfs \/tmp\r\n# zfs umount -a\r\n# zpool export rpool\r\n# zpool export upool\r\n# zpool import -o cachefile=\/tmp\/zpool.cache -o altroot=\/media rpool\r\n# zpool import -o cachefile=\/tmp\/zpool.cache -o altroot=\/media upool\r\n# cp \/tmp\/zpool.cache \/media\/root\/boot\/zfs\/\r\n# zfs umount -a\r\n# umount \/tmp<\/pre>\n<h3>9. \u30b7\u30b9\u30c6\u30e0\u7528\u30d7\u30fc\u30eb(rpool)\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a<\/h3>\n<p>\u4eca\u307e\u3067\u4f5c\u3063\u3066\u6765\u305fZFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u3001\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre># zpool set bootfs=rpool\/root rpool\r\n# zpool set cachefile=\"\" rpool\r\n# zfs set mountpoint=none rpool\r\n# zfs set mountpoint=\/ rpool\/root\r\n# zfs set mountpoint=\/tmp rpool\/root\/tmp\r\n# zfs set mountpoint=\/var rpool\/root\/var\r\n# zfs set mountpoint=\/usr rpool\/root\/usr\r\n# zfs set mountpoint=\/usr\/local rpool\/root\/usr\/local\r\n# zfs set mountpoint=\/usr\/ports rpool\/root\/usr\/ports\r\n# zfs set mountpoint=\/usr\/ports\/distfiles rpool\/root\/usr\/ports\/distfiles\r\n# zfs set mountpoint=\/usr\/ports\/packages rpool\/root\/usr\/ports\/packages\r\n# zfs get -r mountpoint rpool<\/pre>\n<p>&#8220;zfs get&#8221;\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u305d\u3046\u3067\u3059\u3002\u79c1\u306e\u5834\u5408\u3001\u6b21\u306e\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130428zfs_rpool.png\" alt=\"\u30b7\u30b9\u30c6\u30e0\u7528\u30d7\u30fc\u30eb\" width=\"480\" height=\"151\" class=\"alignnone size-full wp-image-7999\" srcset=\"https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130428zfs_rpool.png 480w, https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130428zfs_rpool-150x47.png 150w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<h3>10. \u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a<\/h3>\n<p>\u540c\u69d8\u306b\u3001\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb(upool)\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre># zpool set cachefile=\"\" upool\r\n# zfs set mountpoint=none upool\r\n# zfs set mountpoint=\/usr\/home upool\/home\r\n# zfs get -r mountpoint upool<\/pre>\n<p>&#8220;zfs get&#8221;\u30b3\u30de\u30f3\u30c9\u306e\u7d50\u679c\u306f\u3001\u6b21\u306e\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130429zfs_hpool.png\" alt=\"\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb\" width=\"480\" height=\"56\" class=\"alignnone size-full wp-image-8000\" srcset=\"https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130429zfs_hpool.png 480w, https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130429zfs_hpool-150x18.png 150w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<h3>11. \u30b7\u30b9\u30c6\u30e0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u3044\u3088\u3044\u3088\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u3002<del datetime=\"2017-06-14T11:00:38+00:00\">\u79c1\u306e\u5834\u5408\u3001\u306a\u305c\u304b\u3001\u3044\u3063\u305f\u3093export\u3057\u3066\u304b\u3089\u518dimport\u3057\u306a\u3044\u3068\u3001\u30c7\u30a3\u30b9\u30af\u304c\u898b\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/del><\/p>\n<pre># zpool export rpool\r\n# zpool export upool\r\n# zpool import -o altroot=\/media rpool\r\n# zpool import -o altroot=\/media upool<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\n<pre># tar xzpvf \/usr\/freebsd-dist\/base.txz -C \/media\r\n# tar xzpvf \/usr\/freebsd-dist\/src.txz -C \/media\r\n# tar xzpvf \/usr\/freebsd-dist\/kernel.txz -C \/media\r\n# tar xzpvf \/usr\/freebsd-dist\/ports.txz -C \/media<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u7d42\u308f\u3063\u305f\u3089\u3001\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002\u6b63\u3057\u304f\u8a2d\u5b9a\u3067\u304d\u3066\u3044\u305f\u3089\u3001\u8d77\u52d5\u3059\u308b\u306f\u305a\u3067\u3059\u3002root\u3078\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3055\u3048\u3082\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3001\u518d\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>(\u8ffd\u8a18 2013-08-04 01:02)<\/p>\n<p>\u30c7\u30fc\u30bf\u7528\u30d7\u30fc\u30eb\u306e\u540d\u524d\u3092\u3001&#8221;hpool&#8221;\u304b\u3089&#8221;upool&#8221;\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u624b\u9806\u305d\u306e\u3082\u306e\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>(\u8ffd\u8a18 2013-09-26 22:10)<\/p>\n<p>\u30e9\u30d9\u30eb\u540d\u306e\u4ed8\u3051\u65b9\u304c\u6c17\u6301\u3061\u60aa\u304b\u3063\u305f\u306e\u3067\u3001\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002\u624b\u9806\u305d\u306e\u3082\u306e\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>(\u8ffd\u8a18 2014-03-30 20:31)<\/p>\n<p>\u5b9f\u969b\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001L2ARC\u306bSSD\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059\u3002USB\u30e1\u30e2\u30ea\u306f\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3002USB\u30e1\u30e2\u30ea\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u6240\u3001\u4e0a\u624b\u304f\u884c\u304b\u306a\u304b\u3063\u305f\u4e8b\u304c\u4e3b\u306a\u7406\u7531\u3067\u3059\u3002<\/p>\n[amazonjs asin=\"B00Y32OHNM\" locale=\"JP\"]\n","protected":false},"excerpt":{"rendered":"<p>FreeBSD\u52c9\u5f37\u30b7\u30ea\u30fc\u30ba\u306e\u4e00\u74b0\u3067\u3059\u3002 FreeBSD\u306e\u52c9\u5f37\u4e2d: \u30d7\u30e9\u30b9\u03b1\u7a7a\u9593 (2012\u5e7411\u67083\u65e5) FreeBSD\u3067\u306e\u9b45\u529b\u3068\u8a00\u3048\u3070\u3001\u3084\u306f\u308a\u3001ZFS\u3002\u8272\u3005\u8abf\u3079\u3066\u3044\u305f\u3089\u3001boot\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u4ee5\u5916\u3092\u3001ZFS\u306b\u3057\u3066\u30a4\u30f3\u30b9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7999,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u65b0\u3057\u3044\u8a18\u4e8b\u300eFreeBSD9\u3067Full ZFS\u30b7\u30b9\u30c6\u30e0\u4f5c\u6210\u306e\u5b9f\u9a13[\u8ffd\u8a18\u3042\u308a]\u300f\u3092\u6295\u7a3f\u3057\u307e\u3057\u305f\u3002\u8aad\u3093\u3067\u3044\u305f\u3060\u3051\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[59,5],"tags":[],"class_list":["post-7985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nas","category-computer"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/oichinote.com\/plus\/files\/2013\/04\/20130428zfs_rpool.png","jetpack-related-posts":[{"id":20537,"url":"https:\/\/oichinote.com\/plus\/2017\/06\/install-freebsd11-with-hand-made-partition.html","url_meta":{"origin":7985,"position":0},"title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092shell\u3067\u8a2d\u5b9a\u3057\u3066Root on ZFS\u306bFreeBSD11\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2017\u5e746\u670814\u65e5","format":false,"excerpt":"FreeBSD10\u306e\u5165\u3063\u305fZPOOL\u304b\u3089\u5225\u306e\u30c7\u30a3\u30b9\u30af\u306b\u30ea\u30b9\u30c8\u30a2\u3057\u3088\u3046\u3068\u3057\u307e\u3057\u305f\u304c\u3046\u307e\u304f\u3044\u304b\u305a\u3001Fre\u2026","rel":"","context":"FreeBSD","block_context":{"text":"FreeBSD","link":"https:\/\/oichinote.com\/plus\/category\/freebsd"},"img":{"alt_text":"Install\u958b\u59cb","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2017\/06\/20170614freebsd-1-install.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":11051,"url":"https:\/\/oichinote.com\/plus\/2014\/03\/cannot-recover-from-zfs-error.html","url_meta":{"origin":7985,"position":1},"title":"ZFS\u3067\u306e\u30c7\u30a3\u30b9\u30af\u30a8\u30e9\u30fc\u3001\u56de\u5fa9\u3067\u304d\u307e\u305b\u3093","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2014\u5e743\u67087\u65e5","format":false,"excerpt":"\u3057\u3070\u3089\u304f\u524d\u304b\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u30b5\u30fc\u30d0\u306b\u3057\u3066\u3044\u308bFreeBSD\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0(ZFS\u4f7f\u7528)\u3067\u3001\u30a8\u30e9\u30fc\u304c\u8d77\u2026","rel":"","context":"FreeBSD","block_context":{"text":"FreeBSD","link":"https:\/\/oichinote.com\/plus\/category\/freebsd"},"img":{"alt_text":"ZFS mirror","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2014\/03\/20140307zfs-mirror3.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8922,"url":"https:\/\/oichinote.com\/plus\/2013\/08\/install-netatalk-3-0-4-on-freebsd-9-1.html","url_meta":{"origin":7985,"position":2},"title":"FreeBSD 9.1\u306bnetatalk 3.0.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb[\u8ffd\u8a18\u3042\u308a]","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2013\u5e748\u67088\u65e5","format":false,"excerpt":"FreeBSD 9.1\u3092\u642d\u8f09\u3057\u305f\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u307e\u3057\u305f\u3002Full ZFS\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u307e\u3060\u4eee\u904b\u7528\u4e2d\u3067\u3001\u30e6\u2026","rel":"","context":"Mac","block_context":{"text":"Mac","link":"https:\/\/oichinote.com\/plus\/category\/mac"},"img":{"alt_text":"NAS\u6027\u80fd\u6bd4\u8f03","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2013\/08\/20130808nas-performance-comparison.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":10146,"url":"https:\/\/oichinote.com\/plus\/2013\/11\/add-mirroring-disks-to-existed-zfs-pool.html","url_meta":{"origin":7985,"position":3},"title":"ZFS\u3067\u65e2\u5b58\u30d7\u30fc\u30eb\u306b\u30df\u30e9\u30fc\u30c7\u30a3\u30b9\u30af\u3092\u8ffd\u52a0\u3059\u308b","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2013\u5e7411\u670821\u65e5","format":false,"excerpt":"FreeBSD 9.1\u3092\u30b5\u30fc\u30d0\u306b\u3057\u3066\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002 FreeBSD\u306b\u30b5\u30fc\u30d0\u7528\u30bd\u30d5\u30c8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u2026","rel":"","context":"NAS","block_context":{"text":"NAS","link":"https:\/\/oichinote.com\/plus\/category\/nas"},"img":{"alt_text":"ZFS\u69cb\u6210","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2013\/11\/20131121freebsd-zfs.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":10620,"url":"https:\/\/oichinote.com\/plus\/2014\/01\/hfs-vs-zfs.html","url_meta":{"origin":7985,"position":4},"title":"HFS+(SSD)\u5bfeZFS(SSD+HDD)\u30d9\u30f3\u30c1\u30de\u30fc\u30af","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2014\u5e741\u670815\u65e5","format":false,"excerpt":"\u79c1\u304c\u3001FIO\u3092\u4f7f\u3063\u3066\u7c21\u6613\u7684\u306b\u6e2c\u5b9a\u3057\u305f\u7269\u306a\u306e\u3067\u3001\u9593\u9055\u3063\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u307e\u305f\u3001\u30de\u30b7\u30f3\u30b9\u30da\u30c3\u30af\u3082\u540c\u3058\u2026","rel":"","context":"Mac","block_context":{"text":"Mac","link":"https:\/\/oichinote.com\/plus\/category\/mac"},"img":{"alt_text":"Sequential Read 1G","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2014\/01\/20140115benchmark-seqread1G.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":20256,"url":"https:\/\/oichinote.com\/plus\/2017\/06\/mooving-the-system-pool-to-another-disk.html","url_meta":{"origin":7985,"position":5},"title":"FreeBSD\u306eRoot on ZFS\u30b7\u30b9\u30c6\u30e0\u306e\u5225\u30c7\u30a3\u30b9\u30af\u3078\u306e\u79fb\u884c","author":"\u304a\u5e02\u306e\u304b\u305f","date":"2017\u5e746\u670817\u65e5","format":false,"excerpt":"FreeBSD10\u306eRoot\u3067\u4f7f\u3063\u3066\u3044\u308b\u30d7\u30fc\u30eb(rpool)\u3092\u5225\u306e\u30c7\u30a3\u30b9\u30af\u306b\u30b3\u30d4\u30fc\u3057\u3001\u305d\u306e\u30c7\u30a3\u30b9\u30af\u304b\u2026","rel":"","context":"FreeBSD","block_context":{"text":"FreeBSD","link":"https:\/\/oichinote.com\/plus\/category\/freebsd"},"img":{"alt_text":"Install\u958b\u59cb","src":"https:\/\/i0.wp.com\/oichinote.com\/plus\/files\/2017\/06\/20170614freebsd-1-install.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/posts\/7985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/comments?post=7985"}],"version-history":[{"count":22,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/posts\/7985\/revisions"}],"predecessor-version":[{"id":20563,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/posts\/7985\/revisions\/20563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/media\/7999"}],"wp:attachment":[{"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/media?parent=7985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/categories?post=7985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oichinote.com\/plus\/wp-json\/wp\/v2\/tags?post=7985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}