免费注册 查看新帖 |

Chinaunix

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

命令行创建RAID5(非常感谢前人的工作!) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-16 17:18 |只看该作者 |倒序浏览
1.建立分区表
partition> p
Current partition table (original):
Total disk cylinders available: 4924 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm      18 - 4690        8.00GB    (4673/0/0) 16780743
  1 unassigned    wu       0               0         (0/0/0)           0
  2 unassigned    wm       0               0         (0/0/0)           0
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0               0         (0/0/0)           0
  7 unassigned    wm       0 -   17       31.56MB    (18/0/0)      64638

2.传送分区表参数到其他硬盘
prtvtoc /dev/rdsk/c0t0d0s0|fmthard -s- /dev/rdsk/c0t1d0s0
prtvtoc /dev/rdsk/c0t0d0s0|fmthard -s- /dev/rdsk/c0t2d0s0
prtvtoc /dev/rdsk/c0t0d0s0|fmthard -s- /dev/rdsk/c0t3d0s0
prtvtoc /dev/rdsk/c0t0d0s0|fmthard -s- /dev/rdsk/c0t4d0s0
prtvtoc /dev/rdsk/c0t0d0s0|fmthard -s- /dev/rdsk/c0t5d0s0

3.建立metadb
metadb -a -f -c 3 c0t0d0s7 c0t1d0s7 c0t2d0s7

4.建立raid5(5 disks)
metainit d10 -r c0t0d0s0 c0t1d0s0 c0t2d0s0 c0t3d0s0 c0t4d0s0

5.建立HSP
metainit hsp001 c0t5d0s0

6.增加HSP到raid
metaparam -h hsp001 d10

7.验证
# metastat
d10: RAID
    State: Initializing
    Initialization in progress: 31.8% done
    Hot spare pool: hsp001
    Interlace: 32 blocks
    Size: 67119381 blocks (32 GB)
Original device:
    Size: 67121536 blocks (32 GB)
        Device     Start Block  Dbase        State Reloc  Hot Spare
        c0t0d0s0        330        No Initializing   Yes
        c0t1d0s0        330        No Initializing   Yes
        c0t2d0s0        330        No Initializing   Yes
        c0t3d0s0        330        No Initializing   Yes
        c0t4d0s0        330        No Initializing   Yes

hsp001: 1 hot spare
        Device     Status      Length   Reloc
        c0t5d0s0   Available    16780743 blocks Yes

Device Relocation Information:
Device   Reloc  Device ID
c0t5d0   Yes    id1,ssd@w20000020370984af
c0t0d0   Yes    id1,ssd@w2000002037146e50
c0t1d0   Yes    id1,ssd@w2000002037146b7e
c0t2d0   Yes    id1,ssd@w2000002037146dff
c0t3d0   Yes    id1,ssd@w2000002037146c22
c0t4d0   Yes    id1,ssd@w20000020370d7dc5

8.投入使用
#newfs /dev/md/rdsk/d10
newfs: construct a new file system /dev/md/rdsk/d10: (y/n)? y
Warning: 1 sector(s) in last cylinder unallocated
/dev/md/rdsk/d10:       67119380 sectors in 18691 cylinders of 27 tracks, 133 sectors
        32773.1MB in 1169 cyl groups (16 c/g, 28.05MB/g, 3392 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 57632, 115232, 172832, 230432, 288032, 345632, 403232, 460832, 518432,
Initializing cylinder groups:
.......................
super-block backups for last 10 cylinder groups at:
66592544, 66650144, 66707744, 66765344, 66822944, 66880544, 66938144,
66995744, 67053344, 67110944,
#mkdir /raid5
#vi /etc/vfstab
添加一行:
/dev/md/dsk/d10 /dev/md/rdsk/d10 /raid5 ufs 2 yes -
#reboot(OR mount /dev/md/dsk/d10 /raid5)

9.维护RAID5(未测试)
坏掉一个盘的恢复方法(例c0t1d0盘坏掉)
ok boot -r
#metareplace -e d10 c0t1d0s0
#metastat d10
10.操作环境
1)硬件Sun E3000 + A5200
2)系统Solaris 9

[ 本帖最后由 zhumao 于 2006-10-18 08:31 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-10-16 17:31 |只看该作者
很规范,UP一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP