ODROID XU4/XU4Q SSD Booting Guide

ODROID XU4 / XU4Q SSD Boot Guide
ODROID XU4 / XU4Q SSD Boot Guide

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!

Hardware Used

ODROID XU4
ODROID XU4

The ODROID XU4 is actively cooled by a powered fan. It has an octocore (8 core) processor.

Links: Amazon.com*, AliExpress.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.sg*

ODROID XU4Q Review / Benchmarks / Guide
ODROID XU4Q

The ODROID XU4Q is a passively cooled version of the popular XU4 model. It has an octocore (8 core) processor.

Links: Amazon.com*, AliExpress.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

ODROID Power Supply
ODROID Power Supply

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.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de,* Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*

StarTech 2.5" SATA Adapter
StarTech 2.5″ SATA Adapter

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.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

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.

Preparing SSD

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:

sudo su

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.

Run fsck

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:

sudo reboot

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!

Testing Performance

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                                         

SSD Test

     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                                        

You may view the full benchmark for the XU4Q on Pi Benchmarks here.

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.

Conclusion

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!

Other Resources

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

For an awesome retro gaming handheld console check out the ODROID Go Super

Also see my Libre Computers “Le Potato” Review for an available $~45 SBC

Subscribe
Notify of
guest

27 Comments
Inline Feedbacks
View all comments
William W
William W
8 months ago

Hi James, wonderful guide and it really a life saver.
Just one question about the OS, I have noticed that the instructions are for Linux OS, have you tried Android?I found that performance on booting Android from SD on XU4 is not acceptable at all so SSD from USB3 is the only hope.
Pls kindly share the instructions if you have done it with official Odriod Android OS.

Thanks
William

William
William
7 months ago

Hi James, thank you for your confirmation, I have observed the same. Since the price of EMMC has dropped significantly, may be I it’s time to get one for test.

Deali
Deali
1 year ago

This Guide worked for me. The system is now on an 64GB USB3-Stick and works fine.
I have several applications with high IO on it like influx, NodeRed, Grafana, Sqlite, Domoticz and so on which are mutch faster now.
Thanx a lot for this Guide

ersen
ersen
1 year ago

after all this we created new /dev/sda2 on ssd … now how can i access this folder .. couse i assume its not mounted .. sorry if i confused you with this but .. i dont know where is the new /media/boot folder to make a change in usb-storage.quirks=

ersen
ersen
1 year ago

oops … the question before was not that logical …but i know my terrible uas keep haressing my hdd .i gues i solved that issue either adding boot.ini file the q. or adding the file /etc/modprobe.d/disable-uas.conf with the same …now what…

ersen
ersen
1 year ago

yes .. its indeed .thank you for your time ..

Michele
Michele
1 year ago

Great James! Thanks. A huge boost! So, James, not clear for sudo tune2fs -U random /dev/mmcblk1p2. I succeeded with that command, but with the SD card unmounted. Anyway thanks a lot. great article. And great tool to obtain benchmark!

Jim
Jim
1 year ago

Hi great bench, Does the xu4 has sdr104 mem card controller?? Coz i see speeds over 70mb/sec

Jim
Jim
1 year ago

Strange for such an old sbc, i got 90mb/sec in my odroid C4 with a transcend 500s card,stupid raspberry foundation is it so difficult to upgrade their sdr50 to 104 in a later revision.

Jim
Jim
1 year ago

Maybe is the card i used it has MLC NAND flash
Its quite expensive thought
I remember the Toshiba exceria a few years ago with 90 read and 30 write when all other cards didn’t go over 20/10
Still have a couple
If the Raspi had sdr104 i wouldn’t talk about hdd boot now

Jim
Jim
1 year ago

Still have for 7 years my transcend rdf5 card reader quality hardware,there are 300mb/sec cards i think from kingston,but still the price is higher than ssd and slower not worth it
When the pi gets this speeds we will be 80 years old :p

Jim
Jim
1 year ago

Look at this guy the leader of scams,he broke any copyright law there is

amigapple

Jim
Jim
1 year ago

Windows 3.1 didn’t really had an activation i think it was just a key you put in the setup, he has account’s also in ebay and other sites as i see in the news page,a lot of raspberry “pirated” things name it and its there I don’t understand why someone can trust this people and buy from them anyway.

Jim
Jim
1 year ago

I start from win95 and now im on seven,i will put soon win10 in a amd-e450 netbook of course i will put the light version :p
Win 11 is too heavy for me plus i prefer 32bit
They have Better compartibility

Jim
Jim
1 year ago

I have tested before win10 lite on that 10 years old netbook,it goes pretty fast 700mb ram used on idle out of 3.5gb

From the many tests with hdds a 3.5″ drive at 5400 goes faster than a 2.5″ drive at 7200

Its a myth that drives with the same rpms go the same if one is 3.5″ and the other in 2.5″

Probably its the 12v versus the 5v more volts more power.