Raid 0
假设硬盘c1t2d0s2 c1t3d0s2 c1t4d0s2 c1t5d0s2 需做Raid 0 (两块以上硬盘即可做Raid 0),步骤如下:
1.在预留50M左右的分区上创建metadb
# metadb -a -f -c 3 c1t2d0s7 c1t3d0s7 c1t4d0s7 c1t5d0s7
2.再运行Raid 0命令行
# metainit -f d0 1 4 c1t2d0s0 c1t3d0s0 c1t4d0s0 c1t5d0s0
# metastat d0 (可检查RAID 0的进度)
3、当建一个文件系统时:
# newfs /dev/md/rdsk/d0 (重建文件系统)
# mkdir /raid0
# TERM=vt100;export TERM
# vi /etc/vfstab
添加一行:
/dev/md/dsk/d0 /dev/md/rdsk/d0 /raid0 ufs 2 yes –
# mount /dev/md/dsk/d0 /raid0 或 # mountall (mount分区到/raid0)
# reboot
Raid 1
安装时请注意,必须预留50M左右给某个分区(最好是slice 7)以做镜象之用,下面以Sun Fire V880为例:
V880共有六块硬盘,序号为0-5,镜像为0-1、2-3、4-5分别镜像。
一、镜象步骤(以下命令假设c1t0d0s2为操作系统盘,c1t1d0s2为镜象盘,系统有3个分区 /,swap和/export/home,slice 7为预留50M的分区):
1.将操作系统盘的分区表导入到镜象盘,便两者的分区一致
# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
2.在预留50M左右的分区上创建metadb
# metadb -a -f -c 3 c1t0d0s7 c1t1d0s7
3.对每个系统分区(除slice 7外)做metadevice
# metainit -f d10 1 1 c1t0d0s0
# metainit -f d11 1 1 c1t0d0s1
# metainit -f d16 1 1 c1t0d0s6
# metainit d20 1 1 c1t1d0s0
# metainit d21 1 1 c1t1d0s1
# metainit d26 1 1 c1t1d0s6
4.将操作系统盘的分区先做成单边镜象
# metainit d0 -m d10
# metainit d1 -m d11
# metainit d6 -m d16
5.对根分区执行metaroot命令编辑/etc/vfstab和/etc/system文件,以致系统能从(/)文件系统启动
# metaroot d0
# lockfs -fa
6.修改/etc/vfstab
修改前:
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /export/home ufs 2 yes -
swap - /tmp tmpfs - yes -
修改后:
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/md/dsk/d6 /dev/md/rdsk/d6 /export/home ufs 2 yes -
swap - /tmp tmpfs - yes -
7.重启机器
# reboot
8.重启后,将镜象盘的分区挂接到镜象中,此命令可促成镜像同步
# metattach d0 d20
# metattach d1 d21
# metattach d6 d26
9.确定路径在交替的根设备
# ls -l /dev/rdsk/c1t0d0s0
10. 至此,镜象过程全部完成,运行此命令可看到同步状态。
# metastat |grep %
Raid 5
Raid 5 的制作比较简单
假设硬盘c1t2d0s2 c1t3d0s2 c1t4d0s2 c1t5d0s2 需做Raid 5 (三块以上硬盘即可做Raid 5),步骤如下:
一、首先,对硬盘c1t2d0s2进行分区,在slice 7上建立metadb,大小可为50Mb,其余空间可在slice 0,建议首扇区从slice 0开始
# format
二、然后再对其它硬盘进行分区表复制操作
# prtvtoc /dev/rdsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t3d0s2
# prtvtoc /dev/rdsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t4d0s2
# prtvtoc /dev/rdsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t5d0s2
三、在预留50M左右的分区上创建metadb
# metadb -a -c 3 c1t2d0s7 c1t3d0s7 c1t4d0s7 c1t5d0s7
四、再运行Raid 5命令行
# metainit d50 –r c1t2d0s0 c1t3d0s0 c1t4d0s0 c1t5d0s0
# metastat d50 (可检查RAID5的进度)
1、、当只建一个文件系统时:
# newfs /dev/md/rdsk/d50 (重建文件系统)
# mkdir /raid5
# TERM=vt100;export TERM
# vi /etc/vfstab
添加一行:
/dev/md/dsk/d50 /dev/md/rdsk/d50 /raid5 ufs 2 yes –
# mount /raid5 (mount分区到/raid5)
2、当需建两个文件系统即两个软分区时:
# metainit d51 -p d50 100gb (文件系统大小可指定)
# metastat d50 (可查看d50、d51的Size的blocks数,然后用d50的blocks总数减去d51的blocks总数,可得d52剩余容量,以b为单位)
# metainit d52 -p d50 ?b (输入时应稍小于计算出来的blocks数)
# newfs /dev/md/rdsk/d51 (重建文件系统即软分区)
# newfs /dev/md/rdsk/d52
# mkdir /raid51
# mkdir /raid52
# TERM=vt100;export TERM
# vi /etc/vfstab
添加两行:
/dev/md/dsk/d51 /dev/md/rdsk/d51 /raid51 ufs 2 yes –
/dev/md/dsk/d52 /dev/md/rdsk/d52 /raid52 ufs 2 yes –
# mount /raid51
# mount /raid52 (mount分区到/raid51及/raid52)
在SST6140上做Raid 5 利用CAM软件接入主机就能做了
1. root passwd
2.进入SST6140管理 注册你想要划分的主机
3.选择hotspare
4.选择盘
5.映射
这样就ok了
阅读(1543) | 评论(0) | 转发(0) |