{"id":605,"date":"2010-04-06T08:05:05","date_gmt":"2010-04-06T00:05:05","guid":{"rendered":"http:\/\/pony.hk\/?p=605"},"modified":"2025-04-19T07:23:26","modified_gmt":"2025-04-18T23:23:26","slug":"solaris-10-x86%e7%b3%bb%e7%bb%9f%e7%9b%98%e5%81%9a%e9%95%9c%e5%83%8f%e6%ad%a5%e9%aa%a4%ef%bc%88%e5%b7%b2%e6%b5%8b%e8%af%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lnmp.ivan.xin\/?p=605","title":{"rendered":"solaris 10 x86\u7cfb\u7edf\u76d8\u505a\u955c\u50cf\u6b65\u9aa4\uff08\u5df2\u6d4b\u8bd5\uff09"},"content":{"rendered":"<p>\u84dd\u8272\u4e3a\u8f93\u5165\u547d\u4ee4\uff0c\u6a59\u9ec4\u8272\u662f\u6267\u884c\u547d\u4ee4\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<p>1. First we should be sure have two identical harddisks in the server<\/p>\n<pre> # format\r\n Searching for disks...done\r\n AVAILABLE DISK SELECTIONS:\r\n       0. c0d0 &lt;DEFAULT cyl 1563 alt 2 hd 255 sec 63&gt;\r\n          \/pci@0,0\/pci-ide@7,1\/ide@0\/cmdk@0,0\r\n       1. c0d1 &lt;DEFAULT cyl 1563 alt 2 hd 255 sec 63&gt;\r\n          \/pci@0,0\/pci-ide@7,1\/ide@0\/cmdk@1,0\r\n Specify disk (enter its number): ^C<\/pre>\n<p>2. Its need to create small slice for metadb information (usually slice 7)<br \/>\nlike:<\/p>\n<pre>   partition&gt; p\r\n Current partition table (unnamed):\r\n Total disk cylinders available: 1563 + 2 (reserved cylinders)\r\n\r\n Part      Tag    Flag     Cylinders        Size            Blocks\r\n   0       root    wm     518 - 1562        8.01GB    (1045\/0\/0) 16787925\r\n   1       swap    wu       3 -  133        1.00GB    (131\/0\/0)   2104515\r\n   2     backup    wm       0 - 1562       11.97GB    (1563\/0\/0) 25109595\r\n   3 unassigned    wm       0               0         (0\/0\/0)           0\r\n   4 unassigned    wm       0               0         (0\/0\/0)           0\r\n   5 unassigned    wm       0               0         (0\/0\/0)           0\r\n   6 unassigned    wm       0               0         (0\/0\/0)           0\r\n   7 unassigned    wm     134 -  135       15.69MB    (2\/0\/0)       32130\r\n   8       boot    wu       0 -    0        7.84MB    (1\/0\/0)       16065\r\n   9 alternates    wu       1 -    2       15.69MB    (2\/0\/0)       32130<\/pre>\n<p>3. Next step is to create the same partitions on the second disk. To avoid<br \/>\nhuman error it is much better to use some kind of automations:<\/p>\n<pre> prtvtoc \/dev\/rdsk\/c0d0s2 &gt; \/tmp\/c0d0s2.toc\r\n fmthard -s \/tmp\/c0d0s2.toc \/dev\/rdsk\/c0d1s2<\/pre>\n<p>4. Then we should identify the partitions need to be mirrored:<\/p>\n<pre> # egrep \"ufs|swap\" \/etc\/vfstab|grep \"\/dev\/dsk\"\r\n \/dev\/dsk\/c0d0s1 -       -       swap    -       no      -\r\n \/dev\/dsk\/c0d0s0 \/dev\/rdsk\/c0d0s0        \/       ufs     1       no      -<\/pre>\n<p><a name=\"LVM\"><\/a><\/p>\n<h2>LVM<\/h2>\n<p>1. Let\u2019s create few copies of metadb on the partitions we create for this<br \/>\npuspose:<\/p>\n<pre> # metadb -a -f -c 2 c0d0s7 c0d1s7<\/pre>\n<p>2. It\u2019s time to put our disks where OS reside under management of SVM<\/p>\n<pre> # metainit -f d10 1 1 c0d0s0\r\n d10: Concat\/Stripe is setup\r\n # metainit -f d11 1 1 c0d0s1\r\n d11: Concat\/Stripe is setup\r\n # metainit d0 -m d10\r\n d0: Mirror is setup\r\n # metainit d1 -m d11\r\n d1: Mirror is setup\r\n # metaroot d0 \r\n # echo \"set md:mirrored_root_flag=1\" &gt;&gt; \/etc\/system<\/pre>\n<p>3. Check newly created devices:<\/p>\n<pre> # ls -l \/dev\/md\/rdsk\r\n total 8\r\n lrwxrwxrwx   1 root     root          36 Aug 30 18:29 d0 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,0,raw\r\n lrwxrwxrwx   1 root     root          36 Aug 30 18:29 d1 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,1,raw\r\n lrwxrwxrwx   1 root     root          37 Aug 30 18:28 d10 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,10,raw\r\n lrwxrwxrwx   1 root     root          37 Aug 30 18:28 d11 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,11,raw\r\n # ls -l \/dev\/md\/dsk\r\n total 8\r\n lrwxrwxrwx   1 root     root          36 Aug 30 18:29 d0 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,0,blk\r\n lrwxrwxrwx   1 root     root          36 Aug 30 18:29 d1 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,1,blk\r\n lrwxrwxrwx   1 root     root          37 Aug 30 18:28 d10 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,10,blk\r\n lrwxrwxrwx   1 root     root          37 Aug 30 18:28 d11 -&gt; ..\/..\/..\/devices\/pseudo\/md@0:0,11,blk<\/pre>\n<p>4. Make appropriate changes in \/etc\/vfstab to get boot from mirror, not<br \/>\nstandard disks<\/p>\n<pre> # egrep \"ufs|swap\" \/etc\/vfstab|grep \"\/dev\/md\/dsk\"\r\n \/dev\/md\/dsk\/d1  -       -       swap    -       no      -\r\n \/dev\/md\/dsk\/d0  \/dev\/md\/rdsk\/d0 \/       ufs     1       no      -<\/pre>\n<p>5. The next step is to flush cache buffers and reboot<\/p>\n<pre> # sync;sync;sync\r\n # reboot<\/pre>\n<p>6. It is time to put second disk under management of SVN<\/p>\n<pre> # metainit -f d20 1 1 c0d1s0\r\n d20: Concat\/Stripe is setup\r\n # metainit -f d21 1 1 c0d1s1\r\n d21: Concat\/Stripe is setup<\/pre>\n<p>7. And to add them to created previously mirrors. Be aware process of<br \/>\nsynchronisation will continue in background and you can check the process<\/p>\n<pre> # metattach d0 d20\r\n d0: submirror d20 is attached\r\n # metattach d1 d21\r\n d1: submirror d21 is attached<\/pre>\n<p>8. Check the process of building mirrors and wait till they finnish<\/p>\n<pre> # metastat\r\n d1: Mirror\r\n     Submirror 0: d11\r\n       State: Okay\r\n     Submirror 1: d21\r\n       State: Resyncing\r\n     Resync in progress: 96 % done\r\n     Pass: 1\r\n     Read option: roundrobin (default)\r\n     Write option: parallel (default)\r\n     Size: 2104515 blocks (1.0 GB) \r\n\r\n d11: Submirror of d1\r\n     State: Okay\r\n     Size: 2104515 blocks (1.0 GB)\r\n     Stripe 0:\r\n         Device   Start Block  Dbase        State Reloc Hot Spare\r\n         c0d0s1          0     No            Okay   Yes \r\n\r\n\r\n d21: Submirror of d1\r\n     State: Resyncing\r\n     Size: 2104515 blocks (1.0 GB)\r\n     Stripe 0:\r\n         Device   Start Block  Dbase        State Reloc Hot Spare\r\n         c0d1s1          0     No            Okay   Yes\r\n \r\n\r\n d0: Mirror\r\n     Submirror 0: d10\r\n       State: Okay\r\n     Submirror 1: d20\r\n       State: Resyncing\r\n     Resync in progress: 13 % done\r\n     Pass: 1\r\n     Read option: roundrobin (default)\r\n     Write option: parallel (default)\r\n     Size: 16787925 blocks (8.0 GB) \r\n\r\n d10: Submirror of d0\r\n     State: Okay\r\n     Size: 16787925 blocks (8.0 GB)\r\n     Stripe 0:\r\n         Device   Start Block  Dbase        State Reloc Hot Spare\r\n         c0d0s0          0     No            Okay   Yes\r\n\r\n\r\n d20: Submirror of d0\r\n     State: Resyncing\r\n     Size: 16787925 blocks (8.0 GB)\r\n     Stripe 0:\r\n         Device   Start Block  Dbase        State Reloc Hot Spare\r\n         c0d1s0          0     No            Okay   Yes\r\n\r\n\r\n Device Relocation Information:\r\n Device   Reloc  Device ID\r\n c0d1   Yes      id1,cmdk@AVMware_Virtual_IDE_Hard_Drive=01000000000000000001\r\n c0d0   Yes      id1,cmdk@AVMware_Virtual_IDE_Hard_Drive=00000000000000000001<\/pre>\n<p><a name=\"Boot\"><\/a><\/p>\n<h2>Boot<\/h2>\n<p>1. Next step is to check if partition on second disk is active<\/p>\n<pre> # fdisk \/dev\/rdsk\/c0d1p0\r\n             Total disk size is 1566 cylinders\r\n             Cylinder size is 16065 (512 byte) blocks\r\n\r\n                                               Cylinders\r\n      Partition   Status    Type          Start   End   Length    %\r\n      =========   ======    ============  =====   ===   ======   ===\r\n          1       Active    Solaris2          1  1565    1565    100\r\n\r\n\r\n SELECT ONE OF THE FOLLOWING:\r\n    1. Create a partition\r\n    2. Specify the active partition\r\n    3. Delete a partition\r\n    4. Change between Solaris and Solaris2 Partition IDs\r\n    5. Exit (update disk configuration and exit)\r\n    6. Cancel (exit without updating disk configuration)\r\n Enter Selection: 5<\/pre>\n<p>2. And to add boot record to the second disk to make it bootable<\/p>\n<pre> # \/sbin\/installgrub \/boot\/grub\/stage1 \/boot\/grub\/stage2 \/dev\/rdsk\/c0d1s0\r\n stage1 written to partition 0 sector 0 (abs 16065)\r\n stage2 written to partition 0, 233 sectors starting at 50 (abs 16115)<\/pre>\n<p>3. Add new item in the boot menu (\/boot\/grub\/menu.lst) to have alternative<br \/>\nway to boot<\/p>\n<p># vi \/boot\/grub\/menu.lst \u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre> title Alternate boot\r\n root (hd1,0,a)\r\n kernel \/platform\/i86pc\/multiboot\r\n module \/platform\/i86pc\/boot_archive<\/pre>\n<p>4. Check if the new item is added to the boot menu<\/p>\n<pre> # bootadm list-menu\r\n The location for the active GRUB menu is: \/boot\/grub\/menu.lst\r\n default 0\r\n timeout 10\r\n 0 Solaris 10 5\/08 s10x_u5wos_10 X86\r\n 1 Solaris failsafe\r\n 2 Alternate boot<\/pre>\n<p>5. That\u2019s all, you have already mirrored root partition (plus swap)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u84dd\u8272\u4e3a\u8f93\u5165\u547d\u4ee4\uff0c\u6a59\u9ec4\u8272\u662f\u6267\u884c\u547d\u4ee4\u7684\u8f93\u51fa\u7ed3\u679c\u3002 1. First we should be sure have ...<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28202],"tags":[],"class_list":["post-605","post","type-post","status-publish","format-standard","hentry","category-os-ns"],"_links":{"self":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=605"}],"version-history":[{"count":1,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":606,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/605\/revisions\/606"}],"wp:attachment":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}