我在 3 个 4K 对齐磁盘上有一个 RAID 5(2 个 WD2001FFSX 和 1 个 WD20EFRX)。其中一个磁盘出现故障,我用另一块 WD2001FFSX 替换了它。
以与其他分区相同的方式对其进行分区后(1 个分区获取整个空间,在 2048 个扇区对齐),我将其添加到 raid 中。
但你自己看看:
mick@baloo2:~$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sde1[0] sdb1[3] sdd1[1]
3906763776 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_]
[>....................] recovery = 0.2% (5345880/1953381888) finish=81762.7min speed=396K/sec
unused devices: <none>
mick@baloo2:~$
按照这个速度,大约需要两个月的时间才能完成!
这里有人能指出我的配置有什么问题吗?
以下是一些有用的信息:
mick@baloo2:~$ sudo mdadm -E /dev/sdb1
/dev/sdb1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x2
Array UUID : 6d208e00:02a3bdac:793d2f47:81af4052
Name : akela:0
Creation Time : Sat Apr 16 23:48:38 2016
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 3906763776 (3725.78 GiB 4000.53 GB)
Used Dev Size : 3906763776 (1862.89 GiB 2000.26 GB)
Data Offset : 262144 sectors
Super Offset : 8 sectors
Recovery Offset : 2505736 sectors
State : clean
Device UUID : 840de8ae:f4721e56:71cac3dc:7f9aae2f
Update Time : Sun May 29 15:31:02 2016
Checksum : edfdcb1f - correct
Events : 90414
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)
mick@baloo2:~$
mick@baloo2:~$
mick@baloo2:~$
mick@baloo2:~$
mick@baloo2:~$ sudo mdadm -E /dev/sdd1
/dev/sdd1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6d208e00:02a3bdac:793d2f47:81af4052
Name : akela:0
Creation Time : Sat Apr 16 23:48:38 2016
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 3906763776 (3725.78 GiB 4000.53 GB)
Used Dev Size : 3906763776 (1862.89 GiB 2000.26 GB)
Data Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 226eefd7:6da9b123:4240d44b:df2c9dd1
Update Time : Sun May 29 15:31:02 2016
Checksum : f5712e5b - correct
Events : 90414
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AAA ('A' == active, '.' == missing)
mick@baloo2:~$
mick@baloo2:~$
mick@baloo2:~$
mick@baloo2:~$ sudo mdadm -E /dev/sde1
/dev/sde1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6d208e00:02a3bdac:793d2f47:81af4052
Name : akela:0
Creation Time : Sat Apr 16 23:48:38 2016
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 3906763776 (3725.78 GiB 4000.53 GB)
Used Dev Size : 3906763776 (1862.89 GiB 2000.26 GB)
Data Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 1e381c08:c0a750d5:f85a153b:71d8df29
Update Time : Sun May 29 15:31:02 2016
Checksum : 1ec0bcf1 - correct
Events : 90414
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : AAA ('A' == active, '.' == missing)
mick@baloo2:~$
“fdisk -l”给我以下内容:
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xc97c3544
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907029167 1953513560 fd Linux raid autodetect
Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdd1 2048 3907029167 1953513560 fd Linux raid autodetect
Disk /dev/sde: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sde1 2048 3907029167 1953513560 fd Linux raid autodetect
答案1
问题在于您没有为重建操作保留太多 I/O 带宽。默认情况下,md
倾向于使用大部分 I/O 带宽来处理实际请求,而重建的优先级非常低。副作用是,即使对降级阵列进行最轻微的 I/O 也会导致重建速度直线下降。
您可以通过调整/proc/sys/dev/raid/speed_limit_min
(全局更改)或/sys/block/md0/md/sync_speed_min
更改单个数组来更改此设置。例如:
回声 6000 > /sys/block/md0/md/sync_speed_min
将提供 6000 kb/s 的最低重建速度,假设磁盘、控制器、总线和处理器都能处理(它们应该)。