检查RAID软件:我的状态

我有一个Ubuntu专用服务器,我从我的提供商那里得到一条消息,说我的一个磁盘有错误,我必须在更换磁盘之前“检查我的RAID软件是否正常工作”。 这是我在shell中input的内容和我得到的报告:

root@Ubuntu-1204-precise-64-minimal # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md3 : active raid1 sda4[0] sdb4[1] 1839089920 blocks super 1.2 [2/2] [UU] md1 : active raid1 sda2[0] sdb2[1] 523968 blocks super 1.2 [2/2] [UU] md2 : active raid1 sda3[0] sdb3[1] 1073610560 blocks super 1.2 [2/2] [UU] md0 : active raid1 sdb1[1] sda1[0] 16768896 blocks super 1.2 [2/2] [UU] unused devices: <none> root@Ubuntu-1204-precise-64-minimal # mdadm -D /dev/md0 /dev/md0: Version : 1.2 Creation Time : Wed Nov 6 08:02:41 2013 Raid Level : raid1 Array Size : 16768896 (15.99 GiB 17.17 GB) Used Dev Size : 16768896 (15.99 GiB 17.17 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Thu Sep 10 04:02:26 2015 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Name : rescue:0 UUID : 872ad258:c42ccb36:e9e19c96:98b55ee9 Events : 156 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb1 

这是否意味着RAID正在运行,我所有的驱动器都是同步的? 如果没有,如何检查驱动器是否被同步,并且更换磁盘是安全的?

谢谢。

对。 cat /proc/mdstatmdadm -D的输出都表明这个数组的东西没问题。

State: clean

[UU]

是事情正在按照你的数组预期工作的重要通知。

你可以仔细检查一下md上的内核文档

 clean - no pending writes, but otherwise active. When written to inactive array, starts without resync If a write request arrives then if metadata is known, mark 'dirty' and switch to 'active'. if not known, block and switch to write-pending If written to an active array that has pending writes, then fails. 

和mdstat上的Linux Kernel Wiki

从维基条目中解释:

[UU]表示每个设备的状态,或者U表示up,或者_表示down。

如果您想设置电子邮件来提醒您,如果您的软件RAIDarrays出现问题,那么您可以在Ubuntu论坛中使用这篇文章: http : //ubuntuforums.org/showthread.php?t=1185134你通过一个过程来设置电子邮件到远程帐户。

如果你想仔细检查一下arrays是否可以,你可以随时使用这个命令: /usr/share/mdadm/checkarray -a /dev/mdX这个命令也应该在/etc/cron.d/mdadm并且每月运行一次。

除此之外,如果您怀疑即将发生的硬件故障不会触发arrays中的故障,那么可能运行smartctl可能是合理的。 可以在这里find示例: 使用smartctl进行SMART检查

最后,因为这不能说太多:确保你有良好的testing备份! = D Raid非常好,但它不能替代备份,而且当你知道你有很好的备份时,来自你的提供者的信息就不那么可怕了。 =)

希望有所帮助。 =)