Optware on the PogoPlug

— updated 2012-05-27 —

As OddballHero points out in the comments, there is an easier way to do this than my lengthy instructions

  1. http://tech.groups.yahoo.com/group/nslu2-general/files/Plug%20Files/
  2. Register to join the nslu2 Yahoo group.  It’s quick and easy.
  3. Check out the plug.tar.gz file (read the comments provided for that file).  It’s an archive that has all the important files ready to go.  It can save you a lot of time and work.
  4. You should also take a gander at the profile file they provide
  5. Once you follow the instructions on the Yahoo group installing rsync is as simple as
    ipkg install rsync

— updated 2012-05-27 —

These instructions are meant to help you to setup a packaging system on your PogoPlug so that you can easily install popular software on your PogoPlug. I have only run these commands on the PogoPlug Pro (Model POGO-P21). I make no guarantees as to whether or not these instructions will work for you.

I bought my PogoPlug primarily for backing up files. I find that using rsync on your PogoPlug is significantly faster and more reliable than using the PogoPlug desktop software for copying data and so installing rsync is the focus of this post. I personally do not like how the PogoPlug company is run, and I think their software is awful for the most part, but I do admire the hardware. If you want to get even more in-depth into PogoPlug hacking, check out the instructions at Arch Linux Arm, but I think Optware and ipkg are enough for most people.

For this project you will need a USB flash drive that can host this software on the PogoPlug indefinitely. I was able to first accomplish this for myself thanks to the people at the NSLU2 project. My instructions are adapted from instructions I originally followed from their website. Their work in helping others use plug computers for more than their intended purpose makes this all possible.

ipkg is the name of the package manager. It was used and has been used by a
lot of projects. Optware is one of the projects that uses ipkg.

  1. Enable SSH for your PogoPlug. You can do this in the settings page when you log in to your my.pogoplug.com account
  2. SSH in to your PogoPlug. The username will be [root] and the password will be whatever you set in the Settings page at my.pogoplug.com.
  3. Connect the USB drive that you will be using to host our /opt directory.
  4. One way to see a list of the filesystems mounted on your PogoPlug is to use df (disk free)
    df

    You should see output like the following.

    Filesystem           1K-blocks      Used Available Use% Mounted on
    ubi0:rootfs             104404     14600     89804  14% /
    none                     62880        16     62864   0% /tmp
    /tmp/.cemnt/sda1     976758780  56935880 919822900   6% /tmp/.cemnt/mnt_sda1
    /tmp/.cemnt/sdb1        990744     20300    920116   2% /tmp/.cemnt/mnt_sdb1

  5. I can see from this output that my USB drive (1GB large) is being referred to as sdb1, while the drive hosting my pictures, music, etc. (1TB large) is referred to as sda1. We care about the USB drive that we’ll be using to install ipkg and Optware.
  6. In my.pogoplug.com, eject the USB drive for Optware. In my case, this drive is the smaller 1GB USB drive that I am dedicating to Optware. I named it “PNY OPT” while it was plugged into my computer, and that is the name I see in my.pogoplug.com.
  7. Format the USB drive for Linux (this erases all data on the drive)
    mke2fs /dev/sdb1

  8. Run this command to remount the root filesystem as read-write (it’s read only by default)
    mount -o remount,rw /

  9. Make a directory where we will mount our USB drive
    mkdir /opt

  10. Mount your drive at the /opt directory
    mount /dev/sdb1 /opt

  11. If you re-run our df command, you should now see that the USB drive is mounted on the /opt directory
    Filesystem           1K-blocks      Used Available Use% Mounted on
    ubi0:rootfs             104404     14600     89804  14% /
    none                     62880        16     62864   0% /tmp
    /tmp/.cemnt/sda1     976758780  56935880 919822900   6% /tmp/.cemnt/mnt_sda1
    /dev/sdb1               990744        20    940396   0% /opt

  12. Now that the USB drive is mounted and ready, we can start to install some software. First, let’s get a better version of wget than what comes bundled on the PogoPlug
  13. We’ll change to the temp directory when we download our software
    cd /tmp
    wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/wget_1.12-2_arm.ipk

  14. Untar (unzip) this package into /tmp.
    tar xzvf wget_1.12-2_arm.ipk

  15. Although three files are unzipped, we only care about one. data.tar.gz. This file contains the binary. Untar the data (binary) files for wget into our /opt directory
    tar xzvf data.tar.gz -C /

  16. Now that we have a newer version of wget, let’s replace the existing version on the PogoPlug. First, rename the stock version of wget as wget.old
    mv /usr/bin/wget /usr/bin/wget.old

  17. Then, create a link at /usr/bin/wget to the new wget binary we installed
    ln -s /opt/bin/wget /usr/bin/wget

  18. Now if you run wget, you’re running our newer version. Next, we’ll setup ipkg, the actual package manager that will make the rest of our installs much easier.
  19. Download the ipkg package to /tmp (you’re still in the /tmp directory, right?) using our newer version of wget
    wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ipkg-opt_0.99.163-10_arm.ipk

  20. Again, we’ll run our tar command, but this time on the ipkg file
    tar xzvf ipkg-opt_0.99.163-10_arm.ipk

  21. Let’s unzip the binary files for the ipkg software into our /opt directory
    tar xzvf data.tar.gz -C /

  22. Now we need to tell ipkg where to look for software when we ask it to do an install
    echo 'src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable' >> /opt/etc/ipkg.conf

  23. You should now be able to run a simple ipkg update command and see a success message. ipkg should state that it was able to see our mirror that we just added to the config
    /opt/bin/ipkg update
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/Packages
    Updated list of available packages in /opt/lib/ipkg/lists/cross
    Successfully terminated.

  24. This step is optional, but if you’re like me and don’t have a lot of experience with vi, you may want to install a more friendly text editor like nano
    /opt/bin/ipkg install nano

  25. You can update the PATH variable so that instead of having to type /opt/bin… in front of all your applications installed by optware, you can just type the application name
    /opt/bin/nano /etc/profile

  26. Now add /opt/bin and /opt/sbin to your PATH variable so that it looks like this.
    #!/bin/bash export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin

  27. Then close and save the file, and run
    source /etc/profile

    so that your profile is immediately updated with the new PATH variable.

  28. Re-mount the / filesystem as read-only so we don’t break something by accident
    mount -o remount,ro /

    Although / is now read-only, /opt is mounted on our USB drive which is not read-only, so you’ll still be able to write files to the /opt directory when running ipkg installs.

  29. You should finally be able to run
    ipkg install rsync

    to install rsync, and relax. Now using rsync is up to you. One tip if you have issues, is that you may need to specify –rsync-path in your rsync command when trying to remotely connect to your PogoPlug, and in this case the rsync-path would be /opt/bin/rsync.

  • Guest

    perfect…thx

  • OddballHero

    There is actually an easier installation file on http://tech.groups.yahoo.com/group/nslu2-general/files/Plug%20Files/ .  Just requires registration.  Already contains nano, ipkg, and wget.

    • Will Haley

       Thank you!  I had no idea that existed. It’s much easier.

      I’ve added an update to direct people to the Yahoo group.

  • Terry

    Would this work as a seedbox?