Home NAS server

A little bit about yourself…

I hold the position FPGA software engineermy main tasks are:

  • Acceleration of network traffic processing due to hardware implementation on FPGA

  • Building a Linux system on SOC systems

  • Writing drivers to link software and hardware parts

  • Development of software and schemes

For a long time, my home server was a PC based on a MiniITX motherboard with an integrated processor. LInux (Debian) was not picked up, where Apache, Ftp, PHP, Ngnix, Git, Wiki, Samba, Torrent were installed…

For a long time I have been thinking about building a home server based on mobile processors and hard drives. There was no desire to collect everything at once from scratch, because. quite a lot of time to spend on this, which without that is not enough! Therefore, it was decided to make the server gradually, complicating the project.

Goals for the first step

  • Use a single-board ready-made computer to minimize time costs in the early stages

  • Use 2.5″ hard drives, since they are more efficient in terms of energy consumption and only need 5V to power them, they are small in size, they heat up less and are quieter in operation

  • The ability to manage and monitor the power of disks and single-card

  • Uninterrupted power with charge controller

  • Ability to connect up to 10 drives

  • Possibility of cooling with speed control for coolers

One-sleeve

For this home server, a single-plater was chosen Orange Pi4. At the time when I started development, the price and features were optimal. Selection criteria in favor Orange Pi4 served as follows:

Tests have shown that this single-platter has a slightly higher performance than my server based on the Gigabyte GA-N3150N-D3V motherboard with an integrated Intel processor® Celeron™ N3150 Quad-Core (1.6 GHz), which, in principle, was enough for me for home purposes. Also, in terms of power consumption, a single-card processor based on the RochChip RK3399 processor is more economical.

Structure

RK3399 has one PCIe 2.1 x4 bus that can work in Root Complex(RC) and End Point(EP) and a maximum speed of 2.5 GT/s per channel. Only two out of four lines are wired on the single-card board, which, of course, upset me a little at that time … I decided to connect a SATA controller on the ASMedia ASM1064 chip to this bus. This controller on the PCIe side works on x1 Gen3, on the SATA side the 4th Gen3 port.

On two ports of which it was planned to connect JMicron JMB575 multiplexers that support SATA3 Gen3, thereby getting 10 SATA ports. Bring the remaining two unused SATA ports of the controller to the connector so that you can further double the number of ports ..

Structural diagram of the SATA bus

Structural diagram of the SATA bus

Nutrition

The server itself is powered by a standard 19V power supply that comes with laptops. The charge controller, also known as a power manager, is responsible for switching between power from an external power supply and an internal Li-ion 3-Cell battery. And also, if the input power goes beyond the permissible range, then the system switches to the internal battery.

An active balancer has been assembled for batteries, with the ability to enable / disable programmatically balancing voltage between battery banks. This makes it possible to compensate for skew when charging or discharging batteries with slightly different capacities.

Power supply for single-card 5 V / 5 A, which is enough to be able to connect external pockets, flash drives, etc. via USB.

It is possible to monitor the input voltage of the power supply, the current consumption of the single-card and hard drives separately. You can also monitor battery voltage and charge / discharge current, which makes it possible to monitor the power consumption of the server.

Hard drive management

Each HDD can be individually turned on/off. Near each disk, you can turn on an individual LED to indicate a program event. Also for each disk there are LEDs, power status and disk activity.

It is possible to find out the presence of disks inserted into the slots, regardless of whether the power for the hard disk is turned on.

To cool the disks, there are two outlets for coolers, with the ability to adjust the speed.

Assembly

Down side

Down side

Upper side

Upper side

During assembly

During assembly

Launch and Debugging

In the process of launching and debugging, as always, it was not without minor sins … Apparently, the fact that this project was done in the evenings after work, sometimes on weekends, had an effect, and its development took a long time.

PCIe did not start right away, because I made a mechanical error in the layout of the board, as a result of which I had to solder the adapter, with which everything started well. And Linux saw the controller on the bus:

