{"id":2027,"date":"2011-12-05T15:06:46","date_gmt":"2011-12-05T13:06:46","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=2027"},"modified":"2015-09-24T10:46:59","modified_gmt":"2015-09-24T07:46:59","slug":"zfs-root-mirror","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=2027","title":{"rendered":"ZFS Root Mirror"},"content":{"rendered":"<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c <a title=\"\u0441\u0442\u0430\u0442\u044c\u0438\" href=\"http:\/\/darkstar-solaris.blogspot.com\/2008\/09\/zfs-root-mirror.html\" target=\"_blank\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>\u00a0+ \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/span><\/strong><\/p>\n<p>\u0412\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043d\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0436\u0451\u0442\u0441\u043a\u0438\u0439 \u0434\u0438\u0441\u043a \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <strong>mirror<\/strong> \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <strong>zpool<\/strong>: \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0441\u043a, \u0430 \u0435\u0449\u0451 \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 (\u0441 <strong>grub&#8217;om<\/strong> \u043d\u0430 \u0431\u043e\u0440\u0442\u0443)<\/p>\n<p><em><strong><span style=\"color: #008000;\">\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434<\/span><\/strong><\/em>: <strong>Solaris Express 11\/11.1<\/strong>, \u0434\u0438\u0441\u043a\u0438:\u00a0<strong>c4t0d0s0<\/strong> (\u0441\u0442\u0430\u0440\u044b\u0439),\u00a0<strong>c4t1d0s0<\/strong> (\u043d\u043e\u0432\u044b\u0439)<\/p>\n<p><!--more--><\/p>\n<h2><strong><span style=\"color: #0000ff;\">Solaris 11.1<\/span><\/strong><\/h2>\n<p>\u0422\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0438 \u0434\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438: \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435<\/p>\n<p><code>#zpool attach -f rpool\u00a0c4t0d0s0 c4t1d0s0<\/code><\/p>\n<p>\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0443\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>11.1<\/strong> \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430\u00a0<strong>EFI (GPT)<\/strong>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u0438\u0441\u043a, \u0442\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p><em><strong><span style=\"color: #ff6600;\">&#8211; \u0435\u0441\u043b\u0438 \u043f\u0443\u043b \u043d\u0430 \u0434\u0438\u0441\u043a\u0430\u0445<\/span><\/strong><\/em> (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0443\u043b\u0435 \u0434\u0438\u0441\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a <strong>c4t0d0<\/strong>, <strong>c4t1d0<\/strong>):<\/p>\n<p><code># bootadm install-bootloader c4t1d0s1<\/code><\/p>\n<p><em><strong><span style=\"color: #ff6600;\">&#8211; \u0435\u0441\u043b\u0438 \u043f\u0443\u043b \u043d\u0430 \u0441\u043b\u0430\u0439\u0441\u0430\u0445<\/span><\/strong><\/em> (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0443\u043b\u0435 \u0434\u0438\u0441\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a <strong>c4t0d0s0<\/strong>, <strong>c4t1d0s0<\/strong>):<\/p>\n<p><code># bootadm install-bootloader c4t1d0s0<\/code><\/p>\n<h2><strong><span style=\"color: #0000ff;\">Solaris 11<\/span><\/strong><\/h2>\n<p><strong><span style=\"color: #ff0000;\">1) \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0441\u043a\u0430<\/span><\/strong><\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p><code># format<\/code><\/p>\n<p>\u0438 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u041d\u041e\u0412\u042b\u0419 \u0434\u0438\u0441\u043a. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <strong>fdisk<\/strong> \u0438 \u0443\u0431\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b (\u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0435\u0441\u0442\u044c). \u0415\u0441\u043b\u0438 \u0434\u0438\u0441\u043a \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b <strong>Solaris<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043b\u0430\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442 \u0434\u0438\u0441\u043a (<strong>100%<\/strong>), \u0442\u0438\u043f <strong>Solaris2<\/strong> \u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0438\u0441\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<p><code>Cylinders<br \/>\nPartition Status Type Start End Length %<br \/>\n========= ====== ============ ===== === ====== ===<br \/>\n1 Active Solaris2 1 4094 4094 100<\/code><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <strong>6 (Save and exit)<\/strong> \u00a0\u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c <strong>quit<\/strong>.<\/p>\n<p><strong><span style=\"color: #ff0000;\">2) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432.<\/span><\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043d\u0430 \u043d\u043e\u0432\u044b\u0439<\/p>\n<p><code># prtvtoc \/dev\/rdsk\/c4t0d0s2\u00a0| fmthard -s - \/dev\/rdsk\/c4t1d0s2<\/code><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 <strong>\u0421\u0422\u0410\u0420\u042b\u0419<\/strong> \u0434\u0438\u0441\u043a, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; <strong>\u041d\u041e\u0412\u042b\u0419<\/strong>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u0430 \u0434\u0438\u0441\u043a\u043e\u0432 \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430<strong> s2<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0430\u043c\u043e\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438 &#8220;\u043d\u0430 \u0433\u043b\u0430\u0437&#8221; \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c:<\/p>\n<pre># prtvtoc \/dev\/rdsk\/c4t0d0s2\r\n* \/dev\/rdsk\/c4t0d0s2 partition map\r\n*\r\n* Dimensions:\r\n*     512 bytes\/sector\r\n*      63 sectors\/track\r\n*     255 tracks\/cylinder\r\n*   16065 sectors\/cylinder\r\n*   30400 cylinders\r\n*   30398 accessible cylinders\r\n*\r\n* Flags:\r\n*   1: unmountable\r\n*  10: read-only\r\n*\r\n*                          First     Sector    Last\r\n* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory\r\n       0      2    00      16065 488327805 488343869\r\n       2      5    01          0 488376000 488375999\r\n       8      1    01          0     16065     16064<\/pre>\n<p><strong><span style=\"color: #ff0000;\">3) \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043a\u0430 \u0432 \u043f\u0443\u043b.<\/span><\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u0438\u0441\u043a \u0432 \u043f\u0443\u043b:<\/p>\n<p><code>#zpool attach -f rpool\u00a0c4t0d0s0 c4t1d0s0<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0434\u0451\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u0439\u0434\u0430. \u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0435\u0439\u0434\u0430 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443.<\/p>\n<p><strong><span style=\"color: #ff0000;\">4) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430.<\/span><\/strong><\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0441 \u0434\u0438\u0441\u043a\u0430, \u0432 \u0435\u0433\u043e <strong>mbr&#8217;e<\/strong> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 (\u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430):<\/p>\n<p><code>#installgrub -m \/boot\/grub\/stage1 \/boot\/grub\/stage2 \/dev\/rdsk\/c4t1d0s0<\/code><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 <strong>s2<\/strong><\/p>\n<p><strong><span style=\"color: #ff0000;\">5) \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435.<\/span><\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0443\u043b \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<pre># zpool status\r\n  pool: rpool\r\n state: ONLINE\r\n  scan: resilvered 21.1G in 0h3m with 0 errors on Fri Dec  2 15:17:55 2011\r\nconfig:\r\n\r\n        NAME          STATE     READ WRITE CKSUM\r\n        rpool         ONLINE       0     0     0\r\n          mirror-0    ONLINE       0     0     0\r\n            c4t0d0s0  ONLINE       0     0     0\r\n            c4t1d0s0  ONLINE       0     0     0\r\n\r\nerrors: No known data errors<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438\u00a0+ \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0412\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043d\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0436\u0451\u0442\u0441\u043a\u0438\u0439 \u0434\u0438\u0441\u043a \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c mirror \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c zpool: \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0441\u043a, \u0430 \u0435\u0449\u0451 \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 (\u0441 grub&#8217;om \u043d\u0430 \u0431\u043e\u0440\u0442\u0443) \u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434: Solaris Express 11\/11.1, \u0434\u0438\u0441\u043a\u0438:\u00a0c4t0d0s0 (\u0441\u0442\u0430\u0440\u044b\u0439),\u00a0c4t1d0s0 (\u043d\u043e\u0432\u044b\u0439)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-2027","post","type-post","status-publish","format-standard","hentry","category-solaris"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2027"}],"version-history":[{"count":14,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions"}],"predecessor-version":[{"id":4853,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions\/4853"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}