{"id":744,"date":"2010-02-23T16:53:39","date_gmt":"2010-02-23T08:53:39","guid":{"rendered":"http:\/\/blog.pighead.cc\/whsyu\/?p=744"},"modified":"2012-02-02T16:10:25","modified_gmt":"2012-02-02T08:10:25","slug":"freebsd-zfsboot","status":"publish","type":"post","link":"https:\/\/blog.pighead.cc\/whsyu\/2010\/02\/23\/freebsd-zfsboot\/","title":{"rendered":"FreeBSD zfsboot"},"content":{"rendered":"<p class=\"bb-post-separator\"><strong>[\u83ef\u8a9e, cmn-Hant-TW]  <\/strong><\/p><h3>\u5b89\u88dd<\/h3>\n<p>\u60f3\u8981\u628a\u4e00\u53f0 FreeBSD 8.0 \u6a5f\u5668\u786c\u789f\u5347\u7d1a\uff0c\u60f3\u8aaa\u4e7e\u8106\u63db\u6210 GPT \u5f04\u500b\u7d14 zfs \u7684\u74b0\u5883\u4f86\u7528\u770b\u770b\u3002\u5728\u5b98\u7db2\u7684 wiki \u6709\u63d0\u5230\u5728<a href=\"http:\/\/mfsbsd.vx.sk\/\">\u9019\u88e1<\/a>\u53ef\u4ee5\u4e0b\u8f09\u5b89\u88dd\u5149\u789f\uff0c\u88e1\u9762\u6709\u4e00\u500b zfsinstall \u7684 script \u53ef\u4ee5\u5e6b\u5fd9\u628a FreeBSD \u5b89\u88dd\u5230\u4e00\u9846\u4e7e\u6de8\u7684\u786c\u789f\u88e1\u9762\uff0c\u76f4\u63a5\u4e0b\u8f09\u9644\u6709\u5305\u597d\u4e00\u4efd FreeBSD\/amd64 dist \u7684 special edition \u6bd4\u8f03\u65b9\u4fbf\uff0c\u4e0d\u7136\u5c31\u5f97\u81ea\u5df1\u5305\u4e00\u4efd\u9935\u7d66 zfsinstall \u5403\u3002<\/p>\n<p>\u5b89\u88dd\u904e\u7a0b\u5f88\u5feb\uff0c\u4e0d\u904e\u91cd\u958b\u6a5f\u5f8c\u602a\u4e8b\u5c31\u767c\u751f\u4e86\uff0c\u958b\u6a5f\u5c45\u7136\u6703\u5361\u5728\u958b\u6a5f\u786c\u789f\u6383\u7784\u7684\u756b\u9762\uff1f\uff01\u4e00\u958b\u59cb\u63a8\u6e2c\u662f GPT \u7684\u554f\u984c\uff0c\u628a\u786c\u789f\u6e05\u6389\u4e4b\u5f8c\u679c\u7136\u5c31\u4e0d\u5361\u4e86\uff0c\u9019\u5be6\u5728\u6c92\u5565\u9053\u7406\uff0c\u5f8c\u4f86\u628a\u786c\u789f\u62ff\u53bb\u7528 Mac \u7684\u78c1\u789f\u5de5\u5177\u7a0b\u5f0f\u5206\u5272\u6210 GUID \u5206\u5272\u8868 (\u5373 GPT)\uff0c\u4e00\u8a66\u5c45\u7136\u4e5f\u4e0d\u6703\u5361\uff0c\u90a3\u554f\u984c\u662f\u5728\u54ea\uff1f \u518d\u6df1\u5165\u4ea4\u53c9\u6e2c\u8a66\u767c\u73fe\u539f\u4f86\u53ea\u8981\u7528 gpart create -s GPT \u6307\u4ee4\u505a\u51fa\u4f86\u7684\u5206\u5272\u8868\u958b\u6a5f\u7684\u6642\u5019\u5c31\u6703\u5361\u4f4f\uff0c\u5c31\u7b97\u88e1\u9762\u662f\u7a7a\u7684\u4e5f\u4e00\u6a23\uff0cMac \u7684\u5247\u4e0d\u6703\u3002\u6240\u4ee5\u7d50\u8ad6\u5c31\u662f<strong>\u7528 FreeBSD \u7684 gpart \u5728 WD 6400AAKS \u4e0a\u7522\u751f\u7684 GPT \u6703\u8b93 MSI K8N Neo4-FI \u4e3b\u6a5f\u677f\u5361\u5728\u786c\u789f\u6383\u7784\u756b\u9762<\/strong>\uff0c\u81f3\u65bc\u554f\u984c\u662f\u8ab0\u9020\u6210\u7684\u6211\u5c31\u4e0d\u77e5\u9053\u4e86\u3002<\/p>\n<p>\u65e2\u7136 Mac OS X \u7522\u751f\u51fa\u4f86\u7684 GPT \u6c92\u554f\u984c\uff0c\u90a3\u5c31\u7528 Mac OS X \u505a\u4e00\u500b\u7a7a\u6bbc\u3002\u56e0\u70ba Mac \u5728\u5206\u5272\u7684\u6642\u5019\u6703\u5f88\u8cbc\u5fc3\u7684\u9806\u4fbf\u585e EFI \u4e4b\u985e\u7684\u6771\u897f\u9032\u53bb\uff0c\u6240\u4ee5\u5728\u5b89\u88dd\u524d\u8981\u5148\u7528 gpart delete \u6307\u4ee4\u628a\u6240\u6709\u5206\u5272\u5340\u780d\u6389\u53ea\u7559 GPT\u3002\u7136\u5f8c zfsinstall \u4e5f\u9700\u8981\u4fee\u6539\uff0c\u56e0\u70ba\u4ed6\u4e00\u958b\u59cb\u6703\u6aa2\u67e5\u78ba\u8a8d\u786c\u789f\u662f\u5426\u70ba\u5168\u7a7a\uff0c\u8981\u628a\u90a3\u6bb5\u8a3b\u89e3\u6389\u6216\u662f\u8b93\u4ed6\u6aa2\u67e5\u6c92\u904e\u6642\u4e0d\u6703\u8df3\u51fa\uff0c\u7136\u5f8c gpart create \u7684\u90e8\u4efd\u4e5f\u8981\u8a3b\u89e3\u6389\uff0c\u56e0\u70ba\u4e8b\u5148\u5df2\u7528 Mac \u4e4b\u5de5\u5177\u505a\u597d GPT \u4e86\uff0c\u4e00\u5207\u9806\u5229\u7684\u8a71\uff0c\u5b89\u88dd\u5b8c\u91cd\u65b0\u958b\u6a5f\u5c31\u53ef\u4ee5\u9032\u53bb\u6574\u9846\u90fd\u662f zfs \u7684\u7cfb\u7d71\u4e86\u3002<\/p>\n<h3>\u79fb\u52d5<\/h3>\n<p>\u8981\u628a\u820a\u7684\u7cfb\u7d71\u79fb\u5230\u65b0\u7684\u7cfb\u7d71\u554f\u984c\u4e0d\u5927\uff0c\u7528\u820a\u786c\u789f\u958b\u6a5f\u4e0b\u624b\u52d5\u5c07\u65b0\u786c\u789f\u7684 zfs dataset ( \/root \/var \/tmp \/usr )\u00a0\u639b\u8f09\u4e0a\u53bb\u5f8c\u76f4\u63a5\u7528 rsync \u628a\u65e2\u6709\u8cc7\u6599\u84cb\u5230\u65b0\u786c\u789f\u4e0a\u7684\u76f8\u5c0d\u4f4d\u7f6e\u5373\u53ef\uff0c\u84cb\u5b8c\u4e4b\u5f8c\u8981\u518d\u4fee\u6539\u5169\u8655<\/p>\n<h5>\/boot\/loader.conf<\/h5>\n<pre lang=\"bash\">zfs_load=\"YES\"\r\nvfs.root.mountfrom=\"zfs:data\/root\"<\/pre>\n<h5>\/etc\/fstab<\/h5>\n<pre lang=\"bash\">\/dev\/gptid\/78e0d9bd-1fac-11df-bc9c-0210dc9db087 none swap sw 0 0\r\ndata\/usr \/usr zfs rw 0 0\r\ndata\/var \/var zfs rw 0 0\r\ndata\/tmp \/tmp zfs rw 0 0<\/pre>\n<p>data \u662f zfs pool \u7684\u540d\u5b57\uff0czfsinstall \u6642\u53ef\u4ee5\u4e0b\u53c3\u6578\u6307\u5b9a\uff0c\/etc\/fstab \u4e2d swap \u7684 gptid \u53ef\u4ee5\u7528 zfs status \u67e5\u5230\uff0c\u4e8b\u5be6\u4e0a\u9019\u5169\u500b\u6a94\u6848\u5728 zfsinstall \u5b89\u88dd\u6642\u90fd\u6703\u8a2d\u5b9a\u597d\uff0c\u4e0d\u904e\u628a\u820a\u786c\u789f\u8cc7\u6599\u8907\u88fd\u5230\u65b0\u786c\u789f\u6642\u5f88\u6709\u53ef\u80fd\u6703\u88ab\u84cb\u6389\uff0c\u6240\u4ee5\u8981\u518d\u78ba\u8a8d\u4fee\u6539\u3002<\/p>\n<p>\u4e00\u5207\u9806\u5229\u7684\u8a71\u7528\u65b0\u786c\u789f\u91cd\u958b\u6a5f\u61c9\u8a72\u53ef\u4ee5\u770b\u5230\u539f\u4f86\u7684\u7cfb\u7d71\u53c8\u8dd1\u8d77\u4f86\u4e86\uff0c\u5dee\u5225\u53ea\u662f\u786c\u789f\u8b8a\u5927\u3001\u6839\u76ee\u9304\u8b8a zfs \u800c\u5df2 (\u8f15\u63cf\u6de1\u5beb\u8c8c)\u3002<\/p>\n<p>update: (2011-12-01)<br \/>\n\u88dc\u5145\u4e00\u4e0b\uff0croot partition \u4e0d\u8981\u7528 gzip\uff0c\u4e0d\u7136\u6703\u958b\u4e0d\u4e86\u6a5f\uff0czfsv28 \u7684 dedup \u5012\u662f\u6c92\u5dee\u53ef\u4ee5\u76f4\u63a5\u5728 root \u958b<br \/>\nhttp:\/\/www.freebsd.org\/cgi\/query-pr.cgi?pr=153173<\/p>\n<p>update: (2012-02-02)<br \/>\n\u8a66\u904e\u53e6\u4e00\u9846 SSD \u5728\u539f\u4f86\u90a3\u53f0\u6a5f\u5668\u4e0a\u4e00\u6a23\u6703\u5361\uff0c\u770b\u4f86\u662f\u9019\u5f35\u4e3b\u6a5f\u677f\u6703\u6311\u3002\u9084\u6709\u5c31\u662f\u5f8c\u4f86\u7684\u7248\u672c\u53ef\u4ee5\u4e0d\u7528 legacy \u6a21\u5f0f\u639b\u8f09 \/usr \/var \u7b49\uff0c\u518d\u642d\u914d<a href=\"http:\/\/wiki.freebsd.org\/RootOnZFS#ZFS_Swap_Volume\">\u76f4\u63a5\u5728 zfs volume \u4e0a\u958b swap<\/a> \u7684\u8a71\u90a3\u5c31\u53ef\u4ee5\u5b8c\u5168\u4e0d\u7528 \/etc\/fstab \uff0c\u9019\u6a23\u5c31\u66f4\u6709 zfs \u7684\u5473\u9053\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u83ef\u8a9e, cmn-Hant-TW] \u5b89\u88dd \u60f3\u8981\u628a\u4e00\u53f0 FreeBSD 8.0 \u6a5f\u5668\u786c\u789f\u5347\u7d1a\uff0c\u60f3\u8aaa\u4e7e\u8106\u63db\u6210 GPT \u5f04\u500b\u7d14 zfs \u7684\u74b0\u5883\u4f86\u7528\u770b\u770b\u3002\u5728\u5b98\u7db2\u7684 wiki \u6709\u63d0\u5230\u5728\u9019\u88e1\u53ef\u4ee5\u4e0b\u8f09\u5b89\u88dd\u5149\u789f\uff0c\u88e1\u9762\u6709\u4e00\u500b zfsinstall \u7684 script \u53ef\u4ee5\u5e6b\u5fd9\u628a FreeBSD \u5b89\u88dd\u5230\u4e00\u9846\u4e7e\u6de8\u7684\u786c\u789f\u88e1\u9762\uff0c\u76f4\u63a5\u4e0b\u8f09\u9644\u6709\u5305\u597d\u4e00\u4efd FreeBSD\/amd64 dist \u7684 special edition \u6bd4\u8f03\u65b9\u4fbf\uff0c\u4e0d\u7136\u5c31\u5f97\u81ea\u5df1\u5305\u4e00\u4efd\u9935\u7d66 zfsinstall \u5403\u3002 \u5b89\u88dd\u904e\u7a0b\u5f88\u5feb\uff0c\u4e0d\u904e\u91cd\u958b\u6a5f\u5f8c\u602a\u4e8b\u5c31\u767c\u751f\u4e86\uff0c\u958b\u6a5f\u5c45\u7136\u6703\u5361\u5728\u958b\u6a5f\u786c\u789f\u6383\u7784\u7684\u756b\u9762\uff1f\uff01\u4e00\u958b\u59cb\u63a8\u6e2c\u662f GPT \u7684\u554f\u984c\uff0c\u628a\u786c\u789f\u6e05\u6389\u4e4b\u5f8c\u679c\u7136\u5c31\u4e0d\u5361\u4e86\uff0c\u9019\u5be6\u5728\u6c92\u5565\u9053\u7406\uff0c\u5f8c\u4f86\u628a\u786c\u789f\u62ff\u53bb\u7528 Mac \u7684\u78c1\u789f\u5de5\u5177\u7a0b\u5f0f\u5206\u5272\u6210 GUID \u5206\u5272\u8868 (\u5373 GPT)\uff0c\u4e00\u8a66\u5c45\u7136\u4e5f\u4e0d\u6703\u5361\uff0c\u90a3\u554f\u984c\u662f\u5728\u54ea\uff1f \u518d\u6df1\u5165\u4ea4\u53c9\u6e2c\u8a66\u767c\u73fe\u539f\u4f86\u53ea\u8981\u7528 gpart create -s&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[4591,225,226,191,107],"class_list":["post-744","post","type-post","status-publish","format-standard","hentry","category-freebsd","tag-freebsd","tag-gpart","tag-gpt","tag-guid","tag-zfs"],"_links":{"self":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/comments?post=744"}],"version-history":[{"count":13,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":748,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/744\/revisions\/748"}],"wp:attachment":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/media?parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/categories?post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/tags?post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}