I purchased an ODROID-U3 (Community Edition) from HardKernel a couple of days ago. It runs much faster than what I expected. Anyway, I’d love to share my experience related to this board. So, here we go. The first chapter: Resize partitions in the microSD card.
- A functional Linux* device (ODROID-U3 itself doesn’t count)
- A microSD card reader
*: Other UNIX-like OS may do the work as well, but I didn’t test it.
Let me write the procedures in advance.
- Back up the data from microSD card partitions.
fdiskto modify the disk partition table.
- Make new partitions
- Restore the data
Why don’t we just use
resize2fs? Because I need to enlarge the first partition whose format is vfat. So I have to move the second partition right, which means changing the second partition’s header. I don’t know how to manage that, so let us just go the old-fashioned way.
- Insert the microSD card into microSD card reader. Then insert the microSD card reader into Linux PC (I assume your Linux device is a PC).
- Mount partitions (both of them) of microSD card.
- Running commonds below in terminal.
sudo tar cpzf /tmp/boot.tar.gz /media/BOOT sudo tar cpzf /tmp/root.tar.gz /media/ROOT #Note: `/media/BOOT` and `/media/ROOT` are paths where you mount the first and second partition of microSD card respectively.
sudo blkidand remember the UUID of second partition which is the root (/) partition. In my case, it’s
- Once it finished. Unmount them and re-insert the microSD card reader.
Modify Disk Partition Table
sudo fdisk -lto find out the device, which should be
/dev/sdbin most cases.
sudo fdisk /dev/sdb. Change
p. Remeber the Start of /dev/sdb1. In my case, it’s
- Deleting all these partitions by
d. Just follow the hints.
nto create a new partition, then press
p(Primary Parition). Input the Start value as you remembered previously. In my case, it’s
4096as I said in Step 3. Then just follow the hints, i.e. if you want a 256MB BOOT partition, enter
pto print table. Remember the End of your newly created partition. i.e.
nto create another new partition, press
pto choose Primary Parition. And input the End +1 (i.e.
65536) when it asks you to input the Start sector. Then just press enter to use the entire spare disk.
wto write this new disk partition table to microSD.
- Re-insert the microSD card reader.
Make New Partitions
sudo mkfs.vfat -F 32 -n BOOT /dev/sdb1to format
/dev/sdb1as FAT32 partition.
sudo mkfs.ext4 -b 4096 -U 99aa990c-c3e6-4dc8-9da7-ddd34200da20 /dev/sdb2to format
/dev/sdb2as EXT4 partition. Parameter
-Uwould set this partition’s UUID. You should change
99aa990c-c3e6-4dc8-9da7-ddd34200da20to what you remembered previously in Step 4 of Back Up.
- (Optional) Check new partitions by
- Mount the partitions as we did in Back Up.
- Running commands below in terminal.
sudo tar zxvf /tmp/boot.tar.gz -C /media/BOOT sudo tar zxvf /tmp/root.tar.gz -C /media/ROOT
- Once it’s finished. Unmount partitions. You may need to wait awhile to let data be truly and completely written.
By specifying UUID of newly created ROOT partition in Make New Partitions, we avoid modifying
boot.scr. If you didn’t specify UUID as the orignal one, you may have to generate a new
boot.scr (remember changing the UUID in
boot.txt in advance), or the microSD card would become unbootable.