我有OpenFiler存储服务器。
没有安装Windows和MSM,我想从磁盘2到21创buildraid10arrays。
我已经成功地将MegaCli安装到OpenFiler,但我被困在找出正确的命令行来创buildRAID 10arrays。
文档说创build一个raid 10的语法是:
MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN
我的机箱ID是25,所以:
[root@linux-h5ut ~]# MegaCli -CfgSpanAdd -r10 -Array0[E25:S02,E25:S21] -Array1[E25:S02,E25:S21] WB Cached NoCachedBadBBU -a0 Invalid input at or near token E
我已经search了高低,但似乎没有任何与megaraid raid10(只有语法)的例子。
任何人都可以解释什么是错的?
你不明白的手册页。 E25:S02 – 它应该有int值的variables。 一切你需要的:
1.获取适配器ID(在我的例子中是0):
root@sto# megacli Adpallinfo -aall | grep '^Adapter' Adapter #0
2.获取E和S值:
megacli -PDlist -aall | grep -e '^Enclosure Device ID:' -e '^Slot Number:'
你会得到这样的东西:
Enclosure Device ID: 20 Slot Number: 0 Enclosure Device ID: 20 Slot Number: 1 Enclosure Device ID: 20 Slot Number: 2 Enclosure Device ID: 20 Slot Number: 3 Enclosure Device ID: 20 Slot Number: 4
这是你E和S号码,ig 20:0,20:1,20:2,20:3,20:4所以创build例如RAID6的命令将是:
megacli -CfgLdAdd -r6 [20:0,20:1,20:2,20:3,20:4] -a0
我用(几个月前创buildRAID 50):
megacli -CfgSpanAdd -r50 -Array0[252:2,252:3,252:4] Array1[252:5,252:6,252:7] WB RA Direct CachedBadBBU -a0
IBM x3560和:
Product Name : ServeRAID M5015 SAS/SATA Controller Serial No : SV14018726 FW Package Build: 12.13.0-0179
响应一个创buildRAID 10(不是RAID 6)
首先得到适配器#
# MegaCli Adpallinfo -aall | grep '^Adapter' Adapter #0
MegaCli或megacli依赖distro * nix
在这种情况下适配器是Adapter #0
获取设备ID和插槽磁盘值:
# MegaCli64 -PDlist -aall | grep -e '^Enclosure Device ID:' -e '^Slot Number:' Enclosure Device ID: 252 Slot Number: 0 Enclosure Device ID: 252 Slot Number: 1 Enclosure Device ID: 252 Slot Number: 2 Enclosure Device ID: 252 Slot Number: 3
在这种情况下,ID为252
根据用于创buildRAID 10的MegaCli命令,它是MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN
MegaCli -CfgSpanAdd -R10 -Array0[252:0,252:2] -Array1[252:1,252:3] -a0
在这种情况下,创build一个RAID 10,为磁盘0和2创build一个Raid0arrays,为Raid1创build另一个arrays,磁盘1和3以及N = 0(-a0)
validationRAID
# megasasctl a0 LSI MegaRAID SAS 9271-4i encl:1 ldrv:1 batt:FAULT, low voltage, charge failed a0d0 1489GiB RAID 10 2x2 optimal a0e252s0 745GiB a0d0 online a0e252s1 745GiB a0d0 online a0e252s2 745GiB a0d0 online a0e252s3 745GiB a0d0 online
或者,如果megasasctl不可用:
# MegaCli -LDInfo -Lall -aALL Adapter 0 -- Virtual Drive Information: Virtual Disk: 0 (Target Id: 0) Name: RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0 Size:1.454 TB State: Optimal Stripe Size: 256 KB Number Of Drives per span:2 Span Depth:2 Default Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU Current Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU Access Policy: Read/Write Disk Cache Policy: Enabled Encryption Type: None
我刚刚用MegaCli创build了一个6磁盘的RAID-10,并使用了以下命令:
(假设这些例子中只有一个控制器,所以-aALL可以用来代替指定一个特定的控制器。)
显示连接到控制器的物理驱动器:
MegaCli -PDList -aALL
请注意来自该列表的驱动器的“机箱设备ID”和“插槽编号”,因为这些是分别在后面的RAID组创build命令中replace“E”和“S”的数字。
显示现有的逻辑驱动器(即RAID集):
MegaCli -LDInfo -Lall -aALL
如果您有一个现有的RAIDarrays,您将要重新使用磁盘,则需要删除这些磁盘所在的现有逻辑驱动器。 逻辑驱动器号应该从前面的命令中获得 。 如果运行它,这显然会破坏现有RAIDarrays上的数据 :
MegaCli -CfgLdDel -L<n> -aALL
现在你有一堆应该处于“未configuration(良好)”状态的磁盘,因此可以在新的逻辑驱动器中使用。 让我们创build一个由6个磁盘组成的RAID-10集合,这个集合实际上是3个RAID-1磁盘对的集合:
MegaCli -CfgSpanAdd -r10 -Array0[32:2,32:3] -Array1[32:4,32:5] -Array2[32:6,32:7] -a0
在我的情况下,磁盘是磁盘arrays32上的磁盘2到7.这些数字是从您之前得到的PDList输出获得的。 如果您有4个磁盘,那么它只有两对,但“ArrayN”块总是与RAID-10集合中的底层RAID-1对配对。
你的RAIDarrays现在应该显示到你的操作系统,并可以从那里分区等! 🙂
似乎我不应该使用E和S字母。
起初,我正确地理解,并试图无信号,但也得到无效的令牌错误,因为我使用-aALL而不是-a0(“ 如果你只有一个控制器是安全的,使用全部而不是一个特定的ID ”),然后读取该站点“E是驱动器驻留的机箱设备ID,S是槽号”,因此得出结论,我应该用实际的IDreplaceE和S. 🙁
MegaCli cfgspanadd r10 array0 "[25:02,25:21]" array1 "[25:02,25:21]" wb cached nocachedbadbbu a0应该没有问题。