40 HDD is a lot.
Check out 45 Drives. They have a homelab focused offering that has 15 bays https://45homelab.com/#product
To get 40 hard drives, you’d be looking at something like their Storinator S45 https://www.45drives.com/products/storinator-s45-configurations.php
Just discovered these when I asked Mastodon what OS I should use for a PC I’m building with my kid. Looking forward to trying them out!
https://hachyderm.io/@PeterBronez/112496363400912617