Freelink upgrade to lenny with SATA-USB adapter

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 07:04, 8 January 2009 by JonSenior (Talk | contribs)

Jump to: navigation, search


Kurobrick.png
WARNING!

There is a possibility that you could brick your NAS with these instructions. Please make sure that you read the entire page carefully.



Usual warnings and caveats apply. This is my experience using a Linkstation Live v2. Normally, from what I've read, this should work for the Linkstation Pro, or indeed any device where you can gain access using a SATA<->USB cable and where the boot and rootfs partitions are accessible. But as always, "you brick it... you bought it."

Contents

Preamble

SATA<->USB

The goal was to make the Linkstation work with a USB sound card, and thus to act as a media player, not a media server. With this in mind and using Add_a_USB_sound_card as a proof of concept, I installed Freelink following the instructions on FreeLink_for_the_LinkStation_PRO/LIVE. The first problem was Alsa which didn't play well on the 2.6.12 kernel that came with Freelink. After a lot of searching I found that there was a problem with the Alsa tools when running an kernel with OABI userspace tools. This is well-documented on-line. My first attempts to upgrade the kernel to a vanilla 2.6.28 were disastrous and resulted in the box going into a reboot every 30 seconds, before even allowing a connection. Since it wasn't attempting to contact a TFTP server, I couldn't get it to go into [EM_Mode] and I didn't own a serial cable, I was left with no option but to access the drive directly. So I browsed around and found a SATA<->USB adapter that I could use to access the HDD without complete disassembly. The version to the right requires that the either the HDD be removed, or the device be hacked apart.

Requirements

  • The kernel source, available from [1]. You want the most recent version where possible. Check the list in Buffalo_ARM9_Kernel_Port to see at which point support was added for your box.
  • A Debian Lenny rootfs. I used [2].
  • The SATA<->USB cable shown above, or something similar.
  • A Linkstation Live (Or possible other model) running Freelink (Presumably this would work straight out of the box, but I didn't do it that way, so I'm not going to say that it'll work).

Modifying and connecting the adapter

The second time I connected the adapter, I decided to take it apart. The case comes apart fairly easily and you'll need to pull off the plastic cover from the switch and then use a pair of wire cutters to cut the switch shorter. With that done, the HDD can be connected by removing the front of the case and the daughterboard. If you have nimble fingers you don't even need to remove the side panel. See Disassemble_the_LS_Pro_v2_/_LS_Live_v2 for further instructions. Since the switch will be near inaccessible, you will need to connect the adapter to the HDD, then plug it into the USB port and connect the molex connecter which provides power.

Installation

  • Follow the instructions in Buffalo_ARM9_Kernel_Port to create a kernel and modules for your Linkstation.
  • Connect the drive and mount the partitions. They should appear as /dev/sdXY. Assuming a default partitioning and /dev/sdb as the root you should see
    • sdb1 = The boot partition
    • sdb2 = The root filesystem
    • sdb4 = The extended partition containing the rest
    • sdb5 = A swap partition
    • sdb6 = The media partition (You do want to store stuff on this, right?)
  • In a default setup sdb2 and sdb6 will be in XFS format. As of 08 Jan 2009 there are ongoing issues with XFS on Arm. I had an error on my rootfs after only two boots. It is worth switching to another filesystem. I used ext3 as I'm familiar with it, but there appears to be a strong consensus on using JFS for the media partition.
  • Back up the old root system. You will want to be able to revert if anything goes wrong. From within the mounted system use

tar cjf /path/to/backup.tar.bz2 *

  • Reformat to a new filesystem if you wish to do so.
  • Decompress the Lenny image using the following from within the mounted system:

tar xf /path/to/lennyimage.tar.gz

You now need to make a few modifications to the rootfs

  • Set up networking. I modified /etc/hostname and /etc/hosts to reflect what I wanted the box to be called.
  • Make /var/man writeable by user "man", otherwise you'll get errors whenever man pages are installed. I don't believe that the following command represents a security risk, but you are modifying access permissions. The worst is that someone will edit your man pages! ;-)

chown -R man:root /var/man

  • Edit /etc/apt/sources.list to use your local mirror if you want.
  • Put it all back together. Probably best to just connect the daughterboard while you test it. That way, if something doesn't work you can easily take it apart again.
  • Power up the unit and hold your breath. When it's finished booting, you can connect using ssh root@i.p.of.box with the password "lspro". Don't forget to change the password!
  • Run aptitude update to get the package lists and get installing.

Success stories

If anyone else makes this work, it'd be good to hear about it here.

  • JonSenior - Running vanilla kernel 2.6.28 on a Freelink installed Linkstation Live v2.