I have a raid5 set up with mdadm and had to replace one broken hard drive. It worked for a while, but for some reason, became inactive after a couple of weeks.
I'm pretty sure that the missing drive /dev/sdb is also the one I replaced:
# sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Raid Level : raid0
Total Devices : 3
Persistence : Superblock is persistent
State : inactive
Working Devices : 3
Name : REMOTENAME:0 (local to host REMOTENAME)
UUID : 59f98bf3:274707c2:2d79bc60:f0217294
Events : 212054
Number Major Minor RaidDevice
- 8 64 - /dev/sde
- 8 32 - /dev/sdc
- 8 48 - /dev/sdd
Next, /proc/mdstat contains:
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : inactive sdc[1](S) sde[4](S) sdd[2](S)
23441683464 blocks super 1.2
unused devices: <none>
The hard drive state seems to be ok, as no errors are with smartctl for /dev/sdb.
Lastly, mdadm --examine /dev/sdb yields:
/dev/sdb:
MBR Magic : aa55
Partition[0] : 4294967295 sectors at 1 (type ee)
EDIT: Thank you all for your comments! I'm actually not the one who setup that RAID, more like the lucky one inheriting the responsibility for it. I'll gladly take your advicde for the next setup :)
You're actually right, that it says raid0 now. I found a textfile where I saved the output of mdadm --detail /dev/md0 which might be insightful?
# sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Jul 24 13:22:48 2018
Raid Level : raid5
Array Size : 23441682432 (22355.73 GiB 24004.28 GB)
Used Dev Size : 7813894144 (7451.91 GiB 8001.43 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Mon Sep 4 07:36:57 2023
State : clean, checking
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : bitmap
Check Status : 77% complete
Name : REMOTENAME:0 (local to host REMOTENAME)
UUID : 59f98bf3:274707c2:2d79bc60:f0217294
Events : 212051
Number Major Minor RaidDevice State
5 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
4 8 64 3 active sync /dev/sde
Possibly related, I found some differences between the hard drive /dev/sdb and the other ones of the raid:
# sudo lshw -class disk
...
*-disk
description: ATA Disk
product: WDC WD80EFZZ-68B
vendor: Western Digital
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/sdb
version: 0A81
serial: ---
size: 7452GiB (8001GB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=a931e3f0-c80c-447b-b4f6-e3a06b9b51a7 logicalsectorsize=512 sectorsize=4096
*-disk
description: ATA Disk
product: WDC WD80EFZX-68U
vendor: Western Digital
physical id: 0.0.0
bus info: scsi@2:0.0.0
logical name: /dev/sdc
version: 0A83
serial: ---
size: 7452GiB (8001GB)
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=4096
...
Previously, there was no partitioned info given on the old drive /dev/sdb:
*-disk
description: ATA Disk
product: WDC WD80EFZX-68U
vendor: Western Digital
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/sdb
version: 0A83
serial: ---
size: 7452GiB (8001GB)
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=4096
EDIT2:
As the array was inactive, I reactivated it successfully using sudo mdadm --run /dev/md0. You are right, that somehow, potentially after a reboot, /dev/sdb dropped out of the array/was removed?...
# sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Jul 24 13:22:48 2018
Raid Level : raid5
Array Size : 23441682432 (22355.73 GiB 24004.28 GB)
Used Dev Size : 7813894144 (7451.91 GiB 8001.43 GB)
Raid Devices : 4
Total Devices : 3
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Thu Nov 2 14:10:31 2023
State : clean, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : bitmap
Name : REMOTENAME:0 (local to host REMOTENAME)
UUID : 59f98bf3:274707c2:2d79bc60:f0217294
Events : 212077
Number Major Minor RaidDevice State
- 0 0 0 removed
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
4 8 64 3 active sync /dev/sde
My question now would be: Should I re-format the disk on /dev/sdb before adding it to the array again?
And a bonus question, as it has been pointed out: Can you savely transform an existing raid5 into, e.g. raid1 or raid6?