The ODROID XU4 and XU4Q can be a bit more tricky to boot from USB drives such as a SSD due to them not using the fantastic Petitboot bootloader like many of their newer boards have. It is still completely achievable though using an old trick and a sacrificial SD card.
The performance gains as well as access to much higher capacity drives can makes it more than worth it to set up SSD storage (as it is on nearly all single board computers).
Let’s get started!
The ODROID XU4Q is a passively cooled version of the popular XU4 model. It has an octocore (8 core) processor.
The XU4Q needs a pretty hefty power supply and tends to not boot if it’s not just right. This is a link to the official ODROID power supply.
The StarTech USB 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, ODROID and Tinker Board. It’s widely compatible and works with gaming consoles as well.
Preparing SD Card
First you should have a completely working installation on a SD card of the OS that you would like to use. If you have an already working installation you want to move to your SSD you can use this as well.
You should completely update first with:
sudo apt update && sudo apt full-upgrade
If you are using a different package manager then update the image however you need to for your distribution.
Now we are going to connect your SSD to the XU4. Make sure you plug your drive into one of the blue USB 3.0 ports and not the white USB 2.0 port!
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 XU4 (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:
odroid@odroid:~$ sudo fdisk /dev/sda [sudo] password for odroid: Welcome to fdisk (util-linux 2.37.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. This disk is currently in use - repartitioning is probably a bad idea. It's recommended to umount all file systems, and swapoff all swap partitions on this disk. Command (m for help): p Disk /dev/sda: 232.89 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: 0xa48b971e Device Boot Start End Sectors Size Id Type /dev/sda1 8192 30441472 30433281 14.5G 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. If you don’t have the eMMC attached your current root filesystem should be /dev/mmcblk1p2.
We can now copy your drive to the SSD with the following command:
cat /dev/mmcblk1 > /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). It may take several minutes or longer. You are copying an entire drive from one to another basically with that one command.
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 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 -U random /dev/mmcblk1p2
We can verify that it has changed with blkid like this:
odroid@odroid:~$ sudo blkid /dev/mmcblk1p2: LABEL="rootfs" UUID="31077d7d-1be2-4d93-b833-c2ce6de7a8ce" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3cedfd53-02" /dev/mmcblk1p1: SEC_TYPE="msdos" LABEL_FATBOOT="boot" LABEL="boot" UUID="52AA-6867" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="3cedfd53-01" /dev/sda2: LABEL="rootfs" UUID="e139ce78-9841-40fe-8823-96a304a09859" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3cedfd53-02" /dev/sda1: SEC_TYPE="msdos" LABEL_FATBOOT="boot" LABEL="boot" UUID="52AA-6867" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="3cedfd53-01"
Notice that /dev/sda2 and /dev/mmcblk1p2 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/sda2
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 XU4 with:
With any luck you should be booted using your SSD! We can verify this with the mount command like this:
odroid@odroid:~$ mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,size=947684k,nr_inodes=184562,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=203920k,mode=755) /dev/sda2 on / type ext4 (rw,noatime,errors=remount-ro,stripe=32753) /dev/sda1 on /media/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
Here we can see that our root partition (/) is indeed on /dev/sda2 and not /dev/mmcblk1p2. 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
SD Card Test
To show the improvement between having a SD card rootfs and having a SSD rootfs I did a before test here with the SD card:
Category Test Result HDParm Disk Read 72.04 MB/s HDParm Cached Disk Read 74.11 MB/s DD Disk Write 8.6 MB/s FIO 4k random read 2442 IOPS (9769 KB/s) FIO 4k random write 90 IOPS (362 KB/s) IOZone 4k read 7823 KB/s IOZone 4k write 1860 KB/s IOZone 4k random read 7591 KB/s IOZone 4k random write 1571 KB/s Score: 752
Category Test Result HDParm Disk Read 286.44 MB/s HDParm Cached Disk Read 279.66 MB/s DD Disk Write 193 MB/s FIO 4k random read 18927 IOPS (75711 KB/s) FIO 4k random write 15170 IOPS (60681 KB/s) IOZone 4k read 22714 KB/s IOZone 4k write 27447 KB/s IOZone 4k random read 18418 KB/s IOZone 4k random write 28851 KB/s Score: 8,373
Wow, that’s quite a dramatic improvement. We went from 752 to 8,373. That’s more than a 10x! You can also look at the raw IOPS and MB/s numbers on HDParm and the various test categories if you are more familiar with those to see the improvement.
The XU4 and XU4Q actually benefit a lot more from this than a lot of the other boards that I have SSD boot guides for due to them having the USB 3.0 ports. We get a very nice performance increase and access to much higher capacity storage devices. You can get roughly 10 times the performance with even a 2.5″ SATA SSD like I am using here.
There isn’t a lot of benefit to using NVMe over USB 3.0. The USB 3.0 bus will limit your speed to around the score I got even with a 2.5″ SATA. It needs a faster bus or a real NVMe port to go much faster than that so don’t use any drives that are too expensive for this.
This does require sacrificing a SD card to serve as the bootloader so make sure you use one of your slow and low capacity SD cards for this as it won’t be doing much other than switching the root filesystem over to the SSD during boot time.
I definitely recommend any XU4 owners give this a try as it’s extra worth it due to the USB 3.0 on the board!
Make sure to check out my original ODROID XU4Q review which includes eMMC tests and benchmarking
My ODROID eMMC guide is available here which covers which compatible modules are compatible with each ODROID
Also see my Libre Computers “Le Potato” Review for an available $~45 SBC