免费注册 查看新帖 |

Chinaunix

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

Sun DiskSuite 磁盘管理软件常用命令使用实例 [复制链接]

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-23 15:08 |只看该作者 |倒序浏览


                                                         文档作者:白一峰

一. 环境描述:
1.  硬件:Sun’s workstation or server
          Sun’s storage ,array or mutipack
2.        软件:Solaris 2.6,7,8
Sun’s Disksuite software

二. 如何制做及确认RAID 0、RAID1、RAID0+1、RAID5、及HOT SPARE
1. 如何制做及确认RAID 0
①     How to create a concatenated metadevice
特性:不安全模式,若有一块盘坏,整个卷就被破坏了。
# metainit device height width component(s) width component(s) width component(s) …..
note: metainit--------------command
    device---------------metadevice name in the form d###(d0-127 by the default)
    height---------------number of stripes in the concat metadevice
    width----------------number of slice within the stripe
    component(s)------which physical slice(s) comprise the stripe
For explame:
# metainit d0 1 1 /dev/dsk/c0t0d0s3
This create concatenate metadevice d0 out of a signal partition /dev/dsk/c0t0ed0s3
# metainit d1 2 1 /dev/dsk/c0t0d0s1 1 /dev/dsk/c0t0d0s5
This create concatenate metadevice d1 out of two slices,/dev/dsk/c0t0d0s1 and /dev/dsk/c0t0d0s5.
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d0
# metastat d1
②     How to create a stripe metadevice
# metainit device height width component component …..-i interlace
For example:
# metainit d2 1 2 /dev/dsk/c0t0d0s4 /dev/dsk/c0t0d0s5 –i 32k
note: This create striped metadevice d2 out of two slices: /dev/dsk/c0t0d0s4 and /dev/dsk/c0t0d0s5. The metadevice use the interlace value of 32Kbytes.
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d2
  2.   如何制做及确认RAID 1
特性:安全模式,但是浪费硬盘空间。
Create a two-way metamirror using the metainit command
# metainit metadevice –m concatenate-1 concatenate-2
For example:
# metainit /dev/md/dsk/d3 –m /dev/md/dsk/d4 /dev/md/dsk/d5
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d3
  3.  如何制做及确认RAID 0+1
   特性:安全模式,但是浪费硬盘空间。
   制作过程:
a.       先建两个submirror
b.       把一个submirror先加入mirror中
c.       在把另一个submirror加入mirror中
d.       mirror建立完成。
For example:
# metainit d6 1 1 /dev/dsk/c0t0d0s5
# metainit d7 1 1 /dev/dsk/c0t1d0s6
# meatinit d8 –m d6
# metattach d8 d7
此例子中,每个submirror中只有一个component,也可以在每个submirror中建立多个component.
For example:
# metainit d9 3 1 /dev/dsk/c0t0d0s0 2 /dev/dsk/c0t0d0s3 /dev/dsk/c0t0d0s4 1 /dev/dsk/c0t0d0s5
# metainit d10 3 1 /dev/dsk/c0t1d0s0 2 /dev/dsk/c0t1d0s3 /dev/dsk/c0t1d0s4 1 /dev/dsk/c0t1d0s5
# metainit d11 –m d9
# metattach d11 d10
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d6
# metastat d11
  4.  如何制做及确认RAID5
How to create a Raid5 metadevice
# metainit metadevice –r comp1 comp2 comp3 …..-i interlace
For example:
# metainit /dev/md/dsk/d12 –r /dev/dsk/c0t0d0s3 /dev/dsk/c0t0d0s4 /dev/dsk/c0t0d0s5 –i 8k
This creates a Raid-5 metadevice(d12) with an interlace of 8Kbytes across three components : /dev/dsk/c0t0d0s3 /dev/dsk/c0t0d0s4 /dev/dsk/c0t0d0s5.
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d12

三. 如何更换RAID 5 volume 中的坏硬盘
使用命令: metareplace
# metareplace  metadevice  component_old  component_new
For example:
# metareplace d13 c0t0d0s6 c0t0d0s6
# metareplace d13 c0t0d0s5 c0t0d0s7
note: component_old和component_new可以是同一个slice,也可以是不同的slice.

