How can I know if one disk faults on RAID 5?
Solution 1:
What system is the RAID hosted into ? Most modern NASes (I've operated both Synology and QNAP) have built-in notification channels and strategies readily available and that contemplate a variety of events, disk failure being one of the most common. This all goes through the NAS' GUI. More in general (and including these NASes which are linux-based machines), one candidate to investigate disks status via command line is smartctl, which will give you detailed information about the S.M.A.R.T. status of the disks. You should find enough detailed information here (especially on how to install it if it's not already): https://www.smartmontools.org
Once you have it, you can first of all check if the disks support S.M.A.R.T. (again, most modern, mainstream disks do). This is one of my disks in my Synology box:
$ sudo smartctl -i /dev/sda
Password:
smartctl 6.5 (build date Mar 30 2020) [x86_64-linux-3.10.105] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Iron Wolf PRO
Device Model: ST4000NE001-2MA101
Serial Number: XXXXXXX
LU WWN Device Id: 5 000c50 0cbe3d8cb
Firmware Version: EN01
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: Unknown(0x0fe0) (minor revision not indicated)
SATA Version is: SATA >3.2 (0x1ff), 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Mar 5 14:56:21 2021 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
As you can see, S.M.A.R.T is available and enabled in this disk. If it's not enabled, smartctl can attempt to enable it (using the -s or --smart option). This ensured, you can quickly have a glance on the disk's status:
$ sudo smartctl -H /dev/sda
smartctl 6.5 (build date Mar 30 2020) [x86_64-linux-3.10.105] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
and that informs me that the disk is in good health. You can then use smartctl for more detailed analysis and to gather detailed information about each single S.M.A.R.T. indicator supported by your disks (not all disks support the very same set, even within the same manufacturer and within the same family of disks).