Trouble creating RAID 5 with 4 drives

I have 4 WD Red NAS 1TB 2.5inch HDD, and every time I tried to create a RAID 5 with 4 drives with this command

sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd

It would give a really slow transfer rate then fail. So I would get Raid 5 clean, Failed.

I checked if I had a faulty drive and none of them are faulty. I also made RAID 5 with 3 drives with this command

sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sda /dev/sdb /dev/sdc

And that works well. I also switched around the HDD and issues the same command as the above, and it works fine. Its just creating a RAID 5 with 4 drives is an issue. Any help that someone can provide?

1 Like

Please test the following command

sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sda /dev/sdb /dev/sdd

@setq Unfortunately that failed as well. Here is my output for mdadm -D /dev/md0

pi@raspberrypi:~ $ sudo mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Mon Jun 1 17:16:38 2020
Raid Level : raid5
Array Size : 1953260544 (1862.77 GiB 2000.14 GB)
Used Dev Size : 976630272 (931.39 GiB 1000.07 GB)
Raid Devices : 3
Total Devices : 0
Persistence : Superblock is persistent

 Intent Bitmap : Internal

   Update Time : Mon Jun  1 17:19:56 2020
         State : clean, FAILED
Active Devices : 0
Failed Devices : 0
 Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 512K

Consistency Policy : bitmap

Number   Major   Minor   RaidDevice State
   -       0        0        0      removed
   -       0        0        1      removed
   -       0        0        2      removed

Here is my pastebin for dmesg
anything else I should do? Im starting to think something may be wrong with the SATA board.

Please try disabling UAS to see if it helps.

Sorry how would I go about disabling UAS?

Edited:

Sorry I figured out how to do it here, however the raid creation speed is really slow
here is an example

pi@raspberrypi:~ $ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdd[4] sdc[2] sdb[1] sda[0]
      2929890816 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]
      [==>..................]  recovery = 12.2% (119371916/976630272) finish=81106.2min speed=176K/sec
      bitmap: 0/8 pages [0KB], 65536KB chunk

unused devices: <none>

How would I fix this?

I can confirm disabling UAS doesnt work

What’s your version of Quad SATA HAT?

It’s meant to be slow, it took about 5 hours with 4 X 2Tb drives though not at 176kbs, with 4 X 2TB WD disks it did the rebuild at 80-90MBS

Mount each drive seperatly and run some transfer tests or use hdpram

sudo hdparm -Tt /dev/sda /dev/sda:
Timing cached reads: 16924 MB in 2.00 seconds = 8469.95 MB/sec
Timing buffered disk reads: 1386 MB in 3.00 seconds = 461.50 MB/sec

If they are return OK on the separate disks then its not a HAT problem. MDADM is software raid so if the individual disks check out you know its not hardware.

@setq I am using the V1.2 sata hat

Here are my hdparm values

pi@raspberrypi:~ $ sudo hdparm -Tt /dev/sda /dev/sda

/dev/sda:
 Timing cached reads:   1746 MB in  2.00 seconds = 872.78 MB/sec
 Timing buffered disk reads: 324 MB in  3.02 seconds = 107.40 MB/sec

/dev/sda:
 Timing cached reads:   1738 MB in  2.00 seconds = 868.76 MB/sec
 Timing buffered disk reads: 324 MB in  3.01 seconds = 107.59 MB/sec
pi@raspberrypi:~ $ sudo hdparm -Tt /dev/sdb /dev/sdb

/dev/sdb:
 Timing cached reads:   1742 MB in  2.00 seconds = 870.98 MB/sec
 Timing buffered disk reads: 346 MB in  3.01 seconds = 115.03 MB/sec

/dev/sdb:
 Timing cached reads:   1730 MB in  2.00 seconds = 865.02 MB/sec
 Timing buffered disk reads: 334 MB in  3.00 seconds = 111.33 MB/sec
pi@raspberrypi:~ $ sudo hdparm -Tt /dev/sdc /dev/sdc

/dev/sdc:
 Timing cached reads:   1742 MB in  2.00 seconds = 871.26 MB/sec
 Timing buffered disk reads: 344 MB in  3.01 seconds = 114.32 MB/sec

/dev/sdc:
 Timing cached reads:   1708 MB in  2.00 seconds = 854.14 MB/sec
 Timing buffered disk reads: 346 MB in  3.02 seconds = 114.68 MB/sec
pi@raspberrypi:~ $ sudo hdparm -Tt /dev/sdd /dev/sdd

/dev/sdd:
 Timing cached reads:   1754 MB in  2.00 seconds = 877.25 MB/sec
 Timing buffered disk reads: 156 MB in  3.01 seconds =  51.82 MB/sec

/dev/sdd:
 Timing cached reads:   1752 MB in  2.00 seconds = 876.06 MB/sec
 Timing buffered disk reads: 152 MB in  3.03 seconds =  50.15 MB/sec

Keep this in mind, that this is with UAS disabled. However I have noticed something, when creating the RAID using mdadm, it would slow done after a while

Personalities : [raid6] [raid5] [raid4] [raid1]
md0 : active raid5 sdd[4] sdc[2] sdb[1] sda[0]
      2929890816 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]
      [>....................]  recovery =  0.8% (8082236/976630272) finish=823.9min speed=19591K/sec
      bitmap: 0/8 pages [0KB], 65536KB chunk

unused devices: <none>

I wonder if this is software fault

1 Like

I ended up testing each drive individually by placing the drive on each SATA port, and issued the hdparm -Tt /dev/sda command. I can safely conclude that SATA 4 isn’t working as it should since it keeps giving me slow read speeds rather then the rest with similar speed as posted above.

Hello, Ibrahim_Mushtaq

This looks like a hardware problem. Can you take a photo of the back for me?

It could also be a connection problem. Please don’t put them in the box to test again.

@setq here is the photos:

I stopped the whole operation, I sent a request to change the board.