I have been asked about configuration about disksuite in every interview,so I searched the following article to study!
作者:unixsoft 发表时间:2003/01/12 04:35pm
(一) 安装Disksuite:
(1) Disksuite4.2
操作系统 : solaris7
软件包位置: easy access server
执行路径 : /usr/opt/SUNWmd/sbin
配置路径 : /etc/opt/SUNWmd/
设备名目录: /dev/md/dsk /dev/md/rdsk
(2) Disksuite4.2.1
操作系统 : solaris8
软件包位置: /sol_8_401_sparc_2/Solaris_8/EA/products/DiskSuite_4.2.1
执行路径 : /usr/sbin
配置路径 : /etc/lvm
设备名目录: /dev/md/dsk /dev/md/rdsk
图形界面可以执行installer程序,命令行状态可用pkgadd安装。
安装结束后reboot,root用户登陆运行disksuite软件。
(二) 图形界面运行
# metatool &
1.Trans 2.RAID 3.MIRROR 4.Concat/Stipe 5.Hot-spare
使用左键选中,中键拖动,右键激活
(1)建立metadb状态数据库
1) 首先在每个做RAID的磁盘上划出一个10MB的分区(如:S7)
2) 拖动s7分区创建metaDB
3) 提交
(2)建立Raid对象
1) 建立Concat/Stripe/RAID5
选择RAID对象,将分区拖入对象,提交
2) 建立镜象
选择Concat/Stripe对象,分别将盘1,盘2拖入目标
选择MIRROR对象,分别将上列创建的对象拖入目标
3) 建立hot-spare
选择hot-spare对象,将分区拖入对象,提交
完成后,将hot-spare-pool分配给相关RAID
(3) 在metatool界面内可以看到RAID的完成情况,也可以运行
# /usr/sbin/metastat [RAID_name]
(4) RAID完成后,可做文件系统并挂接:
# newfs /dev/md/rdsk/RAID_name
# mount /dev/md/dsk/RAID_name /mnt
(三) 命令行方式:
(1) 创建metadb状态数据库:
# /metadb -a -f dev_name1 dev_name2 ...
-a: 增加状态数据库
-d: 删除状态数据库
-f: 强制执行状态数据库的操作
-e count: 一个分区建立多个状态数据库
# metadb -a -c 2 c1t2d0s3 (添加状态数据库;-c 2 option adds two state database)
(2) 建立concatenation:
# metainit d1 3 1 dev_name1 1 dev_name2 1 dev_name3
(3) 建立stripe:
# metainit d2 1 3 dev_name1 dev_name2 dev_name3
(4) 建立mirror:
# metainit d21 1 1 dev_name1 (sub_mir1)
# metainit d22 1 1 dev_name2 (sub_mir2)
# metainit d20 -m d31
# metattach d20 d22
(5) 建立RAID5:
# metainit d10 -r dev_name1 dev_name2 ...
(6) 建立hot-spare:
# metainit hsp001 dev_name1 dev_name2 ... (建立HSP)
# metaparam -h hap001 d21 (将HSP交RAID使用)
# metaparam -h hap001 d22 (将HSP交RAID使用)
增加hsp:
# metahs -a hsp001 d21
改变hsp:
# metastat d21
d21: RAID
State: Okay
Hot spare pool: hsp001
...
# metaparam -h hsp002 d21
# metastat d21
d21: RAID
State: Okay
Hot spare pool: hsp002
...
(四) 建立系统盘镜像
镜像盘容量要大于或等于系统盘
(1) 建立concat of root
# metainit -f d11 1 1 c0t0d0s0
d11: Concat/Stripe is setup
(2) 建立concat of mirror partition
# metainit d12 1 1 c1t3d0s0
d12: Concat/Stripe is setup
(3) 建立镜像
# metainit d10 -m d11
d10: Mirror is setup
(4) 建立根镜像
# metaroot d10
# lockfs -fa (锁定文件系统)
# reboot (TAB表将被自动修改)
...
# metattach d10 d12
d10: Submirror d12 is attached
# ls -l /dev/rdsk/c1t3d0s0
lrwxrwxrwx 1 root root 88 Feb 8 15:51 /dev/rdsk/c1t3d0s0 ->../../devices/iommu@f,e0000000/vme@f,df010000/SUNW,pn@4d,1080000/ipi3sc@0,0/id@3,0:a,raw
(5) 在PROM下修改启动设备名,使镜像盘也能够启动系统
OK> setenv boot-device boot-disk mir-disk
(6) 实例 -- usr or swap的镜像
# metainit -f d12 1 1 c0t3d0s6
d12: Concat/Stripe is setup
# metainit d22 1 1 c1t0d0s6
d22: Concat/Stripe is setup
# metainit d2 -m d12
d2: Mirror is setup
# vi /etc/vfstab
# reboot
...
# metattach d2 d22
d2: Submirror d22 is attached
(7) TAB表的修改
1) /usr的镜像
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 yes -
应改为:/dev/md/dsk/d2 /dev/md/rdsk/d2 /usr ufs 1 yes -
2) swap的镜像
/dev/dsk/c0t0d0s1 - - swap - no -
应改为:/dev/md/dsk/d1 - - swap - no -
(五) 状态查询
(1) metadb状态
# metatool &
Okey/ Attention/ Critical
# metadb -i
flags first blk block count
a m p luo 16 1034 /dev/dsk/c0t8d0s4
a p luo 16 1034 /dev/dsk/c0t8d0s7
a p luo 16 1034 /dev/dsk/c0t8d0s6
o - replica active prior to last mddb configuration change
u - replica is up to date
l - locator for this replica was read successfully
c - replica's location was in /etc/lvm/mddb.cf
p - replica's location was patched in kernel
m - replica is master, this is replica selected as input
W - replica has device write errors
a - replica is active, commits are occurring to this replica
M - replica had problem with master blocks
D - replica had problem with data blocks
F - replica had format problems
S - replica is too small to hold current data base
R - replica had device read errors
(2) RAID及其组成的状态
# metastat [RAID_name]
1) okey: 正常状态,RAID可用
2) maintenance: 单个磁盘有故障,需维护
3) maintenance/last erred: 有超过一个磁盘故障,需维护。但数据可能是假的
(六) RAID故障的恢复(MIRROR or RAID 5)
(1) 数据备份
(2) 将新磁盘分区与故障盘保持一致
(3) 用新盘做替换
# metareplace -e RAID_name dev_name_old(在原有的位置替代磁盘)
# metareplace [-f] RAID_name dev_name_old dev_name_new(用别的位置磁盘替代)
-f选项用于maintenance/last erred状态,但仍有可能无法成功完成
(4) 此时RAID处于syncing状态,并显示百分比
# metastat RAID_name
(5) syncing完成后,recovery即完成
(七) OS崩溃时RAID的恢复
(1) Disksuite有一个配置文件/etc/lvm/md.tab,手工将RAID的建立过程记录于该文件中并备份到它处
(2) OS崩溃后,重新安装OS及Disksuite
(3) 重新生成metadb
(4) 将备份的md.tab文件传至/etc/lvm下
(5) 检查/etc/lvm/md.tab文件的语法
# metainit -n -a
(6) 建立/etc/lvm/md.tab中所有的RAID
# metainit -a
(7) 完成后,可直接挂接文件系统,原数据仍然存在
(8) 注意事项
1) 对于MIRROR,需要手工加入sub_mir2,执行
# metattach d20 d22,
2) 对于RAID5,需用-k选项,否则会初始化RAID5,丢失数据
# metainit d10 -r dev_name1 dev_name2 dev_name3 -k -o 3
-o 3: 组成RAID5的设备数量
3) 附一个md.tab文件
(八) 失效恢复
(1) vfstab失效恢复
1) fsck /dev/md/rdsk/d0
2) mount -o rw /dev/md/dsk/d0 /
3) metaroot d0
4) reboot
(2)无充分metadb恢复
1) boot
2) metadb -i (查看metadb)
3) metadb -d -f c1t2d0s3 (删除metadb)
4) metadb -i (查看metadb)
5) reboot
6) metadb -a -c 2 c1t2d0s3 (添加状态数据库;-c 2 option adds two state database)
(3)boot device失效
1) boot disk2
2) metadb (查看坏的state database)
3) metastat (查看坏的sub-mirror)
4) halt (修复坏硬盘)
5) metadb -d c0t3d0s3 (删除坏的state database)
6) metadb -c 2 -a c0t3d0s3 (重新建立新的state database)
7) metareplace -e d0 c0t3d0s0 (替换镜像盘)
阅读(1281) | 评论(0) | 转发(0) |