I recently wrote a getting started guide for the Tinker Board as even though the newer models tend to be quite expensive the older models can often be found for a lot cheaper. In this guide we are going to do something more advanced and are going to actually move our root filesystem to a SSD!
I have the original variant (the Tinker Board 1 S) and that is what I will be using for this guide but this should work on all Tinker Boards (including models without the eMMC). The Tinker Board 2 will have faster performance as the USB ports are USB 3.0 vs. USB 2.0 on the original Tinker Board. If you don’t have the S model with the eMMC this method will require a sacrificial SD card to serve as the bootloader.
This is an old method that I first covered for the Raspberry Pi before it supported native USB booting. I’ve also covered it here for the Orange Pi Zero 2. The SD card/eMMC serves as the bootloader but our root filesystem will be on the SSD. This is a fantastic method for any board that doesn’t natively support booting the OS from a USB storage device.
The StarTech USB 3.1 to 2.5″ SATA adapter is one I have recommended for many years for use with all kinds of devices including the Raspberry Pi, Orange Pi and Tinker Board. It’s widely compatible and works with gaming consoles as well.
The Sabrent powered USB hub delivers a whopping 2.5A of dedicated power for your USB attached devices. It will easily power the most thirsty of setups such as NVMe enclosures.
Note: Make sure Amazon doesn’t try to take you to the non-powered version and that it’s the one with the AC adapter that plugs in to provide extra power
Preparing OS Image
I highly recommend using Armbian as the default images from ASUS are pretty outdated and using very old kernels.
We will start with a fully working installation on either your eMMC or your SD card. We will then clone this working installation to your SSD. Once we make a couple of configuration changes it will use eMMC/SD as the bootloader but your root filesystem will be on the SSD.
Install your chosen OS and then log into it using the Tinker Board and fully update it with:
sudo apt update && sudo apt full-upgrade
Reboot to apply updates and then you’re ready to proceed.
Now we are going to connect your SSD to the Tinker Board. First we are going to completely remove all partitions from the drive so it’s completely blank. If you only have one drive plugged into the Tinker Board (and nothing else) this should be /dev/sda.
sudo fdisk /dev/sda
Now remove all partitions from the device. If you press “p” it will print out the partitions. Here’s an example on mine:
root@linaro-alip:/dev# sudo fdisk /dev/sda Welcome to fdisk (util-linux 2.33.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors Disk model: CT250MX200SSD1 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xe8ce0794 Device Boot Start End Sectors Size Id Type /dev/sda1 8192 483491839 483483648 230.6G 83 Linux Command (m for help): d Selected partition 1 Partition 1 has been deleted. Command (m for help): w The partition table has been altered. Failed to remove partition 1 from system: Device or resource busy The kernel still uses the old partitions. The new table will be used at the next reboot. Syncing disks.
Even though I got the device was busy error after unplugging and replugging the SSD the partition table was clear.
Once the drive is all cleared off you’re ready for the next step.
Cloning Installation to SSD
We’re now ready to clone your installation to the SSD. Whether you are using the SD card or eMMC the root filesystem should currently be /dev/mmcblk0.
We can now copy your drive to the SSD with the following command:
cat /dev/mmcblk0 > /dev/sda
Wait for the operation to complete (there won’t be any output but you will have a cursor again and be able to type new commands).
If you are having any trouble with permissions try becoming “root” first with:
Now try running the command again and as the superuser you should not encounter any permission errors.
Change SD card’s UUID
Now unplug the SSD and plug it back in. We need to change our eMMC/SD card’s UUID so that it doesn’t try to boot from that partition. We can set it to a random one with the following command:
sudo tune2fs -O metadata_csum_seed -U random /dev/mmcblk0p1
We can verify that it has changed with blkid like this:
root@tinkerboard:/boot# sudo blkid /dev/mmcblk0p1: LABEL="armbi_root" UUID="5df8ce50-c757-4c6d-9d08-b1fe646ada7f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a48b971e-01" /dev/zram0: UUID="6f2bb524-e165-4610-a944-9af0ed295bdb" TYPE="swap" /dev/zram1: LABEL="log2ram" UUID="40c10aef-ce36-4dd2-89cf-43d49a77a104" BLOCK_SIZE="4096" TYPE="ext4" /dev/sda1: LABEL="armbi_root" UUID="d4f3fb44-5aa5-49f2-83c4-159fd7f2c2aa" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a48b971e-01"
Notice that /dev/sda1 and /dev/mmcblk0p1 no longer have matching UUIDs. This is exactly what we want.
Before we reboot run e2fsck on the drive like this:
sudo e2fsck -yf /dev/sda1
This will prevent you from having to run fsck on the CLI the first time you try to boot.
Reboot and Verify
Now reboot the Tinker Board with:
With any luck you should be booted using your SSD! We can verify this with the mount command like this:
root@tinkerboard:~# mount /dev/sda1 on / type ext4 (rw,noatime,errors=remount-ro,commit=600) /dev/sda1 on /var/log.hdd type ext4 (rw,noatime,errors=remount-ro,commit=600) /dev/zram1 on /var/log type ext4 (rw,relatime,discard)
Here we can see that our root partition (/) is indeed on /dev/sda and not /dev/mmcblk0. Success!
You can verify the performance of your SSD on Pi Benchmarks using the following command:
sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
I ran the benchmark with full knowledge that we were using USB 2.0 and were going to be limited in our score. If you have the Tinker Board 2 then you will likely score significantly higher than me:
Here are the results:
Category Test Result HDParm Disk Read 34.14 MB/s HDParm Cached Disk Read 34.33 MB/s DD Disk Write 32.2 MB/s FIO 4k random read 2658 IOPS (10633 KB/s) FIO 4k random write 2661 IOPS (10647 KB/s) IOZone 4k read 10661 KB/s IOZone 4k write 10659 KB/s IOZone 4k random read 10611 KB/s IOZone 4k random write 10663 KB/s Score: 2,406
To give some context here the maximum score you can achieve over USB 2.0 is something around 2500-2600 points. This is true on Raspberry Pi Model 3s and older which only have USB 2.0 ports. They also max out around the same score.
This is about twice as fast as even the most expensive/fast application class SD cards. That means it is absolutely worth it to use a SSD with the Tinker Board and even more so with the Tinker Board 2!
This will give your Tinker Board a pretty big I/O speed boost and access to much higher performance/capacity storage than the eMMC or SD cards will allow.
You can use either the eMMC or the SD card as the bootloader for this method and your rootfs will be stored on the SSD!
Don’t miss my Tinker Board Getting Started Guide if you haven’t already seen it
The Orange Pi Zero 2 is a great a relatively inexpensive SBC if you are looking for Raspberry Pi alternatives
If you are after screaming fast I/O speeds the ODROID M1 actually has a real M.2 NVMe slot!