Homeserver Upgrade: Odroid XU3-Lite Setup on a SD-Card

I recently bought a new home server, the Odroid XU3-Lite to replace my poor man’s home server I called the thin-server, to run CherryMusic and the like.

20150116_120429_small

That little ARM machine is a beast in the size of a cigarette pack, featuring a total of eight CPU cores, an ethernet port and most importantly an USB 3.0 port to connect an external hard drive. It also comes with a plastic case, with a small fan inside and a PSU that is strong enough to power external hard drives connected to the USB ports. I ordered the smaller “Lite” version, which has a slightly lower CPU clock rate, but costs a lot less than its bigger brother.

In this post I’ll guide you quickly through the installation process of the ubuntu image on a micro SD-Card, how to make use of all the space on the microSD card and how to secure this little fellow a little after the installation of the image.

Installing the Operating System Image

Download the latest Linux image from their site and unpack it using xz:

The actual image file will of course be called something like ubuntu-14.04.1lts-lubuntu-odroid-xu3-20150212.img.xz and not IMAGE_FILE.img.xz.

Then plug in the SD Card into you linux computer and check out were it was mounted using dmesg.

You will see something like sdb or sdc in the output, make sure that you got the letter right; I will use sdX as a placeholder. As you can see I bought a 32 GB SD Card so I would never have to worry what I install on the machine, because there will be more than enough room for it. Also make sure you’re buying a quality SD-Card with fast write rates for better performance.

Now you can copy the image onto the SD-Card.

Warning: All the data on the SD-Card will be lost forever in this process so make sure this SD-Card does not contain any bitcoins or wedding photos you might miss later!

Depending on your SD-Card this process may take some minutes and dd will not give you any indication of the progress so be patient.

Before you can actually boot from the microSD card, make sure the correct boot mode is set. The ODROID XU3-Lite can either boot from a microSD card or from a eMMC module. There is a tiny switch on the board, to set the the boot mode as explained in the ODROID wiki, which I found a bit confusing to be honest. Set the switch as shown in the picture below.

Diagram1

Now you can insert the microSD card and plug it is and it should boot up in about 20 seconds, and automatically connect to your network using DHCP.

Now you can login your new system using SSH from your linux computer (in my case it had the IP 192.168.1.87, but you might need to login to your router to find out what IP the ODROID received):

As always with new SSH connections:

Enter “yes” to proceed. The default password is odroid

First, let’s check how much space I have left on the SD card.

Only some hundred megabytes? Well, thats because the image I flashed onto the SD card also contains the partition layout and the contained file systems, which is as small as possible, so people can use this image also on smaller SD cards. So let’s change that.

First off, partitions are not the same as file systems! So we need to resize the partitions to match the SD card first, and then resize the filesystem to match the partitions.

Resize the partitions

Since the image was about 6 GB in size, but I bought a 32 GB micro SD card there is a lot of space to be gained. Doing this on a live system is far from a good idea, but since this is the stock system, I don’t care; There’s no data to be lost. Never do this on a system with data you (or somebody else) care about.

So we’ve got 2 partitions here. The first one (/dev/mmcblk0p1) contains the bootloader and the second one contains our ubuntu linux system. By the way: If you ever wondered, mmcblk0p1 stands for Multi Media Card Block Device 0 Part 1. Makes it a bit easier to remember. Let’s write down the total size of the SD card in cylinders somewhere.

So let’s fire up parted to and first check the partition numbers using print.

Then we set the unit used by parted to cyl, so when we resize, we can enter the number of total cylinders of the card we wrote down earlier when using fdisk.

Now we can resize the partition 2 (which contains the ext4 filesystem) to use all the available space:

Alright, so now the partition ends at the end of the SD card.

Resize the file system

Now we can resize the filesystem to the size of the enlarged partition using resize2fs:

So let’s check the space again:

Bam. Now with so much space available, lets fill it with pictures of squirrels. Sometimes I’m overwhelmed by the sheer awesomeness of linux.

Create local user and Disable root user login:

As seen before, your home server can be easily accessed using the default root login, which is not so nice. So lets add another user to login with and also make sure nobody can ssh into the server using the root user.

First add a new user and put that user into the sudo group, so this user can issue all kinds of system commands.

Now, before we block ssh access for the root user, make sure you can login to the server and execute sudo using the newly created user, or you have locked yourself out of the system!

Now edit /etc/ssh/sshd_config to disable the root login, using any command line text editor (I’m using nano in this case):

And now set  PermitRootLogin to No:

Once you have saved the file, you can restart the ssh server to make the changes take effect.

That’s it, happy hacking!

 

 

 

 

4 thoughts on “Homeserver Upgrade: Odroid XU3-Lite Setup on a SD-Card

  1. Hi, very interesting blog.
    I was reading your article about the Cheap Home Server and I have been inspire by it.
    I too have a T5710 and I replaced the flash drive with an 80GB laptop IDE drive, double the memory and it has been happily working with XP. Now that XP is no more I was thinking to move to Linux.
    What was the version of Arch Linux you had working on it?

    The appeal of using the T5710 is that it has a PCI slot and combined with my trusty Haupage 3000 combo tuner, I was hoping to make it into a live TV/PVR backend for KODI (Raspberry Pi front-ends)

    • Hi Dom,

      When I still had the thin-client as home server I used the normal arch linux installation. All I had to do was to set the correct CPU-architecture in the package manager configuration, if i remember correctly. But for some reason the server started crashing every other week, so I was fet up with it. Maybe the RAM was faulty or something, i don’t know.

      In any case, there is quite good support for all kinds of TV-cards, so you should definitively give linux a spin!

    • Yes, it *might* be a good idea to split home, tmp, var, root, depending on the use case; I however just wanted explain the quick way to get stuff to run; Everything else is left as an exercise to the reader!

      BTW: The box runs nicely since I initially wrote the blog post!

Leave a Reply

Your email address will not be published. Required fields are marked *