OpenWrt on Readynas Ultra 2 (Atom D425)

This is quite an old nas but I got one cheap on eBay in untested condition so ideal for a bit of tinkering.

Specs: Intel Atom D425, x86-64, 1 GB DDR3 RAM which can be upgraded, approximately 120 MB of internal (USB) storage, 2 SATA slots, 1 USB 3.0 port, 2 USB 2.0 ports, 2 Gb Ethernet ports

Someone already documented how to run Ubuntu which provided a lot of usefull info:

Netgear still has the firmware downloads and other recovery tools available but I don't care about stock firmware so didn't bother try to restore it to factory.

Netgear has made the UART pins available on the back of the unit under a sticker so there is no need to disassemble the NAS. Via serial it possible to access the bios and there is an easy method to make the NAS boot from USB. So the plan is to run OpenWrt from the internal ~120MB (USB) storage such that the hard drives are just for data storage and can be put to sleep when not in use.

Requirements: ReadyNas Ultra 2, usb serial connector, usb stick, Linux machine / VM that is setup to run the imagebuilder to put a custom OpenWrt image together, basic linux knowledge / experience.

Anything you do to your nas is your own responsibility etc. I have no idea if OpenWrt is compatible with the filesystem used by Netgear so make sure you have a backup of all your data before you start. It took me a few tries to get OpenWrt installed so I'm writing things down from memory. This post is mainly intended as a starting point / reference for others and not a perfect list of commands to run through to get everything working.

Start with connecting the usb serial connector to the nas using the pins on the back of the NAS. Serial pins: [Gnd][Rx][Tx][5V]. Do not use 5V and remember to cross RX and TX to your USB serial adapter. Running picocom -b 9600 /dev/ttyUSB0 in your linux terminal should show you the output of the boot process of the nas.

My unit had some issues so I decided to go into the bios and reset all values to optimum defaults, if your NAS is working ok you can skip this step. Press the backup button while powering on the unit. At the same time keep hammering the delete key in your serial console to get to BIOS screen. Once you see the bios screen appear you can release the backup button. Move through the different menus and set values to optimum defaults. Save settings and exit bios. Power down the nas for now.

A summary of the steps to install OpenWrt are as follows:

  • 1 create a customised x86-64 image using the image builder and write it to an USB drive.
  • 2 boot the nas into openwrt on an USB drive.
  • 3 backup the internal storage and write the customised openwrt image to the internal storage.
  • 4 reboot and start configuring your new system.

Prepare your linux build system and download the x86-64 image builder files. Read the relevant web pages to get an idea how to put together your own customised images. The standard uart connection of the nas works at 9600 speed while OpenWrt uses 115200 by default. To avoid having to re-configure your serial connection half way through the install process you can choose to set the uart speed in OpenWrt to 9600 by adjusting the .config file in the image builder.

The space on the internal (USB) storage is around 120 MB so a standard x86-64 image is not going to fit. To make the image fit the rootfs partition size needs to be reduced to around 100 MB such that the kernel + rootfs is less than ~120 MB. Adjusting the rootfs size settings in the .config file to 96MB while leaving the kernel at 16MB worked fine for me.

The standard x64 image contains some network drivers by default but not the marvell drivers needed for this nas. So the kmod-sky2 package need to be included in the firmware to make sure there is a fully functioning network connection in OpenWrt. Some other useful packages are: nano kmod-hwmon-core kmod-hwmon-it87 kmod-thermal kmod-usb-core kmod-usb-ehci kmod-usb-ohci kmod-usb-uhci kmod-usb2 kmod-usb3 luci.

Build the firmware with the custom .config and additional packages and write the resulting ext4-combined.img file to an USB stick using dd. Plug the USB stick into the (front) USB port of the nas. Press the backup button while powering on the nas. Keep the backup button pressed until you see a grub screen with openwrt in your serial terminal. Once grub starts you can release the backup button. Allow the system to boot from the USB stick and once done use nano / vi in your serial console to adjust /etc/config/network such that the nas can connect to your network.

The nas now runs OpenWrt from RAM which is not persistent across reboots. To make the OpenWrt install permanent the firmware needs to be written to the internal storage. If you want to be able to go back to stock Netgear firmware in the future it is important to backup the internal storage first. Use cat /proc/partitions to find the ~120MB internal storage and then use dd to create a copy of the internal storage to the /tmp directory and then use scp to copy the backup to a different computer. Once that has been done the backup can be deleted from /tmp.

The squashfs-combined.img file can be copied to /tmp after which it can be written to the internal storage using dd. Once that is done the nas can be shut down, the USB drive removed and the nas powered on which should boot into OpenWrt from the internal storage. The nas has 2 ethernet ports so you may have the move the cable to the other port to get access to luci. The install process is complete and additional packages etc can be installed to setup the system.

Recovery: it is always possible to boot back into OpenWrt from an USB stick so there is a safe and easy method to fix any problems.

Back to stock: boot OpenWrt from an USB stick and then dd the backup image to the internal storage

Upgrading: this will always require a custom image with the additional packages and the reduced rootfs size. This can be easily generated with the imagebuilder as done for the install. Sysupgrade should work with the custom image but I've not tried this yet so don't know for sure.

The fan runs all the time in OpenWrt which makes it quite loud. The following command will reduce the fan speed to a more acceptable level:

echo 50 > /sys/devices/platform/it87.2576/hwmon/hwmon1/pwm1

0 = off, 255 = full speed. There are a few different fancontrol scripts on the forum which can help to adjust fan speed automatically which could be adjusted to work on this device.

Overall OpenWrt works fine but it is probably not as energy efficient as a more modern arm based nas. One thing which will help a bit is to install hdparm and set it to spin down the drives when they are not being used.

3 Likes