Raid 5 using 4TB drives

Recently purchased the SATA Hat. I have 4 - 4TB Segate drives.
When I issue the command: sudo mdadm --create --verbose /dev/md/vol1 --level=5 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1 --spare-devices=1 /dev/sdd1
But when I run the command: sudo mdadm --detail /dev/md/vol1
it shows the Array Size of around 7.5TB.
Using 4TB drives in a Raid 5 I should get 12TB.
All 4 drives show up on my Raspberry Pi 4.
I have also connected each one to my pc, formatted them and verified they show 4TB.
Is there something that I am missing?

Any help would be apperciated.

IMO that’s not correct what you are stating.
3 disks (4TB) in Raid5 does not give you disk x 3 (12TB) in storage. That would only be so for Raid0
Roughly you should get 12TB -1/3rd of total => 8TB + some overhead (the 7.5TB you’re gettiing)

I am using 4 - 4TB drives for the raid, not 3. If I said 3 it was a mistake.

Here is the output from: mdadm --detail /dev/md/vol1

Your 4th disk is a spare. It’s not actively used in the RAID, only when a disk should fail, the rebuild starts automatically on the spare disk.

To be frank: I was a bit to severe with my 1/3rd loss. It’s probably a bit more efficient in terms of diskspace.

I have set up other software raids 5 arrays b4. I currently have a 9TB array using 4 - 3TB drives on a Ubuntu system. Don’t understand why I cannot get this one setup and running.
Is there a limitation with the Raspberry Pi OS?
Can I use Ubuntu on the Raspberry and the SATA Hat?

You’re not using 4 drives. You’re using 3. One is a spare.

I understand that. 3 - 4TB drives should give me 12TB with the 4th drive being a spare.
http://www.raid-calculator.com/default.aspx

You have 4 disk in there. You are not using 4 disks. It should be 3.

3 x 4TB in RAID5 doesn’t give you 12TB. Do you know how RAID5 works?

1 Like

I don’t think you do understand. If you did:
sudo mdadm --create --verbose /dev/md/vol1 --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

You would be using 4 devices and have 12TB. But making one a spare the way you did, you’re actually only using 3 drives.

1 Like

Thank you. I now see where I was going wrong. I should not have been using the -spare option.
It appears to be working now.
Thanks for your patience :slight_smile:

Glad it works now :+1: