SATA on UDOO

My SSD and eSATA caddy have arrived. So now we plug it all in and off we go.

Some testing on my amd64 Ubuntu Linux Machine, for comparison with the uSD cards used for the UDOO currently.

The SanDisk Black uSD card behaves in the amd64 machine, just as it did in the UDOO previously.
SanDisk_BlackSD_4GB

Now we test the SanDisk Extreme ii SSD, connected via USB3.0.
SanDisk_Extreme2_USB3

Quite a difference.
If we can get close to this performance in the UDOO, then it will be worth the money spent.

UDOO and SSD Preparation

The guide available on elinux describes all of the steps required for booting the UDOO from the SATA drive.

First prepare a small uSD card to be the boot drive. Format it with one ext3 partition, and install the u-boot bootloader as usual.

sudo dd if=u-boot-q.imx of=/dev/<MICROSD_DEVICE> bs=512 seek=2

This is sufficient to get the UDOO to boot.

Now prepare the SSD, by formatting it in the same way you formatted the uSD previously. I’m now adding an additional linux-swap partition about 2GB in size. Although there are warnings about using SSD for swap, if you’re using a full desktop on your UDOO, your browser won’t respect the memory limitation and you’ll create worse problems.

Although the 8MB free space is not currently used in the SATA SSD, because u-boot is contained on the uSD. My guess is that at some time soon the UDOO team will get the u-boot loadable on the SATA drive, and then this space will be needed.

Once the SSD is prepared, then the fastest way to replicate your already created environment is to copy disk to disk.

cd /media
sudo cp -rp UDOO_SDroot/* UDOO_SSDroot
sudo cp -rp UDOO_SDhome/* UDOO_SSDhome
sync; sync

One final thing is to change the references in the /etc/fstab from

/dev/mmcblk0p1 to /dev/sda1 for /
/dev/mmcblk0p2 to /dev/sda2 for /home
/dev/mmcblk0p3 to /dev/sda3 for swap

Now, plug the SSD caddy into the UDOO, and put the uSD in its slot.

First boot

When first booting the UDOO, interrupt the auto boot process and enter the commands noted in the elinux instructions.
Open a serial terminal to your PC with a baud of 115200 8n1. Reset the UDOO and press any key over serial terminal when prompted to cancel the autoboot. If you miss the prompt, you can press reset on the UDOO.

setenv bootdev "sata init; sata dev 0; ext2load sata 0"
setenv root root=/dev/sda1
saveenv
boot

And the UDOO should boot as normal, but from the eSATA drive.

Note that there can be errors with eSATA / USB3.0 casings. I initially chose one which uses the Prolific PL2773, which implements the attachment as a USB Bulk-Only Mass Storage Class. Unfortunately this storage class doesn’t have the capability to pass TRIM commands.

But, although the attachment for the SSD doesn’t have TRIM capability, the SSD reports that it does have this capability, via eSATA, and this confuses the Kernel.

Errors are caused by the Kernel calling for TRIM on the swap space during the boot process.

How to fix this? Well the simplest way is to throw away the disk casing and connect the SSD drive directly. So, this is what I did. The disk performance also increases markedly too!

UDOO SSD speed testing

The UDOO SATA port doesn’t achieve quite the same throughput as the amd64 desktop does over USB3. But the speed increase over the uSD card is significant, and is very noticeable in use. Worth doing, in any case.
SanDisk_Extreme2_eSATA

After removing the SSD drive from the housing, and driving it directly, the performance increase can be seen. The average read rate has doubled to over 110MB/s and the access time has decreased by a third making it about the same speed as on the amd64 desktop.

In practice the desktop feels even smoother. Great result!
Screenshot from 2013-11-18 23:08:14

10 thoughts on “SATA on UDOO

  1. Pingback: UDOO Ubuntu 12.04 Guide | feilipu

  2. Thanks for your hard works. I am wondering that why did you uses the eSATA to connect the SSD but not using the SATA port on the UDOO Quad?

  3. Thanks for posting this, very insightful. I can’t understand though how do you power the SSD. If I’m not mistaken, SATA SSDs have two connectors, one for data ____| and one for power? Did the eSATA caddy takes care of the power?

    Thanks

    • When using the USB3 and eSATA to SATA caddy it provided the power via a USB3 plug.
      USB3 is rated for higher current capacity than USB2.
      But this caused the problems noted in my post.

      To power the hard drive “naked” I cut the ends off two cables, and joined them together.
      I cut an old dual USA A connector cable (cut off the micro USB) I got for powering PATA caddies,
      and a SATA power cable (cut off the molex) left over from my last computer build.
      The only connections necessary are the 5v wire (the red one) and the Ground wire (the black one).
      The 12v and 3v3 connections are not necessary for a SATA SSD to operate.

      If the SSD needs too much current, you might need to use a separate USB wall wart.
      A high current capacity one like for an iPad or Tablet (10W) will be best.

      The data cable is just a standard SATA cable from any computer build.
      I had some SATA cables around with clips which prevent the plugs falling out,
      but that’s just a nice to have.

  4. So does the UDOO (Quad) require a SATA 2 or 3? If 2, just what did you use as SATA 2 is getting more difficult to find (at least for me, not knowing just where to look). Thanks, Dave

    • Dave, use the cheapest SATA2 or SATA3 SSD you can find. Anything with the standard SATA connectors will work an order of magnitude faster than a micro-SD card.

      Don’t forget to use it “naked” and to make a power connector by cutting a USB cable and a SATA Power cable.
      Just join the Black (GND) wires and the Red (5V) wires. That’s all you need.

      Note that if your SSD needs too much current, you can’t use the UDOO USB and you might need to use a separate USB wall wart.
      A high current capacity one like for an iPad or Tablet (10W or 2.1A type) will be best.

  5. Thanks feilipu. I was concerned because I’ve only ever heard SATA2 for UDOO, wasn’t sure that a 3 could be used. Thanks again.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s