I have a 4 drives Raid 5 array. One of the drive (sdb) show a lots of errors and my array show high latencies during access.
I currently have one new disk and another one is commanded.
As part of the replacement I also want to grow the raid level from raid 5 to raid 6. I identify to mean to achieve this :
By first growing to level 6
mdadm --manage /dev/md0 --add /dev/sdf1
mdadm --grow /dev/md0 --raid-devices 5 --level 6 --backup-file /<path>/mdadm-backup
mdadm --manage /dev/md0 --replace /dev/sdb1 # Set faulty but keep it for replacement until a spare drive is available
# After my second drive arrived
mdadm --manage /dev/md0 --add /dev/sdg1
By first replacing the faulty drive then growing to raid level 6
mdadm --manage /dev/md0 --add /dev/sdf1
mdadm --manage /dev/md0 --replace /dev/sdb1 --with /dev/sdf1
# after second drive is arrived
mdadm --manage /dev/md0 --add /dev/sdg1
mdadm --grow /dev/md0 --raid-devices 5 --level 6 --backup-file /path/mdadm-backup
Is there a difference between the two solutions ? Is one is safer than the other by imposing less operations on disks into the array ?
[Edit] adding smart result :
Sdb ( almost faulty )
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 082 072 006 Pre-fail Always - 22562487
3 Spin_Up_Time 0x0003 093 093 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 124
5 Reallocated_Sector_Ct 0x0033 077 077 010 Pre-fail Always - 29352
7 Seek_Error_Rate 0x000f 087 060 030 Pre-fail Always - 4963671931
9 Power_On_Hours 0x0032 026 026 000 Old_age Always - 65627
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 124
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 4793
188 Command_Timeout 0x0032 100 072 000 Old_age Always - 137445703785
189 High_Fly_Writes 0x003a 001 001 000 Old_age Always - 107
190 Airflow_Temperature_Cel 0x0022 073 056 045 Old_age Always - 27 (Min/Max 25/28)
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 - 82
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 296
194 Temperature_Celsius 0x0022 027 044 000 Old_age Always - 27 (0 14 0 0 0)
197 Current_Pending_Sector 0x0012 001 001 000 Old_age Always - 35384
198 Offline_Uncorrectable 0x0010 001 001 000 Old_age Offline - 35384
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
sbc
1 Raw_Read_Error_Rate 0x000f 118 099 006 Pre-fail Always - 194860592
3 Spin_Up_Time 0x0003 093 093 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 124
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 24
7 Seek_Error_Rate 0x000f 087 060 030 Pre-fail Always - 654004767
9 Power_On_Hours 0x0032 026 026 000 Old_age Always - 65631
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 124
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 094 094 000 Old_age Always - 6
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 2
189 High_Fly_Writes 0x003a 062 062 000 Old_age Always - 38
190 Airflow_Temperature_Cel 0x0022 073 059 045 Old_age Always - 27 (Min/Max 24/27)
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 - 82
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 295
194 Temperature_Celsius 0x0022 027 041 000 Old_age Always - 27 (0 14 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
sdd
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 113 094 006 Pre-fail Always - 51447952
3 Spin_Up_Time 0x0003 093 093 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 124
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 087 060 030 Pre-fail Always - 665278320
9 Power_On_Hours 0x0032 026 026 000 Old_age Always - 65630
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 124
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 173
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 1
189 High_Fly_Writes 0x003a 001 001 000 Old_age Always - 188
190 Airflow_Temperature_Cel 0x0022 073 055 045 Old_age Always - 27 (Min/Max 25/27)
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 - 82
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 296
194 Temperature_Celsius 0x0022 027 045 000 Old_age Always - 27 (0 14 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 16
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 16
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
Yes, there is a difference, but I'm not sure which is better.
When you replace a disk in a RAID5, you need all other disks to be read-error free to reconstruct the new disk. With modern drives, that's no easy challenge. The read error chance on huge modern drives is almost such that you're guaranteed to run into one. That's why RAID5 is not recommended anymore. You can find a lot of info about this on the internet.
By migrating to RAID6, you will also incur a write load on the old disks. This may even be advantageous: a drive can have 'current pending sectors' (see SMART). This means sectors it deemed damaged. It will reallocate them as soon as they receive a new write. If the sector is still not good enough to receive the write, the counter for 'reallocated sectors' will rise. The sector will then, transparently, reside elsewhere on the disk.
My first step would be to look at the SMART status of your drives, and look at the above two parameters.
But, I'm hesitant to recommend one way over the other if your drives indeed do have pending sectors. I think if they don't, I would first replace the disk in the RAID5, because that incurs a non-destructive operation on the other disks.
And have/make backups...