今天是在51CTO开博五周年的日子!


工作中时常有备份硬盘损坏的情况发生,5.1节后又坏了2块,以购于09/10年购买的硬盘居多,于是常备数块2T硬盘备换,价格很便宜,在物价飞涨的今天,电子产品真是厚道。


更换硬盘的过程中由于新旧硬盘容量不一致,有了这样的情景发生:


假设备份用磁盘阵列为2块1.5T构建的Raid1,

某日,其中一块硬盘损坏,使用1块2T硬盘更换,重构Raid1完成;

数日后,另一快硬盘也损坏了,再次使用2T硬盘更换,重构Raid1完成;


原有的1.5T硬盘组建的阵列大小为1.36T,经两次更换操作后,阵列大小依然为1.36T,而2T的硬盘构建的阵列大小可以达到1.82T,白白浪费了几百G的空间。


为了不浪费,我一直是在DELL OMSA中将Virtual Disk删除,再重新建立VD,但是这样做会导致原VD数据全部丢失。今天一直想又没有更好地解决办法呢,于是看了部分LSI阵列卡的文档和搜索网络,看到些有价值的知识,虽然没有找到确切的答案,但也学到不少知识,同时也比较有趣,记录下来。


首先是文档上的一段信息:

Expand a Virtual Drive
Use the command in the following table to expand a virtual drive.

MegaCli -LdExpansion -pN -dontExpandArray -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL

Expands the virtual drive within the existing array or beyond the size of the existing array if you replace the drives with larger drives.
-pN: Denotes the percentage of the array to use to expand the virtual drive. N ranges from 0 to 100 percent.
For example, -p30 indicates expansion up to 30 percent of available array size.
-dontExpandArray: Expand a virtual drive within the array, even when there is room to expand the array.
For example, you have created a 5-GB RAID 1 virtual drive with two 30-GB drives. The array size is 30 GB and the virtual drive size is 5 GB. If you replace the two 30-GB, drives with two 60-GB drives, the array size is still 30 GB
(because of previous configuration). You have two options:
Expand the virtual drive within the array. Use the -dontExpandArray option to expand the virtual
drive up to 30 GB.
Expand the virtual drive beyond the existing array size. Use the -pN option to expand the virtual drive

beyond 30 GB and up to 60 GB (the size of the replacement drives)


我敲入命令,没有执行,大意是需要加入新的硬盘才可以(呼应了下文中关于Expand的解释),也许文档example中replace the two 30-GB drives with two 60-GB drives,replace这个动作有讲究的地方?


然后在CSDN博客上看到这位仁兄有个比较冒险的做法,先记录下来。

http://blog.csdn.net/frankggh/article/details/6647196

作者在文中发表了自己的观点,讲解了Extend与Expend的区别:

Extend ----- 这是指已经做好的RAID中,不增加或删除硬盘,而是更换为更大容量的硬盘,然后将RAID扩展到所有可用磁盘空间。例如RAID1 的两个73G硬盘,先热插拔一块更换一个为更大的300G硬盘,等RAID 恢复完成(只使用300G上的73G),再热插拔另一块,待这块RAID恢复也完成的时候(两个300G 硬盘上各只使用了73G 做RAID1),扩展RAID1 到整个2*300G。


Expand  ----- 这是向现有的RAID 中加入或者删除容量完全相同的硬盘,来调节RAID 磁盘空间的方法。 例如,向现有 RAID1 的 2*73 G中再加入两块73G硬盘。 当然最好是品牌,规格于RAID中原来的硬盘完全相同的,如果稍有差异也可以。 expand 有个特殊之处就是可以在expand的过程中改变RAID,例如 从原来的 RAID 1  2*73G  变成 RAID5  4*73G,或者 RAID10  4*73G。   如果原来是 RAID5  4*73G 也可以通过expand 拿两块硬盘出来变成 RAID1  2*73G.


文中的第十步操作带有危险性,但博主艺高人胆大,理论联系实际后表示无压力,敬佩!


博主还在HP服务器上做了Extend:

http://blog.csdn.net/frankggh/article/details/6647506

同时“人性化”的提供了Extend 操作失误的应急方法 :

http://blog.csdn.net/frankggh/article/details/6655411

   

最后戴尔技术中心的文章<RAID磁盘阵列扩容>,讲了联机容量扩充 (OCE)(因机器不能重启,没有实验)和RAID 级别迁移 (RLM)(不适用我的场景)。

http://zh.community.dell.com/techcenter/systems-management/w/wiki/398.raid.aspx