Portal Home > Knowledgebase > Articles Database > Degraded Raid - how can i fix this?


Degraded Raid - how can i fix this?




Posted by martin33, 09-01-2013, 11:21 PM
Hi, I am having a degraded software raid on an r1soft server who got degraded. It's the first time i see something like this : usualy, we need to backup and transfert to another disk set, but not this time... We have checked the disk with the datacenter, and they said it's not a hardware issue, but a software one, so they cannot maintain this. So there is no need to change the disk, but instead they told me i can fix this using mdadm. ...but the example of command to fix this they provided is not clear to me : mdadm /dev/mdX -a /dev/sdbX How am i supposed to know what goes where the is a X in the previous command? I don't want to mess with this : any help should be appreciated! mdadm --detail /dev/md1 /dev/md1: Version : 0.90 Creation Time : Sat Mar 30 07:50:05 2013 Raid Level : raid1 Array Size : 960374720 (915.88 GiB 983.42 GB) Used Dev Size : 960374720 (915.88 GiB 983.42 GB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 1 Persistence : Superblock is persistent Update Time : Sun Sep 1 23:07:40 2013 State : active, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : 09583bf7:02f7af53:a4d2adc2:26gd5397 Events : 0.2593062 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 0 0 1 removed Here is an fdisk : fdisk -l Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x0008d1ec Device Boot Start End Blocks Id System /dev/sda1 * 1 119562 960374784 fd Linux raid autodetect /dev/sda2 119562 121601 16382976 82 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x000d7cf7 Device Boot Start End Blocks Id System /dev/sdb1 * 1 119562 960374784 fd Linux raid autodetect /dev/sdb2 119562 121601 16382976 82 Linux swap / Solaris Disk /dev/md1: 983.4 GB, 983423713280 bytes 2 heads, 4 sectors/track, 240093680 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Also : mdadm --examine /dev/sdb1 | egrep 'Event|/dev/sd' /dev/sdb1: Events : 222 this 1 8 17 1 active sync /dev/sdb1 0 0 8 1 0 active sync /dev/sda1 1 1 8 17 1 active sync /dev/sdb1 and : mdadm --examine /dev/sda1 | egrep 'Event|/dev/sd' /dev/sda1: Events : 2593423 this 0 8 1 0 active sync /dev/sda1 0 0 8 1 0 active sync /dev/sda1 thank you, Martin

Posted by martin33, 09-01-2013, 11:24 PM
here is also a smartctl on the disks : # smartctl -a /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.18.1.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Seagate Barracuda (SATA 3Gb/s, 4K Sectors) Device Model: ST1000DM003-9YN162 Serial Number: S1D2ZH5S LU WWN Device Id: 5 000c50 0511c8be9 Firmware Version: CC4H User Capacity: 1,000,204,886,016 bytes [1.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Sun Sep 1 23:23:24 2013 EDT 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 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: ( 584) 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: ( 113) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x3085) SCT Status 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 115 099 006 Pre-fail Always - 90377544 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 39 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 081 060 030 Pre-fail Always - 166824099 9 Power_On_Hours 0x0032 093 093 000 Old_age Always - 6658 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 38 183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0 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 099 000 Old_age Always - 4295032834 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 067 058 045 Old_age Always - 33 (Min/Max 27/42) 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 - 37 193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 680 194 Temperature_Celsius 0x0022 033 042 000 Old_age Always - 33 (0 22 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 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 197989402417616 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 65693382103520 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 180947788543281 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% 2898 - # 2 Short offline Completed without error 00% 2894 - # 3 Short offline Completed without error 00% 2894 - # 4 Short offline Completed without error 00% 1177 - # 5 Short offline Completed without error 00% 1173 - # 6 Short offline Completed without error 00% 1173 - # 7 Short offline Completed without error 00% 1172 - # 8 Short offline Completed without error 00% 1167 - # 9 Short offline Completed without error 00% 1167 - #10 Short offline Completed without error 00% 1167 - #11 Short offline Completed without error 00% 1128 - #12 Short offline Completed without error 00% 12 - #13 Short offline Completed without error 00% 7 - #14 Short offline Completed without error 00% 7 - #15 Short offline Completed without error 00% 2 - 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. #smartctl -a /dev/sdb smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.18.1.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Seagate Barracuda (SATA 3Gb/s, 4K Sectors) Device Model: ST1000DM003-9YN162 Serial Number: S1D2A038 LU WWN Device Id: 5 000c50 050c05109 Firmware Version: CC4H User Capacity: 1,000,204,886,016 bytes [1.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Sun Sep 1 23:22:16 2013 EDT 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 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: ( 575) 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: ( 109) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x3085) SCT Status 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 111 099 006 Pre-fail Always - 32798944 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 42 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 080 060 030 Pre-fail Always - 112363078 9 Power_On_Hours 0x0032 093 093 000 Old_age Always - 6656 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 41 183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0 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 100 000 Old_age Always - 4295032833 189 High_Fly_Writes 0x003a 094 094 000 Old_age Always - 6 190 Airflow_Temperature_Cel 0x0022 067 058 045 Old_age Always - 33 (Min/Max 27/41) 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 - 40 193 Load_Cycle_Count 0x0032 095 095 000 Old_age Always - 10872 194 Temperature_Celsius 0x0022 033 042 000 Old_age Always - 33 (0 23 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 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 185722975818635 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 44176849791274 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 27866880574155 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% 2897 - # 2 Short offline Completed without error 00% 2892 - # 3 Short offline Completed without error 00% 2892 - # 4 Short offline Completed without error 00% 1176 - # 5 Short offline Completed without error 00% 1171 - # 6 Short offline Completed without error 00% 1171 - # 7 Short offline Completed without error 00% 1171 - # 8 Short offline Completed without error 00% 1166 - # 9 Short offline Completed without error 00% 1166 - #10 Short offline Completed without error 00% 1166 - #11 Short offline Completed without error 00% 1127 - #12 Short offline Completed without error 00% 11 - #13 Short offline Completed without error 00% 6 - #14 Short offline Completed without error 00% 6 - #15 Short offline Completed without error 00% 2 - 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.