Also, JMB575 multiplexers for 6 GT / s started without problems, as can be seen from the output of the dmesg command:

This screenshot shows that the system picked up the host controller, which started normally, and could even do better…

SATA port tests

An SSD drive is connected to one of the ports, in this case 9, the output of commands, with 256 MB, 512 MB, 1 GB written to it:

dd if=/dev/zero of=/home/SSD/tmp bs=1M count=256; rm /home/SSD/tmp
dd if=/dev/zero of=/home/SSD/tmp bs=1M count=512; rm /home/SSD/tmp
dd if=/dev/zero of=/home/SSD/tmp bs=1M count=1k; rm /home/SSD/tmp

Test with hdparm -tT /dev/sda utility:

Copying from a regular screw to an SSD

From SSD to normal

Conclusion df-hwith almost all disks enabled and mounted

Also the output of dmesg when the disk is powered on and its definition in the system

Power and status monitoring

Explanations:

  • power — power manager and controller status

  • HDD Led — which LEDs near the disks are enabled programmatically

  • HDD power — which drives are powered on

  • HDD Detect — disk status

  • Vsys0, Isys0 –voltage and current of the single-carrier

  • Vsys0, Isys0 — voltage and current of hard drives

  • Vbat, Ibat — battery voltage and current

This data is parsed by the script…

The board has an STM32 controller for fan control, power monitoring, and is connected to a single-card board via a serial port. I also brought a CAN bus on it in reserve, but have not yet implemented it.

And I slightly modified the power manager, so that it was like a regular computer, if you plug it into the network, it will not turn on by itself until you press the power button. When the single-carrier is working, pressing the power button will shut down the system and turn off the power completely. If for some reason the single-platter hangs, then holding the power button will turn off the system completely.

Electricity consumption

If the system is idle and only one SSD is turned on, the fans are off, then:

Total disk consumption + SATA controller with multiplexers

Vsys1*Isys1 = 19.26v * 0.28a = 5.4W

Single-card consumption in idle, nothing connected to USB

Vsys0*Isys0 = 19.26v * 0.43a = 8.3W

Total: 13.7 W

If all processors of a single-card processor are loaded at 100% and all disks and fans are turned on, then:

Total disk consumption + SATA controller with multiplexers

Vsys1*Isys1 = 18.97v * 1.13a = 21.4W

Single-card consumption in idle, nothing connected to USB

Vsys0*Isys0 = 18.97v * 0.79a = 15W

Total: 36.4 W

If else, start copying from one disk to another, then Isys1 = 1.22a it’s already 23W.

And when all disk fans are disabled and the single-boarder is idle, then:

Vsys1*Isys1 = 19.29v * .34a = 6.5W

Single-card consumption in idle, nothing connected to USB

Vsys0*Isys0 = 19.29v * 0.23a = 4.4W

Total: 10.9 W

Battery operation:

Single-carrier idle, one disc included

Single-carrier idle, one disc included

Single board, 100% processors, one drive included

Single board, 100% processors, one drive included

Again from the power supply, there is a charge

Again from the power supply, there is a charge

Results, conclusions

Since there are many files that are rarely used, when they are accessed, the disk is turned on, and when it is idle, it is turned off. This in turn saves energy.

As for me, this server is enough for a home file dump, and git works normally, which loads the processor quite heavily. Since the network is Gigabit, the current disk speeds are enough.

Currently, due to the workload, there is no way to model the case and assemble the server so that it has a finished look, so it is still without a case, but this does not prevent it from performing its functions.

Since this project has shown sufficient results for use in the home, where important criteria are low power consumption, small dimensions, a total large volume of hard drives, minimal heat generation and low noise. In connection with the foregoing, in the near future I am going to double the capacity of the batteries, which will double the battery life and at the same time reduce the current to the battery by half, which in turn will increase the battery life.

Future plans

I started to draw the next modification of the NAS server on a larger number of disks, about it next time…

And this server may be put up for sale …

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *