{"id":84,"date":"2017-09-23T20:12:18","date_gmt":"2017-09-23T11:12:18","guid":{"rendered":"https:\/\/www.ish.org\/blog\/?p=84"},"modified":"2024-10-29T10:56:11","modified_gmt":"2024-10-29T01:56:11","slug":"conoha-vps512mb%e3%83%97%e3%83%a9%e3%83%b3%e3%81%a7freebsd-server%e3%82%92%e6%a7%8b%e7%af%89%e3%81%97%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%ef%bc%88%e3%81%9d%e3%81%ae3%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.ish.org\/blog\/?p=84","title":{"rendered":"conoha VPS(512MB\u30d7\u30e9\u30f3)\u3067FreeBSD server\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u305f\uff08\u305d\u306e3\uff09"},"content":{"rendered":"<p> vtbd0p2\u306b\u304a\u540d\u524d.com\u306edmp\u3092\u30ea\u30b9\u30c8\u30a2\u3059\u308b\u3002<!--more--><br \/>\n \u307e\u305a\u306fzfs\u306epool\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n <!--more--><code><br \/>\n# zpool create -o altroot=\/mnt -m none peach vtbd0p2<br \/>\n# zfs set compression=lz4 peach<br \/>\n# zfs create -o mountpoint=none peach\/ROOT<br \/>\n# zfs create -o mountpoint=\/ peach\/ROOT\/default<br \/>\n# zfs create -o mountpoint=\/usr peach\/usr<br \/>\n# zfs create -o mountpoint=\/var peach\/var<br \/>\n# zfs create -o mountpoint=\/usr\/local peach\/usr\/local<br \/>\n# zfs create -o mountpoint=\/usr\/ports peach\/usr\/ports<br \/>\n# zfs create -o mountpoint=\/var\/log peach\/var\/log<br \/>\n# zfs create -o mountpoint=\/var\/db peach\/var\/db<br \/>\n# zfs create -o mountpoint=\/var\/db\/freebsd-update peach\/var\/db\/freebsd-update<br \/>\n# zfs create -o mountpoint=\/var\/db\/pkg peach\/var\/db\/pkg<br \/>\n# zfs create -o mountpoint=\/var\/db\/ports peach\/var\/db\/ports<br \/>\n# zfs create -o mountpoint=\/var\/db\/portsnap peach\/var\/db\/portsnap<br \/>\n# zfs create -o mountpoint=\/home peach\/home<br \/>\n# zfs create -o mountpoint=\/usr\/local\/www peach\/usr\/local\/www<br \/>\n# zfs create -o mountpoint=\/usr\/local\/www\/apache24 peach\/usr\/local\/www\/apache24<br \/>\n# zfs create -o mountpoint=\/usr\/local\/www\/wordpress peach\/usr\/local\/www\/wordpress<br \/>\n\u307e\u305fzfs\u3067boot\u3067\u304d\u308b\u3088\u3046\u306bbootfs\u3092\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n# zpool set bootfs=peach\/ROOT\/default peach<br \/>\nswap\u306f\u53d6\u308a\u6562\u3048\u305a2GB\u78ba\u4fdd\u3057\u3066\u307f\u305f\u3002<br \/>\n# zfs create -V 2g -o org.freebsd:swap=on -o checksum=off -o compression=off -o dedup=off -o sync=disabled -o primarycache=none peach\/swap\u3002<br \/>\n\u81ea\u5b85\u306ecarrot\u304b\u3089\u4eca\u56de\u4f5c\u6210\u3059\u308bpeach\u3078scp\u3067dmp\u30d5\u30a1\u30a4\u30eb\u3092\u8ee2\u9001\u3059\u308b\u304c\u3001vtbd0p3\u306b\u306f\u4f59\u88d5\u304c\u306a\u3044\u306e\u3067zfs\u4e0a\u306e\/mnt\/usr\/local\/dmp\u3078\u8ee2\u9001\u3059\u308b\u3002<br \/>\n# mkdir \/mnt\/usr\/local\/dmp<br \/>\ncarrot% scp *.dmp.bz2 peach:\/mnt\/usr\/local\/dmp<br \/>\n\u8ee2\u9001\u901f\u5ea6\u306f50Mbps\u7a0b\u5ea6\u3002\u5408\u8a081.2GB\u5f37\u306e\u8ee2\u9001\u3060\u304c\u3001\u77ed\u6642\u9593\u3067\u5b8c\u4e86\u3002<br \/>\n\u4eca\u5ea6\u306f\u5c55\u958b\u3059\u308b\u3002<br \/>\n# cd \/mnt<br \/>\n# bzcat \/mnt\/usr\/local\/dmp\/root.dmp.bz2 | restore rf -<br \/>\n# cd \/mnt\/usr<br \/>\n# bzcat \/mnt\/usr\/local\/dmp\/usr.dmp.bz2 | restore rf -<br \/>\n\u3068\u3044\u3046\u611f\u3058\u3067\u5168\u90e8restore\u3059\u308b\u3002\u305d\u306e\u5f8c\u3001.snap\/\u3001.sujournal\u3001restoresymtable\u306f\u4e0d\u8981\u306a\u306e\u3067\u3001\u5168\u90e8\u6d88\u3059\u3002<br \/>\n\u5f8c\u306fvi \/mnt\/boot\/loader.conf\u3067<br \/>\nzfs_load=\"YES\"<br \/>\nvfs.root.mountfrom=\"zfs:peach\/ROOT\/default\"<br \/>\n\u3092\u8ffd\u52a0\u3057\u3001\/mnt\/etc\/rc.conf\u306bzfs_enable=\"YES\"\u3092\u5165\u308c\u308b\u3002\/mnt\/etc\/fstab\u306ftmpfs\u4ee5\u5916\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3002<br \/>\n\/mnt\/etc\/rc.conf\u3067ip address\u3092conoha VPS\u306b\u5408\u308f\u305b\u3066\u4fee\u6b63\u3002\u6700\u5f8c\u306bzfs boot(vtbd0p2\u304b\u3089\u8d77\u52d5)\u306b\u5207\u308a\u66ff\u3048\u308b\u3002<br \/>\n# gpart bootcode -p \/mnt\/boot\/gptzfsboot -i 1 vtbd0<br \/>\n\u3061\u306a\u307f\u306bufs boot(vtbd0p3\u304b\u3089\u8d77\u52d5)\u306b\u5207\u308a\u66ff\u3048\u308b\u306b\u306f<br \/>\n# gpart bootcode -p \/boot\/gptboot -i 1 vtbd0<br \/>\n\u3059\u308c\u3070\u826f\u3044\u3002\u6700\u5f8c\u306b<br \/>\n# reboot<br \/>\n\u3067\u7121\u4e8bvtbd0p2\u304b\u3089\u8d77\u52d5\u3059\u308c\u3070\u6210\u529f\u3002\u99c4\u76ee\u306a\u3089API\u3067disc1.iso\u3092\u5165\u308c\u3066\u518d\u8d77\u52d5\u3057\u3066shell\u3092\u8d77\u52d5\u3057\u3066\u8a2d\u5b9a\u30df\u30b9\u3092\u4fee\u6b63\u3002<br \/>\n<\/code><br \/>\n <a href=\/blog\/?p=49>\u305d\u306e2<\/a>\u3078\u623b\u308b\u3000\u3000<a href=\"\/blog\/?p=88\">\u305d\u306e4<\/a>\u3078\u7d9a\u304f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vtbd0p2\u306b\u304a\u540d\u524d.com\u306edmp\u3092\u30ea\u30b9\u30c8\u30a2\u3059\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,5],"tags":[],"class_list":["post-84","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-vps","category-zfs"],"_links":{"self":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=84"}],"version-history":[{"count":6,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions\/341"}],"wp:attachment":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}