Setup Asus Tinkerboard to boot from a USB memory stick

I did try to install to a hard drive, but the extlinux bootloader doesn’t give the HDD enough time to spin up and linux just goes into a kernel panic.

Very much like the Raspberry Pi SSD tutorial, this is nearly the same, but this time I’ll use a USB memory stick instead of a SSD.

Same as before, run fdisk first.
sudo fdisk -l

remember the disk you need, probably /dev/sda1 or in my case /dev/sdb1

Now copy the contents of the microSD root partition to the memory stick.
sudo dd if=/dev/mmcblk0p2 of=/dev/sdb1 bs=512

Now fix the broken file structure on the MS as before:

sudo e2fsck -f /dev/sdb1

Resize the HDD back to full size:

sudo resize2fs /dev/sdb1

 

This time you need to edit a different file instead of cmdline.txt

sudo nano /boot/extlinux/extlinux.conf

change /dev/mmcblk0p2 to /dev/sdb1

Now edit fstab

sudo nano /etc/fstab again change /mmcblk0p2 to /sdb1

reboot and you’re done

One thing I have noticed about the Tinkerboard is that it’s incredibly slow to copy from the microSD to the MS or SSD, I get roughly 3mb per second, where the Pi gives around 12mb per second, a huge difference, when you consider the Raspberry Pi only has USB 2 and the SD card, network and USB are all controlled through one port and the Tinkerboard supports separate controllers and has USB 3.0, this leaves me scratching my head why it should be so slow.

 

7605248+0 records in
7605248+0 records out
3893886976 bytes (3.9 GB) copied, 1308.77 s, 3.0 MB/s
dazbobaby@linaro-alip:/boot/EVENT$

As you can see, it’s very very slow????

Run a Raspberry Pi on a SSD or a USB Drive of any kind.

Well… technically it won’t boot from a hard drive, it has to be the boot partition on the SD card, but that’s actually just a small script setting up the root partition of the SD card.

The raspberry Pi is brilliant and every iteration has made it better and faster, all except one thing, the SD card. It still requires an SD card to boot up and run, but now you can run Linux from an SSD!

What I will show you is how to copy the contents of this root partition to an external drive, be it a USB memory stick, USB hard drive or like I have, an external USB Solid state drive.

This is actually a VERY VERY easy thing to do and aside from copying the contents from one drive to another, very quick too.

So the first thing to do is attach the USB drive to the Pi. For easy install I’ve already partitioned and formatted the drive to linux EXT4, all I need to do is discover where it is in the file system.

sudo fdisk -l

The result is /dev/sda1 – So now I know where the drive is, simples 🙂
If you have more than one drive attached it could be another letter, eg. sda1 is mine, sdb1, sdc2 and so on. Make sure you have the correct one.

Next you need to copy the files from the SD card to the external drive.

sudo dd if=/dev/mmcblk0p2 of=/dev/sda1 bs=512

 

Now this will take about 30 minutes to complete, but when it’s done there are a few things we need to do to finish the preparation of the drive
1. sudo e2fsck -f /dev/sda1
2. sudo resize2fs /dev/sda1

The first line checks the filesystem the second resizes the new drive and makes it use the full amount of space, the copy just copied the SDCARD sector by sector, so the new drive size will also match the SD CARD, resize2fs opens the drive up

Just two edits now stand between you and a faster pi.

First edit:

sudo nano /boot/cmdline.txt

change the part that says root=/dev/mmcblk0p2 to root=/dev/sda1

Next we need to make a directory to mount the USB Drive for easier access, you don’t technically need to do this but I did.

sudo mkdir /home/60GB

you can call the folder what ever you want, I had a spare 60GB SSD so I called it 60GB

The final edit and job is to edit the fstab so it’ll be correctly mounted at boot.

sudo nano /dev/sda1/etc/fstab

edit the line that says /dev/mmcblk0p2 to /dev/sda1

At this point you can safely reboot the Pi and welcome to a way faster Raspberry Pi.