# be root
sudo su
# show all drives, make sure it shows partitions,
# such as sda1 (sda is not enough)
lsblk
AME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 18.2T 0 disk
└─sda1 8:1 0 18.2T 0 part
sdb 8:16 0 18.2T 0 disk
└─sdb1 8:17 0 18.2T 0 part
sdc 8:32 0 18.2T 0 disk
└─sdc1 8:33 0 18.2T 0 part
sdd 8:48 0 18.2T 0 disk
└─sdd1 8:49 0 18.2T 0 part
sde 8:64 0 18.2T 0 disk
└─sde1 8:65 0 18.2T 0 part
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 6.9G 0 part /
# create the array
mdadm --create /dev/md5 --level=5 --raid-devices=5 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md5 started.
# check the array
mdadm --detail /dev/md5
/dev/md5:
Version : 1.2
Creation Time : Sat Jun 15 17:52:00 2024
Raid Level : raid5
Array Size : 78126764032 (72.76 TiB 80.00 TB)
Used Dev Size : 19531691008 (18.19 TiB 20.00 TB)
Raid Devices : 5
Total Devices : 5
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Sat Jun 15 17:53:11 2024
State : clean, degraded, recovering
Active Devices : 4
Working Devices : 5
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : bitmap
Rebuild Status : 0% complete
Name : nas7:5 (local to host nas7)
UUID : 762dfe27:e976534f:0d66ec1b:271b9185
Events : 16
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
2 8 33 2 active sync /dev/sdc1
3 8 49 3 active sync /dev/sdd1
5 8 65 4 spare rebuilding /dev/sde1
# Notice that the spare drive, /dev/sde1, is shown to be rebuilding.
# If it's a new array, format it.
# If you format the array, this will DESTROY all your existing data!
mkfs.ext4 -F /dev/md5
# this will take forever. Let it finish.