When you have several computers and lots of files around the house it is useful to have a NAS (Network Attached Storage) device to share files, stream media with Plex, and backup data. My current system is an old QNAP TS-251 and a very old, unsupported, QNAP TS-110. I wanted something new and faster which sounded like a project for the Raspberry Pi.
NASsieNASsie key features/requirements:
- Professional style compact case
- Raspberry Pi CM4 with IO board
- PCIe SATA interface card
- 4 hot-swap bays (2 * 2.5 inch & 2 * 3.5 inch)
- All 3D printed case
- User interface with color LCD display and buttons
- OMV 6 NAS software
- 4 USB (2 front & 2 back), Ethernet, and 2 HDMI ports.
- Custom pHAT interface board
I used a Raspberry Pi CM4 because the Compute Module 4 IO board has a PCIe slot and I thought I would need a PCIe SATA card to get good performance from the storage drives. Luckily Jeff Geerling had already created a table of PCI cards that work with the Raspberry Pi (https://pipci.jeffgeerling.com/).
I wanted the case to be as small as possible so that the 4-bay NASsie would be a similar size to the 2-bay QNAP TS-251 it was replacing. Since I am using the CM4 IO board and I wanted its connectors out the back of the case, this set the width of the case. The size of the drives sets the height and depth of the case. There is a bit of an overlap between the IO board and drives to make it more compact.
My thinking was that SSDs (Solid State Drives) are faster and more reliable than spinning HDDs (Hard Disk Drives) but they have smaller capacities and are more expensive. So I thought an SSD for my important files and an HDD for larger media files and backups. The problem with a NAS is what to do when you fill the drive and run out of storage space. My answer is to include 2 bays for each drive type so when the first drive if full you can add a second drive. This is done using LVM2 (Linux Vomule Manager) which means you can add a second drive to the volume and its size increases without needing to change anything. This solution is good but there will be an SSD-based directory and an HDD-based directory. I ideally just want to share 1 directory on the network so files are easy to find and use. Mergerfs allows directories to be merged and then they can be shared. With this setup computers on the network see one shared drive which actually has 1-4 SSDs and HDDs behind it.
I have a Prusa 3D printer and wanted to completely 3D print the case. This was a good project in itself and helped keep the overall cost down. I had not done a big complex project like this before and Fusion 360 did not seem the easiest to use. I did get it all done in the end with some help from my son who is a bit of a Fusion 360 expert. The case can be printed on any 3D printer with at least 235mmx170mmx135mm build volume. This is a big print project, on my Prusa mk4 it took 922g of filament and 37 hours to print.
The case is composed of 3 components: the top, the bottom, and the drive cage. The top and bottom are basically "U" shaped pieces that form a cuboid. The drive cage screws into the bottom of the case with 3 screws and embedded nuts. The case top screws on with 4 screws and embedded nuts. The drives are installed in the drive caddies and just slide into the bays in the drive cage. The SATA connectors are in the back of the drive cage with a long bolt to hold them securely for insertions and removals. All of the bays need to have drive caddies to allow proper airflow. There are also dual USB ports on the front.
The fan and WiFi antenna mount on the back of the case bottom and the user interface is at the front. There is a lighted power switch, 2 buttons, and a 2.4-inch colour LCD. A simple custom pHAT was created to connect everything to the Raspberry Pi. The pHAT includes some connectors and level shifters because the power switch LED needs 5V and the fan control needs 12V.
I think the case design works well and I included the Loch Ness Monster (Nessie) based NASsie logo as a nod to Scotland.
The design and details for printing the case are on printables.com. Follow the instructions for printing the pieces.
Building the Drive CaddyPut the drive into the caddy and use the four of the appropriate screws to secure it.
In order to make the system robust for inserting and removing the drives, a bolt was put through the SATA connector. A hole for the bolt needs to be drilled. Do this by putting a drive into the bay and connecting the SATA connector, then drilling through the bolt hole. Do this for all four connectors.
Install the 2 SATA cables in the 3.5-inch bays and insert a countersunk bolt and nut to hold them in place. Glue can be added around the connector for a tighter fit if needed. Repeat for the 2.5-inch bays.
Cut the power connectors off the SATA cables and use wire ties to route the wires to shorting blocks (1 for ground, +5, and +12). The SATA data cables get wire ties to hold them in place for the SATA PCIe card.
Finally, add the power supply board and connect the 5V (red wires), 12V (yellow wires), and ground (black wires) cables to it. The input to the power board is a barrel connector that will go to the CM4 IO board. The power supply board output is adjustable, make sure it is set to 5V before powering any drive.
The last thing to do on the drive cage is to put the embedded nut into the right side of it. The top case will connect to it. The drive case is now complete.
Building the Bottom CaseStart by installing the embedded nuts in the base. 3 for in the tall cylinders for the drive cage and 3 on the sides for the top case. Be careful with the front nut for the top case, there is not much material behind it so it is very easy to push it all the way through. A screwdriver might be needed to stop this.
Next, add the front USB ports.
Some changes are needed to the CM4 IO board for this project. The front USB port connector is arranged as 2x5 pins, however, 1 of the pins is filled in so there is only 1 way to connect it. On the CM4 IO board, it has a full 2x5 pin header. One of the pins on the CM4 IO board needs to be cut off to fit the connector (see photo).
The HDDs need 12V so a pass-through power barrel connector was added to power the HDDs and power board to generate 5V for the HDDs.
The pHAT has through-hole components and sits above the backup battery. To make sure nothing gets shorted by the battery socket it should be covered with electrical tape. If the backup battery for the RTC is required, it should be installed now because it is not easy to get to when the NASsie is completed.
The CM4 IO board is installed with 4 small screws.
A custom Raspberry Pi pHAT was designed for NASsie. The schematics and PCB layout are in the attached documents section. The pHAT has a couple of level shifters and connectors on it. The level shifters are needed because the Raspberry Pi I/O is 3V but the power LED uses 5V and the fan uses 12V. Wire the LCD directly to the pHAT and use connectors for the buttons and power switch. The buttons were mounted on a small piece of perfboard.
The user interface buttons and LCD should be installed with small screws. The LCD is mounted upside down with the wires at the top. Make sure the buttons work freely, otherwise, the screws might need to be loosened. The power switch gets screwed into its hole.
The pHAT board should be installed next. The single yellow wire should be connected to the 12V shorting block on the drive cage when it is installed. The 12V is needed for the fan.
Install the fan with the 4 screws that should come with it. If WiFi is needed then install the external WiFi antenna and connect it to the connector on the CM4. The SATA PCIe card should be installed next and the SATA data cables connected. An IO Crest 4 port SATA card was used because it is inexpensive and works with the standard kernel.
Finally, attach the case top with 4 screws. That is theNASsie hardware assembly complete, see the next project for installing the software and start using it.
The software installation is documented in a NASsie software project.
Comments