Feed on
Posts
Comments

A little while ago I had a Netgear ReadyNAS unit which was faulty and wasn’t able to repair it however I thought it would be worth re-using the case to make my own NAS using the Raspberry Pi. I decided to build my own SMPS to provide 5V and 12V to the drives and the Pi and I’m using USB hub with 4x USB to SATA adapters to connect to the 4 hard drives.


(how it all looks at the moment)

After hooking up an 16×2 LCD display to the Pi, I made a start up script in Python to check the drives, assemble the array, mount it and then display the RAID status and free space (see the video above).

We schedule this boot up script in the crontab under the user root and firstly check the Reallocated Sectors, Current Pending Sector and Offline Uncorrectable in the SMART data for each drive. If any is more than 0, we say the drive is failing and print out the results. Next we assemble the array (it seems the USB to SATA doesn’t initialise before the array is trying to be assembled automatically) and then mount the array. Every 60 seconds afterwards, the array is checked to see that all drives are up and then we grab the used/free space. Download bootup.py

Next time I’ll be putting it NAS enclosure and hopefully with these improvements

  • Enable power button which would be independent of the Pi which would switch a relay on or off to power the drives and Pi
  • Making the front panel backup button able to run a backup script
  • The 4 front panel LEDs to indicate drive status and use iostat to show activity on “Act” LED
  • Connect the temperature sensor to both mosfets and power down if over temperature
  • Change the inductor to a thicker wire one as it’s reaching 84C when the array was rebuilding (hence why I had a fan on blowing on it)

Part 1
Part 2

6 Responses to “Building NAS4Pi: A NAS built using the Raspberry Pi – Part 1”

  1. G says:

    What kind of usb to sata cables did you use?

  2. dientuki says:

    Hi Alex, I’m tryng to do something like that using the raspberry pi B+ (4 usb port) without use the HUB (I want to connect the HD direct to the raspberry) using the cable that you use with you wifinas (https://www.insidegadgets.com/2014/08/30/building-wifipinas-a-single-bay-2-5-nas-using-the-raspberry-pi/).
    We need some help with the electronic ¿can you help me?

    Thanks

Leave a Reply