四. 如何更换 RAID 0+1 volume中的坏硬盘
a)         用metareplace命令
# metareplace metadevice component_old component_new
For example:
#metareplace d14 c0t0d0s5 c0t0d0s5
若以上方法不行,可以用第二种方法。
b)        比如d15是mirror,d16和d17是两个submirror. 假如d17坏.
# metadetach d15 d17
#metaclear d17
以上两步操作是把坏的submirror删除掉.把新的硬盘更换上,分好区,在把submirror恢复.
# metainit d17 1 1 /dev/dsk/c0t0d0s5
# metattach d15 d17
这样就把submirror(d17)重新加入到mirror(15)中了.
制作完成后,可以用metastat命令察看结果和Raid级别。
# metastat d15

五. 如何在线扩充RAID 5 volume 的容量
① 运行metastat命令查看Raid中所有设备的状态,确认所有硬盘的状态是OK的。
用下面的命令查看:
      #/usr/opt/SUNWmd/sbin/metastat d10      
②  若Raid5的状态是stable,则使用metattach命令将新的slice加入到这个metadevice中。
用下面的命令实现:
      # /usr/opt/SUNWmd/sbin/metattach d10 /dev/dsk/c5t0d0s2      
    新加入的这个slice一定要与Raid5中的其他slice大小一致,若此slice的容量比其他的slice大,则多余的空间就浪费掉了。
③  当新加入的组件在做初始化时,可以用metastat命令查看其状态。当初始化完成时,即状态由initializing变成OK,Raid就可以重新使用了。
      # /usr/opt/SUNWmd/sbin/metastat d10
④ 使用growfs命令来挂接文件系统。
      # growfs /dev/md/rdsk/d10 -M /test
   /test是挂接点。
六.如何制作用于双机系统的DISKSET,及DISKSET 模式下的各种RAID
结构的制作与维护,及DISKSET在双机系统之间的切换操作
  ① 两台主机分别安装操作系统及推荐的patch
     两主机均留出一个供metadb使用的小分区。
② 正确连接主机及阵列后,
     更改其中一台主机的scsi-initiator-id,另一台先不开机
     方法如下:进入ok状态下
     ok setenv  auto-boot?  True
     ok reset-all
     ok probe-scsi-all  记录显示的阵列中控制器的物理路径,
[email=如/pci@4,4000/scsi@3及]如/pci@4,4000/scsi@3及[/email]
/pci@4,4000/scsi@3,1,以下以此为例
     ok nvedit
         0:probe-all  install-console  banner
      1:cd  /pci@4,4000/scsi@3
      2:6  “  scsi-initiator-id”  integer-property   将scsi-initiator-id改为6
      3:device-end
      4:cd  /pci@4,4000/scsi@3,1
      5: 6  “  scsi-initiator-id”  integer-property
      6:device-end
      7:banner  (ctrl+c)
     ok nvstore
     ok setenv  use-nvramrc?  True
     ok setenv  auto-boot?   True
     ok reset-all
   至此,两台主机可同时开机进入操作系统。用format 命令可分别看到9块硬盘,且保证阵列上的8块硬盘在两台主机上的物理路径名与逻辑设备名完全相同。
③ 在两台主机上分别建立metadb,其中仅包含本主机内置硬盘内予留小分区,以保证下一步制做共享的diskset.
④ 在每台主机上的/etc/hosts 文件中添入对方的IP及主机名,同时创建/.rhosts 文件,文件内容为加号(+)。
⑤ 在其中一台主机上建立共享的DiskSet
#metaset  –s  diskset-name  –a  –h  hostname1  hostname2
diskset-name  建立的DiskSet的名称
hostname1  hostname2 应与 /etc/nodename  相同
-a -h 参数将DiskSet 映射到两台主机上。
⑥ 将共享的8块硬盘加入DiskSet
# metaset  –s  diskset-name  –a  drivername 。。。
drivername 要加入的硬盘,格式为c?t?d? 。
完成以上步骤后,即可使用metatool –s diskset-name & 图形工具来建立RAID,不用在建立metadb,Diskset自己会建立metadb。
⑦ #newfs  /dev/md/diskset-name/rdsk/d0
d0为metatool 在DISKSET上建立的RAID。
⑧ 要切换DISKSET时
# metaset  –s  diskset-name   –r
一台主机放弃对阵列的管理
# metaset  –s  diskset-name  –f  –t
另一台主机接管阵列


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/524/showart_103779.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP