|
 |
栏目导栏 |
|
| |
|
|
|
|
 |
资料搜索 |
|
| |
|
|
|
|
 |
热门文章 |
|
| |
|
|
|
|
 |
最新文章 |
|
| |
|
|
|
| |
| |
|
|
|
| |
| 在Solarsi8下使用命令行的方式安装及维护RAID1和RAID5 |
[ 作者: Linux联盟收集 加入时间:2006-07-11 20:10:16 来自:Linux联盟收集
] | |
|
本文档以SUN Fire V880 Server(6*73GB Dsik)为例讲解在Solarsi8下使用命令行的方式安装及维护RAID1和RAID5。本文档内容都经本人实践验证过,但对于不同机型仅供参考,谢谢支持! NnvLinux联盟 NnvLinux联盟 Disk分布情况: NnvLinux联盟 0:c1t0d0 NnvLinux联盟 1:c1t1d0 NnvLinux联盟 2:c1t2d0 NnvLinux联盟 3:c1t3d0 NnvLinux联盟 4:c1t4d0 NnvLinux联盟 5:c1t5d0 NnvLinux联盟 NnvLinux联盟 注:0,1做镜像;2,3,4,5做RAID5 NnvLinux联盟 NnvLinux联盟 系统盘(c1t0d0)分区及镜像盘(c1t1d0)情况: NnvLinux联盟 c1t0d0s0(d10) d0 c1t1d0s0(d20) / 1024M NnvLinux联盟 c1t0d0s1(d11) d1 c1t1d0s1(d21) swap 8192M NnvLinux联盟 c1t0d0s2 c1t1d0s2 overlap 69999M NnvLinux联盟 c1t0d0s3(d13) d3 c1t1d0s3(d23) /usr 4096M NnvLinux联盟 c1t0d0s4(d14) d4 c1t1d0s4(d24) /opt 10240M NnvLinux联盟 c1t0d0s5(d15) d5 c1t1d0s5(d25) /var 2048M NnvLinux联盟 c1t0d0s6(d16) d6 c1t1d0s6(d26) /home free NnvLinux联盟 c1t0d0s7 c1t1d0s7 /metaDB 30M NnvLinux联盟 NnvLinux联盟 系统安装完成后,使用Solarsi8 software 2 of 2安装DiskSuite_4.2.1软件,安装路径:/cdrom/cdrom0/Solaris_8/EA/installer & 选择默认安装就可以。 NnvLinux联盟 用root用户登陆,运行以下命令: NnvLinux联盟 #prtvtoc /dev/rdsk/c1t0d0s2|fmthard –s – /dev/rdsk/c1t1d0s2 NnvLinux联盟 fmthard:New volume table of contents now in place NnvLinux联盟 上面命令将第二块硬盘(c1t1d0)的文件分区表调整为和引导盘一致。 NnvLinux联盟 NnvLinux联盟 #umount /metaDB NnvLinux联盟 #rm –r /metaDB NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 将下面这行注释掉或删除,如下: NnvLinux联盟 #/dev/dsk/c1t0d0s7 /dev/rdsk/c1t0d0s7 /metaDB ufs 1 yes – NnvLinux联盟 NnvLinux联盟 一、RAID1 NnvLinux联盟 对各个分区逐一作镜像: NnvLinux联盟 ①先生成replicas,这是DiskSuite内部用的。 NnvLinux联盟 #metadb –a –f –c 3 c1t0d0s7 c1t1d0s7 NnvLinux联盟 #metadb NnvLinux联盟 ②Creating a mirror from swap NnvLinux联盟 #metainit –f d11 1 1 c1t0d0s1 NnvLinux联盟 #metainit d21 1 1 c1t1t0s1 NnvLinux联盟 #metainit d1 –m d11 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 /dev/dsk/c1t0d0s1 - - swap – no – NnvLinux联盟 should be changed to: NnvLinux联盟 /dev/md/dsk/d1 - - swap – no - NnvLinux联盟 #reboot NnvLinux联盟 #metattach d1 d21 NnvLinux联盟 ③Creating a mirror from /usr NnvLinux联盟 #metainit –f d13 1 1 c1t0d0s3 NnvLinux联盟 #metainit d23 1 1 c1t1t0s3 NnvLinux联盟 #metainit d3 –m d13 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 /dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /usr ufs 1 yes – NnvLinux联盟 should be changed to: NnvLinux联盟 /dev/md/dsk/d3 /dev/md/rdsk/d3 /usr ufs 1 yes – NnvLinux联盟 #reboot NnvLinux联盟 #metattach d3 d23 NnvLinux联盟 ④Creating a mirror from /opt NnvLinux联盟 #metainit –f d14 1 1 c1t0d0s4 NnvLinux联盟 #metainit d24 1 1 c1t1t0s4 NnvLinux联盟 #metainit d4 –m d14 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 /dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /opt ufs 1 yes – NnvLinux联盟 should be changed to: NnvLinux联盟 /dev/md/dsk/d4 /dev/md/rdsk/d4 /opt ufs 1 yes – NnvLinux联盟 #reboot NnvLinux联盟 #metattach d4 d24 NnvLinux联盟 ⑤Creating a mirror from /var NnvLinux联盟 #metainit –f d15 1 1 c1t0d0s5 NnvLinux联盟 #metainit d25 1 1 c1t1t0s5 NnvLinux联盟 #metainit d5 –m d15 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 /dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /var ufs 1 yes – NnvLinux联盟 should be changed to: NnvLinux联盟 /dev/md/dsk/d5 /dev/md/rdsk/d5 /var ufs 1 yes – NnvLinux联盟 #reboot NnvLinux联盟 #metattach d5 d25 NnvLinux联盟 ⑥Creating a mirror from /home NnvLinux联盟 #metainit –f d16 1 1 c1t0d0s6 NnvLinux联盟 #metainit d26 1 1 c1t1t0s6 NnvLinux联盟 #metainit d6 –m d16 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 /dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /home ufs 1 yes – NnvLinux联盟 should be changed to: NnvLinux联盟 /dev/md/dsk/d6 /dev/md/rdsk/d6 /home ufs 1 yes – NnvLinux联盟 #reboot NnvLinux联盟 #metattach d6 d26 NnvLinux联盟 ⑦Creating a mirror from / NnvLinux联盟 #metainit –f d10 1 1 c1t0d0s0 NnvLinux联盟 #metainit d20 1 1 c1t1t0s0 NnvLinux联盟 #metainit d0 –m d10 NnvLinux联盟 #metaroot d0 NnvLinux联盟 #lockfs –fa NnvLinux联盟 #reboot NnvLinux联盟 #metattach d0 d20 NnvLinux联盟 NnvLinux联盟 #metastat (检查镜像进度) NnvLinux联盟 NnvLinux联盟 NnvLinux联盟 镜像完成后,还需作如下操作: NnvLinux联盟 修改EEPROM NnvLinux联盟 ok devalias(察看启动设备) NnvLinux联盟 ok nvalias rootdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0 NnvLinux联盟 ok nvalias mirrdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0 NnvLinux联盟 NnvLinux联盟 ok setenv boot-device rootdisk mirrdisk NnvLinux联盟 NnvLinux联盟 eeprom命令: NnvLinux联盟 boot-device=rootdisk mirrdisk NnvLinux联盟 boot-device=rootdisk mirrdisk NnvLinux联盟 use-nvramrc?=true NnvLinux联盟 nvramrc=devalias mirrdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0 NnvLinux联盟 devalias rootdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0 NnvLinux联盟 NnvLinux联盟 #ls -l c1t0d0s0 NnvLinux联盟 lrwxrwxrwx 1 root root 70 1月 2 10:45 c1t0d0s0 -> ../../devices/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000000870e80e7,0:a NnvLinux联盟 对应:/pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0 NnvLinux联盟 root@voiplnjvr4 # ls -l c1t1d0s0 NnvLinux联盟 lrwxrwxrwx 1 root root 70 1月 2 10:45 c1t1d0s0 -> ../../devices/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000000870fb287,0:a NnvLinux联盟 对应:/pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0 NnvLinux联盟 NnvLinux联盟 测试: NnvLinux联盟 ok boot rootdisk 系统启动正常。 NnvLinux联盟 ok boot mirrordisk 系统启动正常。 NnvLinux联盟 NnvLinux联盟 假如c1t0d0盘坏掉,则停机更换硬盘后需做恢复工作,如下; NnvLinux联盟 ok boot mirrordisk -s NnvLinux联盟 #metadb -d c1t0d0s7 NnvLinux联盟 #prtvtoc /dev/rdsk/c1t1d0s2|fmthard –s – /dev/rdsk/c1t0d0s2 NnvLinux联盟 #metadb –a –f –c 3 c1t0d0s7 NnvLinux联盟 #halt NnvLinux联盟 ok boot mirrordisk NnvLinux联盟 #metareplace -e d0 c1t0d0s0 NnvLinux联盟 d0: device c1t0d0s0 is enabled NnvLinux联盟 #metareplace -e d1 c1t0d0s1 NnvLinux联盟 d1: device c1t0d0s1 is enabled NnvLinux联盟 #metareplace -e d3 c1t0d0s3 NnvLinux联盟 d3: device c1t0d0s3 is enabled NnvLinux联盟 #metareplace -e d4 c1t0d0s4 NnvLinux联盟 d4: device c1t0d0s4 is enabled NnvLinux联盟 #metareplace -e d5 c1t0d0s5 NnvLinux联盟 d5: device c1t0d0s5 is enabled NnvLinux联盟 #metareplace -e d6 c1t0d0s6 NnvLinux联盟 d6: device c1t0d0s6 is enabled NnvLinux联盟 NnvLinux联盟 #metastat (检查镜像恢复进度) NnvLinux联盟 NnvLinux联盟 二、RAID5 NnvLinux联盟 #metainit d55 –r c1t2d0s2 c1t3d0s2 c1t4d0s2 c1t5d0s2 NnvLinux联盟 #metastat d55 (检查RAID5的进度) NnvLinux联盟 作完后reboot NnvLinux联盟 #newfs /dev/md/rdsk/d55 NnvLinux联盟 #mkdir /raid5 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 添加一行: NnvLinux联盟 /dev/md/dsk/d55 /dev/md/rdsk/d55 /raid5 ufs 2 yes – NnvLinux联盟 #reboot NnvLinux联盟 NnvLinux联盟 NnvLinux联盟 RAID5坏掉一个盘的恢复方法: NnvLinux联盟 例c1t4d0盘坏掉,更换坏硬盘后作如下工作: NnvLinux联盟 ok boot -r NnvLinux联盟 #metareplace –e d55 c1t4d0s2 NnvLinux联盟 #metastat d55 NnvLinux联盟 NnvLinux联盟 卸去RAID5的方法: NnvLinux联盟 #umount /raid5 NnvLinux联盟 #metaclear d55 NnvLinux联盟 #vi /etc/vfstab NnvLinux联盟 注释此行: NnvLinux联盟 #/dev/md/dsk/d55 /dev/md/rdsk/d55 /raid5 ufs 2 yes –NnvLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论 |
|
|
|
|
|