Posted by serve-you, 09-02-2013, 12:11 AM
The add command is simply the array (mdX) & the partition (sdX). So if the failed drive is sdb1 in the array md1, you'd do

Posted by martin33, 09-04-2013, 06:24 PM
Hi, How can i know which one is the failed drive? Does this command is the correct one in this case, as per what you see in the output i sent? Thank you,

Posted by martin33, 09-04-2013, 06:25 PM
The thing is it's the first time i need to do this, and i want to be 100% sure i won't damage the system!

Posted by serve-you, 09-04-2013, 07:24 PM
cat /proc/mdstat should show you the active members. adding a drive isn't going to fix anything. It will just add the failed drive back in. If you are sure that there is no problem with the drive, then it should rebuild. According to your output above, it looks like sdb1 is not active, so yes, that should re-add it.

Posted by martin33, 09-06-2013, 06:52 PM
Hi, Here is the output : cat /proc/mdstat Personalities : [raid1] md1 : active raid1 sda1[0] 960374720 blocks [2/1] [U_] unused devices: I've been told by someone at our datacenter i may be able to fix without a reinstall. So i am wondering if this is the correct command to recover from this? : mdadm --add /dev/md1 /dev/sdb1 Thank you in advance for your help! Last edited by martin33; 09-06-2013 at 06:55 PM.

Posted by martin33, 09-09-2013, 06:41 PM
Someone else can confirm this is the correct command to fix this? mdadm --add /dev/md1 /dev/sdb1 thank you, Martin

Posted by RRWH, 09-09-2013, 07:46 PM
right idea, wrong syntax. look at http://www.howtoforge.com/replacing_..._a_raid1_array

Posted by martin33, 09-10-2013, 10:50 PM
Hi, The datacenter said it's not a hardware issue so they cannot help. They said it's the software, reason why i should be able to fix this using mdam. Possible for someone to confirm what should be the correct command to fix? Thank you, Martin

Posted by martin33, 09-15-2013, 06:21 PM
Just want to clarify, since i am still not getting any answer ...maybe this post is getting a bit complicated, but any help will be appreciated. There were a software raid issue on the server, and we need to re-add /dev/sdb to the raid. ...i think that's what we can understand from the previous command outputs, but how can i re-add a partition without whiping out all the data on the good partition? Everything is still working fine on the server. i see no needs to perform a migration, since it's not hardware related. But i just need confirmation on how to perform this operation. thank you, Martin Last edited by martin33; 09-15-2013 at 06:24 PM.

Posted by George_Fusioned, 09-15-2013, 06:37 PM
The command you're looking for is: This will add /dev/sdb1 (Linux raid partition as per your fdisk output) to /dev/md1 (which is your raid1 array). After entering the command above, you can see the resync progress by typing: Always take backups before such kind of disk operations.

Posted by serve-you, 09-15-2013, 06:50 PM
How many times (and different ways) do we need to type the same commands here? All you are doing is adding a drive to an existing array. As long as sda1 is good, it should sync that data to sdb1.

Posted by RRWH, 09-15-2013, 07:26 PM
Yep, I guess that 3 or 4 times is not enough. OP what ACTION have you taken to address this since you have been given the info?

Posted by martin33, 09-16-2013, 03:22 AM
thank you. The thing is i've been told many different things about how i can fix this, what i should do, and what i should avoid. I was just getting confused. I got the confirmation i needed, so i am going to try to fix it now. thank you,

Posted by martin33, 09-16-2013, 03:30 AM
Also : the guy at our told me about 3-4 times to backup before i do this. ...so another reason why i was nervous about it, but as far as i can see, it works now. Anyhow : i am pretty sure this post will help some other peoples Sorry about that RRWH

Posted by martin33, 09-16-2013, 03:37 AM
Seems like it's working cat /proc/mdstat Personalities : [raid1] md1 : active raid1 sdb1[2] sda1[0] 960374720 blocks [2/1] [U_] [>....................] recovery = 0.9% (9213312/960374720) finish=1059.8min speed=14957K/sec unused devices: it sync and do not seems to whipe out anything The thing is there are some peoples on forums who say something while they don't know about it Never trust anyone at 100% and always make sure you understand something before you go ahead with it. If someone tell you something : try to find a confirmation somewhere else, or from someone else is good i think! A first guy at our datacenter told me he wouldn't do this (fix using mdam), but he would perform a reinstall instead. Another guy told me i can fix using this, since there were no hardware failure. I am happy i did not followed the first given recommendation (reinstall) Somewhere else, on another website, i saw a tutorial about changing the second hard disk : see no reason for this in this case. On another forum, i've been told i need to backup, change the disk , then restore. here also. ...so those are the reasons why i was nervous about it, but as far as i can see, it works now. Anyhow : i am pretty sure this post will help some other peoples Thank you for your help! Last edited by martin33; 09-16-2013 at 03:46 AM.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
php help loop help (Views: 637)
ubiquityservers - Down (Views: 855)

Language: