One Small Step

Jody Whitlock

DEEI got my hands on a sweet Dell Optiplex FX160, and if you don’t know what this guy is it’s a Thin Client. Unlike most Thin Clients it has a small 1GB Solid State SATA drive on a cute little daughter board.  This guy also rocks a 1.6GHz Atom CPU and 1GB of RAM.

Now you may think “Oh my god, what is wrong with this guy!” Well, remember I like to use stuff like BeagleBone Black and oDroid devices as micro-servers. The major difference is I am not going to be doing a ARM install but an x86 instruction set running X64.

So, here’s where we start. I like the 14.04.3 LTS distribution myself, and because of the space constraints I will be using Ubuntu Core, which is very small indeed. Now before going any further, be prepared to do some work getting everything booting!

Now I’m not going to be extremely verbose, but here is the commands I run to get the filesystem on my lil bitty 1GB drive. Also, let’s assume I have downloaded the tar file into the Downloads directory of /home/ubuntu of my Live USB.

cd ~/Downloads
wget http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release/ubuntu-core-14.04.3-core-amd64.tar.gz
gunzip ubuntu-core-14.04.3-core-amd64.tar.gz
sudo mkfs.ext4 -T small /dev/sda1
sudo mount /dev/sda1 /media/hdd/
sudo cd /media/hdd
sudo tar -xf ~/Downloads/ubuntu-core-14.04.3-core-amd64.tar
sudo mount --rbind /proc /media/hdd/proc
sudo mount --rbind /dev /media/hdd/dev
sudo mount --rbind /dev/pts /media/hdd/dev/pts
sudo mount --rbind /sys /media/hdd/sys
sudo cp /etc/resolv.conf /media/hdd/etc/
sudo chroot /media/hdd/
cp /proc/mounts /etc/mtab

Wow, that was a lot of typing, but it’s worth it. At this point you have the base filesystem on the little hard drive and you are chroot’ed into it. Now, let’s make this guy bootable and get things going.

So one thing I’ve noticed is the locale is goofed, so here’s what I do to fix this:
locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales

Now, it’s time to get some stuff setup. The first things I do is snag some tools and setup the home directory, but before that head over to this link to get the configuration for your apt sources.list file with all the goodness you want in there.

So first let’s setup the apt to not cache and use precious disk space. Do this by adding the following text to /etc/apt/apt.conf.d/02nocache
Dir::Cache {
srcpkgcache "";
pkgcache "";
}

And for the sources, I like to go to this link to generate the contents of /etc/apt/sources.list.

Now configure fstab like so BEFORE installing the kernel and GRuB.

blkid | grep /dev/sda1

Now copy the UUID into the fstab and configure the entry to look like this:

UUID="40e11841-b4cd-4df7-a4a5-45e9d97b5911" / ext4 defaults 1 1

Ok, now the nitty gritty, let’s get some stuff installed including our kernel.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3E5C1192
apt-get update
apt-get clean all
apt-get autoclean all
apt-get install localepurge deborphan bash-completion nano linux-{headers,image}-generic sudo openssh-server htop

Now you notice I add localepurge, this is a nifty little tool that get’s rid of any locale files that you don’t need, saving even more space.

Also, I personally like nano better than vi since that’s what I’ve used for a very long time, but I always say, use what you’re used to.

Now you should have a basic bootable system, I like to set the IP address and hostname prior to rebooting, but you don’t have to do that.

One thing to do is add your user, set the password, and add that user to the sudoers group so that you can do something.

Ok, so let’s reboot onto the drive and see what we have.

/dev/sda1 930M 687M 191M 79% /

Dell-Optiplex-FX160-Mini-USFF-Thin-Client-PC-16Ghz-Atom-2GB-RAM-80GB-HDD-281545292885-4Holy cow, we did it with room to spare!!!  Now you might be thinking “191MB ain’t enough to do anything with!” Well, one thing about the FX160 is you can get a HDD expansion kit to add a SATA drive in the enclosure.414spVsvXoL._SX300_ Plus there’s an absolute ton of USB ports on this guy to add external enclosures for more storage.

Also, this would make a very powerful IPTables based router, DNS and DHCP server for your home, even run RRDTool to get data from all those little IoT gadgets you got laying around in your mind. Don’t forget this also has a half size Mini PCI-E slot for built in WiFi including an antenna. Just let your imagination run wild without breaking the bank.