Building a Home NAS for $163 USD

Building a brand new home Network Attached Storage(NAS) device can be expensive, usually starting at $300 USD, for their intended purpose. Specialized NAS devices that have a portion of the functionality below start at a similar price range and quickly jump up to over $700 USD when getting to this level of feature set. Repurposing old computers to do this job can be economical, but in my experience requires happening to stumble across a good deal if you do not already have that hardware laying around.

The Lenovo EMC PX4-400D NAS was introduced in 2014 at a MSRP of $729 and as of March 2020 support for it was discontinued. This means the prices of it are being slashed to offload them from retailer inventories.

  • $150 – Lenovo EMC PX4-400D, including shipping and taxes from Newegg
  • $5 – Extra 2GB RAM from eBay, Apacer 2GB SOD PC3-12800 CL11
  • $8 – M.2 NVMe PCIe x4 adapter
  • Total Hardware Cost: $163 (Not including drives of course.)

What is special about the Lenovo EMC PX4-400D?

  • It is cheap.
  • It is a full computer with a BIOS, video output, and can have a custom operating system installed.
  • Claimed 55 watts maximum continuous power consumption Add 10 watts for each drive installed.
  • On-Board 1GB USB flash drive chip – I installed Unraid OS directly to it – Supports EFI Boot
  • 4x Hot Swap SATA Bays on a PCIe x4 Marvel RAID Controller(Hardware raid if you want it.)
  • Comes with Lenovo’s discontinued Linux distribution if you’re into that.
  • Half height PCIe x4 slot – NVMe support confirmed
  • eSATA port on the back, USB 3.0 port on the front, four USB 2.0 ports, and HDMI output
  • Intel Atom D2701 (Con: No virtualization support, but Docker works great.)
  • 2GB of DDR3 RAM expandable up to 4GB
  • Dual 1gb Ethernet with sequential MAC addresses

Preliminary speed tests with Unraid, HDD only Parity rebuild, I observed 90 MB\s average reading from three disks reading and writing to the parity drive. Writes to HDD and NVMe SSD fully saturates one of the 1gb links at around 95 MB\s. I did attempt to bond both of the 1gb ports to test faster speeds, but unfortunately my network switch was unhappy with that resulting in me having to reset the network configuration of Unraid OS from the command line. If you are questioning if the NVMe cache drive is necessary when the spinning disk hard drives can keep up with the network speed; the answer is yes. During a parity rebuild or check it get as slow as 10 MB\s. Since this setup is capable of maxing out a 1gb home network this is more than adequate for my needs.

I built two of these NAS units; one with 44TB for media and another with 24TB for important long term backups. The media NAS works excellent for storing and serving up files. I did attempt to use Plex on a Docker instance, but the low processing power of the Intel Atom CPU results in infinite buffering. This is due to Plex’s poor product design that requires transcoding every video before sending it. Mounting the Samba shares into Kodi works flawlessly even for a far away friend external to my home. The second NAS for backups works great for its intended purpose even without a cache drive. However, there is a performance degradation with the Unraid 6.8.x series and macOS Time Machine backups. Even with the work around of forcing case sensitive file name support it still can take twelve hours or longer to backup 500GB of data.

One the piece above about what makes this box great is that it comes with a built in USB flash chip soldered right to the motherboard. Installing Unraid or another OS on to this device requires deleting the existing partition and reformatting it. It is possible to avoid doing this and boot from an external USB drive, but that requires going into the BIOS to change the boot order since the stock BIOS resets this selection on cold boot. This means if the machine loses power someone will have to be physically present to press the Delete key on boot to change the boot order. Below is a brief overview of the process of installing to the internal USB drive. This guide assumes that you are minimally comfortable with the Linux command line and working with disk partitions.

  1. Create an Unraid or another Linux bootable USB drive.
  2. Change the boot order in the BIOS to boot from the new USB drive and reboot.
  3. Using fdisk:
    1. Wipe out the /dev/sda block device
    2. For Unraid create a new empty DOS partition table
    3. A new partition formatted as W95 FAT32 (LBA)
    4. Mark the device as bootable
  4. For other Linux distributions follow their instructions to format the drive.
  5. Unraid requires the /dev/sda1 to have a volume label of UNRAID (all uppercase) to boot properly.
    1. Use the mlabel utility to change the volume label.
      1. sudo mlabel -i /dev/sda1 ::UNRAID
  6. Create a new folder /tmp/UNRAID and mount the newly formatted device.
    1. mkdir /tmp/UNRAID
    2. mount /dev/sda1 /tmp/UNRAID
  7. At this point for Unraid a manual installation is required.
    1. Download the latest ZIP file package near the bottom of the page:
    2. Extract the ZIP archive to the root of the boot drive(/tmp/UNRAID)
    3. Do NOT use the make_bootable_linux script in the root folder. It makes assumptions about the install process that is incorrect for what is being done here.
    4. Enable EFI boot by renaming the EFI folder
      1. mv /mnt/UNRAID/EFI-/ /mnt/UNRAID/EFI/
    5. Make the system bootable with:
      1. sh /tmp/UNRAID/syslinux/ /dev/sda
      2. Note that the target is the block device itself and not the /dev/sda1 partition.
  8. Remove the USB flash drive and reboot.

If you plan to use Unraid there are some additional drivers and plugins that need to be added to get additional control over the motherboard’s PWM fan controller. The stock PWM fan curves are lazy and will result in hot drives if left alone. To remedy this the dynamix.system.temp and dynamix.system.autofan plugins must be installed. The available instructions out there are a bit outdated so in short here is what you need to install and do:

  1. Install the Nerd Tools/NerdPack plugin –
  2. Use NerdPack to install perl – Settings -> (User Preferences) Nerd Pack -> Search for “perl” -> Turn on perl.
  3. Install the dynamix.system.temp plugin –
  4. Install the dynamix.system.autofan plugin –
  5. Go to Settings -> (User Utilities) System Temp
    • Click “Detect” – It should find a coretemp nct6775 controller.
    • Click “Save”
    • Click “Load Drivers”
    • Assuming everything above worked set the:
      • Processor temperature -> Core 0
      • Mainboard -> SYSTIN
      • Array fan speed -> Array Fan
  6. Go to Settings -> (User Utilities) Fan Auto Control
    • For each PWM controller, select it, enable it, and click “Detect” next to the PWM fan field.
    • Click “Apply” afterwards.
    • Sometimes the script fails to detect a fan – There is only one in the system and it should be accessible at /sys/devices/platform/nct6775.2608/hwmon/hwmon1/fan1_input – Which can be manually entered into the PWM fan field.
    • Note: I may be misunderstanding the documentation for the overall PWM controller and it may only be necessary to enable one PWM controller.

You may also like...