Small NAS project |
This Network Attached Storage (NAS) project uses a Raspberry Pi 5 running the Bookworm OS and the ‘stable’ v7 of the openmediavault software (OMV7). USB drives are used for the storage media as they can be simply connected to the Raspberry Pi and OMV7 allows them to be easily formatted from its 'admin' screen and configured with multiple shared folders etc. The initial build has used a 1TB and a 2TB USB drive connected to the Pi's two faster USB ports, plus a simple 16GB USB stick connected to one of the slower USB ports is used for some additional code that controls an OLED that is 'set into' one of the enclosure walls and shows some real time stats for the operation of the NAS.
The build is described as 'small' since the Raspberry Pi 5 can safely support the power requirements of the USB drives through its USB ports, so the custom 3D printed enclosure can be a very compact design - with a size that is only 150mm wide x 100mm deep x 86mm high.
Custom enclosure design and build
The enclosure uses a build/print approach, first developed for a ESP32 controlled 'sensor box' project described here, and subsequently also used for the large NAS variant described here. This approach allows each ‘wall’ of the box to be printed separately and flat, which makes the 3D print process more reliable.
The 3D print designs were initially created in FreeCAD and the series of images below, produced in FreeCAD, illustrate how the assembly of the main components was modelled to ensure they all fitted together properly before committing to what are quite long print times for each major print item.
FreeCAD was used to generate .STL files suitable for use with a 3D printer 'slicer' program (PrusaSlicer used) and the print files for all the components and their options can be downloaded from the Prusa web site here.
The Raspberry Pi 5 is secured to the enclosure base with 6mm M2 self tap flanged pan head screws, and if the 'plain' front wall is being used (see below) the clamp bar that secures the 2 cables to the block on the base uses 6mm M3 pan head screws, which are also used to secure the SD opening bar to the base - all as shown below.
To connect the USB C power supply cable to the Raspberry Pi, as shown in the image on the right, a USB cable adapter (Type-C Male to Female Right Angle) is used as there is not a lot of room between the edge of the Pi and the front wall.
As shown below, the front wall is interlocked to the base using 16mm M3 pan head screws (these need only be a minimum of 12mm long) that engage with M3 nuts that are ‘pulled’ into the hex openings on the corner blocks. Appropriate drive rails, that the USB drives will slot into, are attached to the front wall using 4mm M3 pan head screws and for this build a Toshiba 1TB and a Seagate 2TB drive were used. It should be noted however that use of Seagate Expansion Portable, 4TB, External Hard Drive, 2.5 Inch, USB 3.0 drives had to be abandoned because a software configuration could not be found to make the drives spin-down when not used for a period of time.
The 'front' wall of the enclosure comes in two versions, as shown in the first two images below, so that optionally the power supply and ethernet cables can be terminated inside the enclosure to adaptors embedded in the wall - allowing the external cables to be easily attached/detached to/from the device.
An insert, shown in the 3rd image above, then allows an ethernet-to-ethernet connector and a USB C panel adaptor to be fixed to the insert and the combined assembly to be secured to the wall with a 4mm M3 pan head screw at the bottom and a 6mm M3 pan head screw at the top. The top screw is longer because a 'strap', shown in the 4th image above, is used to firmly secure the ethernet-to-ethernet connector, and it is also secured using the top 6mm M3 pan head screw.
Close-up images of the type of ethernet-to-ethernet connectors used and the panel assembly installation are shown in the images above right
The 'back' wall of the enclosure also comes in two versions, as shown in the first two images below, so that optionally an OLED can be inserted into the wall.
A 'carrier' for a 128x64 pixel OLED is used so that the opening in the wall can accommodate different carriers since there are at least two commonly available variants of the 128x64 sized OLED, i.e., either 27.3 mm wide x 27.8mm high, or 24.7mm wide and 27.0mm high. The third image below shows the 'carrier' insert design (OLED01) for the larger available variant, where the OLED is sandwiched between a base and a cover. The 'carrier' assembly is secured in the wall opening using 4mm M3 pan head screws that self tap into bosses on the wall and the OLED cover is secured to the 'carrier' base using 6mm M2 self tap flanged pan head screws. When the 'carrier' base is 3D printed it is positioned on the print bed in the same orientation as shown in the image below, which means that the four tab areas need 'print support' - but when the support material is removed it rarely leaves a smooth surface so the bearing sides of the tabs will need to be filed smooth.
The enclosure top, 1st image below, is fixed in place with its 16mm M3 pan head screws that engage with their M3 nuts that are ‘pulled’ into the hex openings on the corner blocks.
The two end walls, 2nd and 3rd images below, are then secured in place with 6mm M2 self tap flanged pan head screws.
Below are a series of additional photo images taken at various stages of the build:
|
|
Finally, of particular note, is that special disk drive-to-USB port connection cables had to be sourced, as the enclosure space is particularly 'tight'.
The image on the right illustrates the 10cm flexible/flat cables that were used, which can also be seen in some of the 'internal' images above
System software
The main software for the system is openmediavault v7 running on Bookworm 64bit Lite, with the openmediavault system regularly updated using the admin function, currently (03Apr'25) at 7.7.2-1 (Sandworm).
The openmediavault software is very extensive and can configure every possible usage mix required with multiple storage media e.g. 1x 1TB + 1x 2TB USB drives and a 16GB USB 'stick' for this build. The file system of each physical device can be configured (EXT4 used for this build) and multiple shared folders with different access permissions defined. To easily support access from Windows machines on the same network, SMB/CIFS shared folders can also be defined with defined permissions so that these folders can simply 'appear' as accessible storage areas to a Windows machine.
In addition to the main openmediavault system the following additional software is used for this build:
Disk spin-down
As this NAS will only have very intermittent use, additional measures have been taken to ensure the 1TB and 2TB disks spin-down when they have not been used for a period of time.
openmediavault does have functionality that can do this, but it does not always work consistently with all disk types, the hd-idle software was therefore installed using the version maintained at https://github.com/adelolmo/hd-idle. The github link describes all the required installation and configuration methods needed and has been found to work well with the Toshiba 1TB disk an well as the older 2TB Seagate drive used in this build.
OLED control
The optional OLED installation used in the final build, is a very common small 128x64 pixel display connected to the Raspberry Pi's I2C interface, that can be easily controlled with the Adafruit-SSD1306 Python module. But the main Bookworm 64bit Lite OS is a very 'stripped down' system, so some additional installs were required, i.e.
sudo apt install python3-pip
sudo pip3 install Adafruit-SSD1306 --break-system-packages
sudo apt install i2c-tools
In addition the dtparam=i2c_arm=on line in /boot/firmware/config.txt was 'uncommented'.
The custom Python code used is a simple derivative of the 'standard' simple_text.py example provided as part of the Adafruit-SSD1306 installation and runs every 10 minutes as a cron.
The following pages provide further detail about the NAS projects:
All the currently available maker project information: