我有一台 rapsberry pi 2,通过 SATA-USB 适配器连接了 2 个硬盘。它们是使用 MDADM 安装的 Raid1。问题是两个磁盘中的一个被随机移除并标记为“故障”。
这里有一些日志,如需更多信息,请随时询问:
MDADM 生成的电子邮件:
DegradedArray 事件:
This is an automatically generated mail message from mdadm
running on jeedom
A DegradedArray event had been detected on md device /dev/md0.
Faithfully yours, etc.
P.S. The /proc/mdstat file currently contains the following:
Personalities : [raid1]
md0 : active raid1 sda1[0](F) sdb1[1]
1953382464 blocks super 1.2 [2/1] [_U]
bitmap: 1/15 pages [4KB], 65536KB chunk
unused devices: <none>
(奇怪的细节:它报告“sda”和“sdb”而不是“sdc”和“sdd”)
失败事件:
This is an automatically generated mail message from mdadm
running on jeedom
A Fail event had been detected on md device /dev/md0.
It could be related to component device /dev/sdc1.
Faithfully yours, etc.
P.S. The /proc/mdstat file currently contains the following:
Personalities : [raid1]
md0 : active raid1 sdc1[0](F) sdd1[1]
1953382464 blocks super 1.2 [2/1] [_U]
bitmap: 0/15 pages [0KB], 65536KB chunk
unused devices: <none>
mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Jan 24 22:04:22 2017
Raid Level : raid1
Array Size : 1953382464 (1862.89 GiB 2000.26 GB)
Used Dev Size : 1953382464 (1862.89 GiB 2000.26 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Wed Apr 24 07:26:28 2019
State : active, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 1
Spare Devices : 0
Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 17 1 active sync
0 8 1 - faulty
sudo mdadm --misc -E /dev/sdc
/dev/sdc:
MBR Magic : aa55
Partition[0] : 3907029167 sectors at 1 (type ee)
(两个磁盘相同)
sudo fdisk -l
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 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
Disklabel type: gpt
Disk identifier: F5D21ED7-E3A8-4B23-82EC-213CC1768D42
Device Start End Sectors Size Type
/dev/sdc1 2048 3907029134 3907027087 1.8T Linux filesystem
Disk /dev/sdd: 1.8 TiB, 2000398934016 bytes, 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
Disklabel type: gpt
Disk identifier: CD4D815E-944C-467D-9262-248FED949EC3
Device Start End Sectors Size Type
/dev/sdd1 2048 3907029134 3907027087 1.8T Linux filesystem
猫/ var / log / syslog | grep Dev
Apr 26 07:03:54 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 104 to 108
Apr 26 07:03:54 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 97 to 98
Apr 26 07:03:54 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 71 to 72
Apr 26 07:03:54 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 29 to 28
Apr 26 07:03:54 jeedom smartd[440]: Device: /dev/sdb [SAT], open device worked again, warning condition reset after 2 emails
Apr 26 07:03:55 jeedom smartd[440]: Device: /dev/sdb [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 72 to 73
Apr 26 07:03:55 jeedom smartd[440]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 28 to 27
Apr 26 07:03:55 jeedom smartd[440]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST2000VN004_2E4164-W524Y2DZ.ata.state
Apr 26 07:03:55 jeedom smartd[440]: Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.ST2000VN004_2E4164-W524YGBP.ata.state
Apr 26 07:03:55 jeedom hciattach[441]: Device setup complete
Apr 26 07:34:08 jeedom smartd[440]: Device: /dev/sda [SAT], is in STANDBY mode, suspending checks
Apr 26 07:34:13 jeedom smartd[440]: Device: /dev/sdb [SAT], is in STANDBY mode, suspending checks
Apr 26 18:03:55 jeedom smartd[440]: Device: /dev/sda [SAT], is back in ACTIVE or IDLE mode, resuming checks (21 checks skipped)
Apr 26 18:03:55 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 108 to 109
Apr 26 18:03:55 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 72 to 68
Apr 26 18:03:55 jeedom smartd[440]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 28 to 32
Apr 26 18:03:55 jeedom smartd[440]: Device: /dev/sdb [SAT], is back in ACTIVE or IDLE mode, resuming checks (21 checks skipped)
Apr 26 18:03:56 jeedom smartd[440]: Device: /dev/sdb [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 73 to 69
Apr 26 18:03:56 jeedom smartd[440]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 27 to 31
sudo smartctl -a /dev/sdb -d sat
smartctl 6.4 2014-10-07 r4002 [armv7l-linux-4.4.38-v7+] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: ST2000VN004-2E4164
Serial Number: W524YGBP
LU WWN Device Id: 5 000c50 0a81277c5
Firmware Version: SC60
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5900 rpm
Form Factor: 3.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Apr 26 18:19:18 2019 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 107) seconds.
Offline data collection
capabilities: (0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 258) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x10bd) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 119 100 006 Pre-fail Always - 216926912
3 Spin_Up_Time 0x0003 098 096 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 097 097 020 Old_age Always - 3937
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 068 060 030 Pre-fail Always - 6933039
9 Power_On_Hours 0x0032 079 079 000 Old_age Always - 18868
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 39
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 098 000 Old_age Always - 12885098514
189 High_Fly_Writes 0x003a 073 073 000 Old_age Always - 27
190 Airflow_Temperature_Cel 0x0022 067 038 045 Old_age Always In_the_past 33 (0 174 36 23 0)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 27
193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always - 3937
194 Temperature_Celsius 0x0022 033 062 000 Old_age Always - 33 (0 16 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 18410 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
/etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
tmpfs /tmp tmpfs defaults,size=128M 0 0
/dev/md0 /media/HDD ext4 defaults,nofail,noatime,nodiratime 0 0
UUID=8c0ed3a6-ad04-4d8f-8932-e4c160fec0ac /backup ext4 defaults,noatime,nofail 0 0
/etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE /dev/sdc1
#DEVICE /dev/sdd1
DEVICE partitions
ARRAY /dev/md0 metadata=1.2 name=jeedom:0 UUID=19cb497c:c70d1686:fc290ad3:d2ed202b
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
#MAILADDR root
MAILADDR [email protected]
MAILFROM HomeBox - mdadm
# definitions of existing MD arrays
# This configuration was auto-generated on Tue, 24 Jan 2017 21:47:51 +0100 by mkconf
谢谢你的帮助。