User Tools

Site Tools


user:asowers:portfolio:project1

Project: Turn a consumer NAS device into a fully functional ARM based Linux system

An Epic Odyssey of UNIX&LINUX fundamentals (aka enlightenment), by Andrew J Sowers, circa fall 2011

Objectives

The Idea is to access the embedded ARM based computer withen our NAS device at the root level in order to install a modified version of Arch Linux to obtain multi-user server functionality.

Prerequisites

In order to successfully accomplish/perform this project without a severe headeach, the listed resources/experiences need to be consulted/achieved:

  • A mass storage device - Here you have some options. You can go with a USB storage device (Minimum of 2GB) or open the PogoPlug to access the SATA port (you will need external power for your SATA drive)
  • Some command line comfort
  • Google is your friend.

Background

With an ever growing demand to serve more information and the need to conserve engergy we are faced with a dilemma. If you deploy blade racks for unnecessary applictions such a serving a small office, you will waste money on what is essentialy an energy consuming heat fan; the very life-bane of mother nature. Another option would be delpoying a minimalistic ARM based machine that has ideal specifications for a simple file or web server application that doesn't disrupt the zen.

A group by the name of Cloud Engines at pogoplug.com have developed an “always on” consumer media server solution; the PogoPlug. Cloud Engines flag ship NAS device boasts the following specifications: Architecture - ARMv6l, CPU - PLX 7820 750MHz Dual-core, RAM 128MB, NAND 128MB, 4 USB2.0 ports, 1 (internal) SATA port, Gigabit Ethernet and B/G/N Wireless. Now I'm sure you'll agree that this is sufficient for any *Personal* server needs.

This project will serve as a guide to rooting, deploying and managing your PogoPlug device with the Arch Linux distribution.

Scope

The implementation of an ARM based environment would ensure optimal performance per dollar by minimizing cost on both hardware and energy consumption.

Attributes

  • An exposure to other CPU Architectures: Why CISC when you can RISC?!
  • Knowledge of building and administrating a Linux server (applicable to any architecture)
  • Perhaps some empathy toward mother nature, eh?

Procedure

Okay, lets begin.

1. make sure the PogoPlug is powered on and connected to the network.

2. Once you have confirmed this make your way to the nearest personal computer that is connected to the same network as our PogoPlug. In order to access our PogoPlug remotely to enter commands we will need ssh to it's assigned IP. To enable ssh on our pogoplug we'll head on over to my.pogoplug.com Once there, login and head over to the settings tap in the top right conner of your screen. Enable ssh

3. reboot your Pogoplug. When your PogoPlug Powers back on we're gonna ssh into it. To do this enter a terminal or PUTTY session and type: root@[your pogoplugs ip].

4. We need to kill our PogoPlug services, to do this type:

  • killall hbwd

5. The PogoPlug default OS is stored in the internal NAND flash which is only a measly 128MB. So what we're going to do is attach and format a new drive, you can either use a flash drive, external USB drive or if your feeling 1337 h4x0rz you can crack open the PogoPlug and use the internal SATA port (you will need external power for your SATA device). When you have settled on a drive of choice connect it and at your PogoPlug prompt type the following command:

  • /sbin/fdisk /dev/sda

6. At the fdisk prompt, delete old partitions and create a new one:

  1. Type o. This will clear out any partitions on the drive.
  2. Type p to list partitions. There should be no partitions left.
  3. Now type n, then p for primary, 1 for the first partition on the drive, and then press ENTER, accepting default values.
  4. Exit by typing w.

7. We're now going to create an ext3 file system (I have not yet tested ext4 on this step). Enter these commands:

  1. sync
  2. cd /tmp
  3. chmod 755 mke2fs
  4. ./mke2fs -j /dev/sda1

8. Download the install script and execute

  1. cd /tmp
  2. chmod 755 oxnas-install.sh
  3. ./oxnas-install.sh

9. The installer will ensure that the Pogoplug services are not running and that it has sda1 mounted where it wants it. Then, it will collect some information from the system, download the rootfs tarball, verify it, extract it, and finally use spare space in the NAND for the updated kernel before making modifications to the u-boot environment. If something goes wrong, it will be darn sure to tell you. In the end, this is what the last lines of blparam output should look like:

  • bootargs_stock=root=ubi0:rootfs ubi.mtd=2,512 rootfstype=ubifs console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes load_custom_nand=nboot 60500000 0 500000 load_custom_nand2=nboot 60500000 0 B00000 boot_custom=run load_custom_nand boot || run load_custom_nand2 boot bootargs=root=/dev/sda1 ubi.mtd=2,512 rootfstype=ext3 console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes rootdelay=15 bootcmd=run boot_custom
  • Note that there are no “ (double quote) characters here.

10. The install script will automatically unmount /dev/sda1. If it didn't-done-blowed-up, reboot:

  • /sbin/reboot

11. O.K. you did it, seriously thats it! Don't you feel like a more enlightened individual for doing this!? you can login and administrate your new Linux server with the following credentials:

  • User name: root
  • Password: root

Make sure to add new users and change passwords for obvious security purposes. The PogoPlug does not support an external display so you must always establish an ssh session if you wish to make changes.

Reflection

You now have the cutest multi-user enterprise class server $100 can buy! This system functions perfectly as a web or file server, it will produce *anything* you would expect a BASH environment to accomplish… However x86 executables *WILL NOT WORK*!

The reason for this lay in the nature of the architecture - Modern personal computers are dominated by the CISC style of microprocessor or “complex instruction set computing” the PogoPlug makes use of the RISC architecture or “Reduced instruction set computing”. The difference between CISC and RISC to the end user means nothing but to the developer there is completely different set of low level instruction involved.

The PogoPlug is a low power consumption device and therefore is environmentally safe!

References

This insightful project was brought to you by the following links: (and a little will power)

user/asowers/portfolio/project1.txt · Last modified: 2011/09/24 00:22 by asowers