免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4387 | 回复: 2
打印 上一主题 下一主题

请大家帮忙-在Solaris2.6下做镜像  关闭 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2001-11-24 19:04 |只看该作者 |倒序浏览
平台:Sun E450    Solaris 2.6    2个CPU400   5个20G硬盘。

需求:用一个硬盘做启动盘,另外四个两两做镜像。
  
软件:用Solaris 8 自带的SUNWmd做镜像软件

因为系统要重装,原来的镜像不是我做的。请问我该怎样做,在装完SUNWmd时打什么补丁,下面是现在系统相关的文件:

1。/etc/opt/SUNWmd/md.tab
  
            d10  -m  d11 d12
d11 1 1 /dev/dsk/c2t0d0s2
d12  1 1 /dev/dsk/c2t1d0s2

d20 -m d21 d22
d21 1 1 /dev/dsk/c2t2d0s2
d22 1 1 /dev/dsk/c2t3d0s2
2。 /etc/vfstab
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /usr ufs 1 no -
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /var ufs 1 no -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -
/dev/md/dsk/d10 /dev/md/rdsk/d10  /data1 ufs 2 yes -
/dev/md/dsk/d20 /dev/md/rdsk/d20  /data2 ufs 2 yes -


论坛徽章:
0
2 [报告]
发表于 2001-11-25 22:55 |只看该作者

Sunslove

If you have a login account on http://sunsolve.sun.com, try to login and search for SDS and Mirror to see if you can find anything.

The following shows you how to mirror root which is the most difficult task.


SYNOPSIS: SDS - How to mirror the root disk
Use this procedure to mirror the system disk partitions using Solstice DiskSuite.

Before attempting this procedure, you must have first created at least 2 state databases (replicas) on unused slices using the metadb command.

#metadb -a -f -c 2 c0t0d0s5 c1t0d0s5

The -a and -f options are used together to create the initial state database replicas. The -c 2 option puts two state database replicas on each specified slice, creating a total of four replicas. By spreading the state database replicas across controllers, you can increase metadevice performance and reliability.

Also, it is assumed that you have formatted the second disk exactly like the original root disk. Each corresponding slice on each disk must be the same size.

For this example, we will be mirroring all the slices on the root disk (c0t0d0) to another equally sized disk (c1t0d0). You will have to make the appropriate changes.

For each partition on your root disk (/, /usr, /var, /opt, /export/home, or any other partition you may have), the following commands must be run:

For each slice, you must create 3 new metadevices: one for the existing slice, one for the slice on the mirrored disk, and one for the mirror. To do this, make the appropriate entries in the md.tab[1] file. For example, for slice 0, we\'ll create the following entries:
   d10 1 1 /dev/dsk/c0t0d0s0
   d20 1 1 /dev/dsk/c1t0d0s0
   d0 -m d10                                       
As an example for slice 1, we\'ll create the following entries in the md.tab file:

   d11 1 1 /dev/dsk/c0t0d0s1
   d21 1 1 /dev/dsk/c1t0d0s1
   d1 -m d11                                       
Follow this example, creating groups of 3 entries for each slice on the root disk.

Run the metainit command to create all the metadevices you have just defined in the md.tab file. If you use the -a option, all the metadevices defined in the md.tab will be created.
   metainit -a -f                                       
The -f is required because the slices on the root disk are currently mounted.

Run the metaroot command for the metadevice you designated for the root mirror. In the example above, we created d0 to be the mirror device for the root partition, so we would run
   metaroot d0                                       
Modify the entries in the /etc/vfstab file to reflect metadevices instead of slices. Start off by making a backup copy of the file:
   cp /etc/vfstab /etc/vfstab.pre_sds                                       
Then, edit the /etc/vfstab file to change each slice to the appropriate metadevice. You will see that the metaroot command has already done this for you for the root slice. You will need to edit the swap, /usr, /var, and any other slices in the same manner. For example, you would need to change the swap device line from

   /dev/dsk/c0t0d0s1      -       -       swap    -       no      -                                       
to
   /dev/md/dsk/d1         -       -       swap    -       no      -                                       
Make sure that you change the slice to the main mirror (in this case, d1) and not to the simple submirror (in this case, d11).

Reboot the system. This step is necessary. Do not proceed without rebooting your system, or data corruption will occur.
After the system has rebooted, you can verify that root and other slices are under DiskSuite\'s control by running the
   # df -k
   # swap -l                                       
commands. The outputs of these commands should reflect the metadevice names, not the slice names.

Last, attach the second submirror to the metamirror device. This attachment, using the metattach command, must be done for each partition on the disk, and will start the syncing of data from the current root disk to the other. To continue our example, to add the mirror for root, enter the command:
   metattach d0 d20                                       
Even though this command returns to the shell prompt immediately, the syncing process has begun. To follow the progress of this syncing for this mirror, enter the command

   metastat d0                                       
Although you can run all the metattach commands one right after another, it is a good idea to run the next metattach command only after the first syncing has completed. This reduces the amount of head movement on the disk and can speed up the total time it takes to mirror all the slices on the disk.


Once you have attached all the submirrors to the metamirrors, and all the syncing has completed, your root disk is mirrored.


Meanwhile, you can also go to http://docs.sun.com to find the documents for DiskSuite.

Good luck.

论坛徽章:
0
3 [报告]
发表于 2001-11-27 00:16 |只看该作者
if you don\'t mirror the root disk, it\'s easier to do.
read the document clu65 pasted here, and also ref docs.sun.com.

you can use solstice\'s gui interface to set up mirror if you want don\'t to learn the commands.  but for your protection, it\'s better you know those commands, just in case.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP