{"id":618,"date":"2017-06-15T23:07:00","date_gmt":"2017-06-15T20:07:00","guid":{"rendered":"https:\/\/blog.officesupport.ru\/?p=618"},"modified":"2023-12-15T23:20:57","modified_gmt":"2023-12-15T20:20:57","slug":"freebsd-%d1%80%d1%83%d1%87%d0%bd%d0%b0%d1%8f-%d1%80%d0%b0%d0%b7%d0%bc%d0%b5%d1%82%d0%ba%d0%b0-%d0%b4%d0%b8%d1%81%d0%ba%d0%b0-%d1%81-%d0%bf%d0%be%d0%bc%d0%be%d1%89%d1%8c%d1%8e-gpartzfs","status":"publish","type":"post","link":"https:\/\/blog.officesupport.ru\/?p=618","title":{"rendered":"FreeBSD \u0440\u0443\u0447\u043d\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0438\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gpart+ZFS"},"content":{"rendered":"\n<p>gpart create -s gpt ada0<br>gpart add -t freebsd-boot -s 512 ada0<br>gpart bootcode -b \/boot\/pmbr -p \/boot\/gptzfsboot -i 1 ada0<br>gpart add -t freebsd-swap -s 1024M ada0<br>gpart add -t freebsd-zfs ada0<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 zfs \u043f\u0443\u043b\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c zroot \u043d\u0430 3\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \/mnt<br>zpool create -m \/mnt zroot \/dev\/ada0p3<\/p>\n\n\n\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0443\u043b:<br>zpool list<\/p>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u043d\u0430 \u043f\u0443\u043b\u0435 zroot:<br>zfs create zroot\/var<br>zfs create zroot\/usr<br>zfs create zroot\/tmp<\/p>\n\n\n\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b:<br>df -H<\/p>\n\n\n\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:<br>exit<\/p>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 zfs \u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<br>echo &#8216;zfs_enable=&#187;YES&#187;&#8216; &gt;&gt; \/etc\/rc.conf<br>echo &#8216;vfs.zfs.prefetch_disable=0&#8217; &gt;&gt; \/boot.loader.conf<br>echo &#8216;vm.kmem_size=330M&#8217; &gt;&gt; \/boot.loader.conf<br>echo &#8216;vm.kmem_size_max=330M&#8217; &gt;&gt; \/boot.loader.conf<\/p>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c swap \u0440\u0430\u0437\u0434\u0435\u043b:<br>ee \/etc\/fstab<br>\/dev\/ada0p2 none swap sw 0 0<\/p>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u0441\u044f, \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434 Boot Single User Mode (2\u0439 \u043f\u0443\u043d\u043a\u0442)<\/p>\n\n\n\n<p>\u041f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c zfs \u043f\u0443\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c &#171;zroot&#187;:<br>zpool import -f zroot<\/p>\n\n\n\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<br>zpool list<\/p>\n\n\n\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044b:<br>df -H<\/p>\n\n\n\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \/mnt, \u043f\u0435\u0440\u0435\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c:<br>zfs umount -a<br>zfs set moutpoint=legacy zroot<br>zfs set moutpoint=\/var zroot\/var<br>zfs set moutpoint=\/usr zroot\/usr<br>zfs set moutpoint=\/tmp zroot\/tmp<\/p>\n\n\n\n<p>\u041f\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044b:<br>df -H<br>zpool list<\/p>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<br>zpool status -x<\/p>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 tmp:<br>zfs snapshot zroot\/tmp@01-01-14<\/p>\n\n\n\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432:<br>zfs list -t snapshot<\/p>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0430 tmp \u0438\u0437 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430:<br>zfs rollback zroot\/tmp@01-01-14<\/p>\n\n\n\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"http:\/\/snakeproject.ru\/rubric\/article.php?art=freebsd_gpart_zfs&amp;ysclid=lq6gaz8cgj465582639\" data-type=\"link\" data-id=\"http:\/\/snakeproject.ru\/rubric\/article.php?art=freebsd_gpart_zfs&amp;ysclid=lq6gaz8cgj465582639\">http:\/\/snakeproject.ru\/rubric\/article.php?art=freebsd_gpart_zfs&amp;ysclid=lq6gaz8cgj465582639<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>gpart create -s gpt ada0gpart add -t freebsd-boot -s 512 ada0gpart bootcode -b \/boot\/pmbr -p \/boot\/gptzfsboot -i 1 ada0gpart add -t freebsd-swap -s 1024M ada0gpart add -t freebsd-zfs ada0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[54,53],"class_list":["post-618","post","type-post","status-publish","format-standard","hentry","category-bsd","tag-gpart","tag-zfs"],"_links":{"self":[{"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/posts\/618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=618"}],"version-history":[{"count":1,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/posts\/618\/revisions"}],"predecessor-version":[{"id":619,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=\/wp\/v2\/posts\/618\/revisions\/619"}],"wp:attachment":[{"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.officesupport.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}