Jul
30
2006
上个星期五去机房发现一机器(raid5,4块迈拓硬盘)硬盘闪黄灯,潜意识热插拔一下,结果导致另二块硬盘闪黄灯,raid出错警告声音响起。惨。不对了。马上查看系统文件,数据没有丢失。
第一次面对raid5的出错,处理方法上不够标准,理应立即备份数据,但我却马上关机,重拔4块硬盘后开机进raid bios,查看raid状态时发现第一块故障盘处于rebild状态,另二块硬盘中其中一块显示media error,一块没有显示error。raid5,只能坏一块硬盘,但此时按状态是一块有坏道,一块处在rebild状态,raid的rebild是不可能恢复了。于是再接二块硬盘做raid0,决定开机后如果数据能访问到则mount新建的raid,然后备份数据。
开机后发现系统开机正常,于是删除所有tmp目录文件及相对无用的log之类的文件,然后做整个系统的tar方式备份(详细方法见本人blog中的系统备份一文)。数据备份完成,关机,使用全新硬盘替换有问题的三块硬盘(期间发生了太多的意外:1、原认为后面发生的二块闪黄灯硬盘可能出错,换这二块就OK,结果到最后发现三块全是有问题的。2、后来才知道迈拓硬盘老版本fireware有问题,可能会出现误报、容易掉线情况),因为在备份的系统中系统文件从第一个raid中启动,而我新插入三块硬盘,期间又做了几次误删除raid5 事件,新建 的raid5成为了第二个raid,在bsd的恢复后估计会出现系列问题,所以决定拔掉备份的二块raid0硬盘,在raid bios中删除raid0信息,再建raid5,使raid5成为第一个raid组。然后再接二块硬盘做raid0。光盘启动,最小化安装bsd,进入系统后`mount raid0的备份盘,恢复系统及数据。重启,OK。一切正常了。
总结:1、硬盘质量已经变得越来越差,迈拓真的有些不行了,当然我的运气太好,三块一起坏,居然数据还能读,所以要注意机房平时的观察,有条件的尽量安装raid硬盘信息的远程监控。我的dell机器安装freebsd系统不支持raid bios状态的监控,安装dell支持的OS最好安装这些东西以防万一。
2、raid出现问题时在数据还没有丢失前,应该在开机状态上进行备份,以防关机后raid起不来。
3、多个raid后,系统启动优先顺序我不知道raid bios中如何设置,所以改用删除逻辑raid的方法来处理分组问题,但这个方法不推荐,如果要这样做,前提是:先拔出硬盘,再删除raid信息,再插入硬盘(注意原来二块硬盘放在哪个位置,再放到哪个位置),重建raid,不要做raid的初始化!!!
4、出现事故时尽量先找资料,再处理,不要盲目处理。
Share This
Jul
30
2006
备份整个系统的命令如下:
[root@deep]# cd /
[root@deep]# tar -zcvpf /archive/full-backup-`date ‘+%d-%B-%Y‘`.tar.gz
–directory / –exclude=proc –exclude=mnt –exclude=archive
–exclude=cache .
l z 表示备份的数据将使用“gzip”进行压缩。
l c表示创建归档文件。
l v显示文件列表。
l p保存权限,文件的访问权限将被“记住”。
l f说明下一个参数就是归档的文件名或设备名。
请注意一下带有当前日期的文件名是如何产生的,其方法是在两个后引号之间放入“date”命令。通常的命名习惯是给未压缩的文档加一个“tar”后缀,经过压缩后的加上“tar.gz”。
“–directory”选项告诉tar先转到规定的目录下(本例中为‘/’目录),然后进行备份。“–exclude”选项告诉tar不要备份指定的目录或文件。最后,命令末尾的“.”号告诉tar要备份当前目录下的所有内容。
再举一个例子,这一次只把指定的文件系统备份到SCSI磁带驱动器:
只备份指定的文件到一个SCSI磁带驱动器,使用如下命令:
Continue Reading »
Share This
Jul
28
2006
1. Advantages of Disksuite
Solstice disk suite provides three major functionalities :
1. Over come the disk size limitation by providing for joining of multiple disk slices to form a bigger volume.
2. Fault Tolerance by allowing mirroring of data from one disk to another and keeping parity information in RAID5.
3. Performance enhancement by allowing spreading the data space over multiple disks .
2. Disksuite terms
Metadevice :A virtual device composed of several physical devices - slices/disks . All the operations are carried out using metadevice name and transparently implemented on the individual device.
RAID : A group of disks used for creating a virtual volume is called array and depending on disk/slice arrangement these are called various types of RAID (Redundant Array of Independent Disk ).
RAID 0 Concatenation/Striping
RAID 1 Mirroring
RAID 5 Striped array with rotating parity.
Concatenation :Concatenation is joining of two or more disk slices to add up the disk space . Concatenation is serial in nature i.e. sequential data operation are performed serially on first disk then second disk and so on . Due to serial nature new slices can be added up without having to take the backup of entire concatenated volume ,adding slice and restoring backup .
Striping :Spreading of data over multiple disk drives mainly to enhance the performance by distributing data in alternating chunks - 16 k interleave across the stripes . Sequential data operations are performed in parallel on all the stripes by reading/writing 16k data blocks alternatively form the disk stripes.
Mirroring : Mirroring provides data redundancy by simultaneously writing data on to two sub mirrors of a mirrored device . A submirror can be a stripe or concatenated volume and a mirror can have three mirrors . Main concern here is that a mirror needs as much as the volume to be mirrored.
RAID 5 : RAID 5 provides data redundancy and advantage of striping and uses less space than mirroring . A RAID 5 is made up of at least three disk which are striped with parity information written alternately on all the disks . In case of a single disk failure the data can be rebuild using the parity information from the remaining disks .
Continue Reading »
Share This
Jul
27
2006
——————————————————————————————————————————————————
系统配置
node1
主机名: sys1
ip: 10.1.1.1
netmask:255.255.255.0
安装系统时选择最大化安装
注意分区时留出c0t0d0s6、c0t0d0s7两个分区,其中s6应该大于150MB,c0t0d0s7应该大于10mb
s6的mount点为/globaldevices
node2
主机名:sys2
ip: 10.1.1.2
netmask:255.255.255.0
安装系统时选择最大化安装
分区要求同节点1
在安装系统之前修改OBP的相关设置:
进入OBP
ok probe-scsi-all
看看a1000阵列所连接的SCSI的物理地址,这里假设为:
/pci@1f,4000/pci@4/SUNW,isptwo@4
修改该节点的该SCSI卡的SCSI_ID
{0} ok nvedit
0: probe-all
1: cd /pci@1f,4000/pci@4/SUNW,isptwo@4
2: 6 ” scsi-initiator-id” integer-property
3: device-end
4: install-console
5: banner ;
然后保存该设置
{0} ok nvstore
{0} ok setenv use-nvramrc? true
{0} ok set-default local-mac-addresss? false
重启机器
{0} ok reset-all
Continue Reading »
Share This
Jul
27
2006
2、制作RAID1
#metadb -a -c 3 -f c2t0d0s3 c2t1d0s3
#metainit d1 1 1 c2t0d0s0
#metainit d2 1 1 c2t1d0s0
#metainit d0 -m d1
#metattach d0 d2
#metastat
创建文件系统和挂接
#newfs /dev/md/rdsk/d0
#mkdir /raid1
#mount /dev/md/dsk/d0 /raid1
清除RAID
#umount /raid1
#metaclear d0
#metadb -d -f c2t0d0s3 c2t1d0s3
Continue Reading »
Share This