Tiny Core Linux on a USB stick

The Linux live CD or USB stick is not hot news. But, having the full installation running from a USB flash drive that acts like a hard drive is the difference. All you need is any PC with the boot from USB capability and 128+ Megabytes of RAM.

Are you interested?

Tiny Core Linux (TCL) is designed to be an extremely small and nomadic distribution. My full installation with a large repository occupies about 1.2GB on a flash drive and I can flexibly use that USB as a home/office workstation (using Libre office, any of a few Internet browsers, mail clients, GIMP, etc.), a PC repair kit with the different system tools like GParted or Wireshark, or as a full LAMP server.

 

Choosing the installation package

As you can see on the download page, Tiny Core Linux is distributed in three versions:

  • Microcore (the CLI version and Ethernet support)
  • Tiny Core (the GUI version and Ethernet support)
  • Tiny Core Plus (a few GUI versions, Ethernet and WiFi support, and a few more tools)

In most cases, I will need to perform PC diagnostics. That means that I will need to check motherboards, wired or wireless cards, sound cards or hard drives on a PC with problems. Additionally, I want to use this flash to test different network services, like a DHCP, DNS or Web server.

As you can see, I had a need to build one installation that will cover the wide scale of different scenarios. Therefore, I chose Tiny Core Plus version for my starting point.

 

How to install TCL on a USB stick

There are two ways how you can do that:

  • use the Core2USB tool
  • perform full installation

If you choose the first method, you can make a USB installation from the installation CD. They will be almost identical. You can boot from it in the same way as with a CD.

The process is very simple. You will need an empty USB stick. Run the tool from Windows 7 or later, choose the ISO image you want to use and let the tool do the rest.

You can’t use Rufus for this task, as Tiny Core Linux has a specific directory structure on a CD and generated live USB drive. Anyway, if you’re more interested in this process, use the comment section below.

I will show you the full installation process. This process is very similar to the installation of the Microcore version, which I already described in this post. We will now work in GUI mode, but the process is the same.

You need to download the appropriate ISO image and to obtain one quality USB flash. In most cases, the 32-version will be fine. I found that the 32-bit version has a memory limit of 2 GB. If you need to use more RAM, than you should use the 64-bit version.

I made 3-4 USB installations in the past three years. Two USB flash drives suddenly died. Therefore, my strong advice is to use only high-quality flash drives. The difference in the price is small and you don’t want to risk to go on the site just to find that your USB drive is dead.

The size of the drive doesn’t matter. However, if you plan to use this flash drive as a storage space for your files, then you should use a larger drive.

Now I can show you…

 

How I installed CorePlus on a flash drive

As I mostly work in Windows, I performed a mighty trick. I created a new VirtualBox VM without a hard disk on my laptop.

I started my new VM and waited for the desktop to appear. How fast this will happen depends on the computer speed and the disk type. You may also want to check this post about the VM optimization.

When the VM was booted, I plugged the USB drive into the port on my laptop, waited for Windows to recognize it and redirected it to my VM. Yes, redirection works with all VMs, regardless of the operating system. However, don’t expect that you can use USB drive in DOS, as DOS doesn’t have a driver nor recognizes the USB bus.

VirtualBox_TCL install_05_01_2018_22_10_34

My first mistake in this process – I mounted the partition that I want to use for installation. You can’t reformat the partition in use. Therefore, unmount the partition on a USB disk before installation. The mount tool in the red square.

 

The installation tool

The tool in the red circle is the installation tool. I started it. It contains a few options. We rarely need to change the path to the core.gz file.

I chose USB-HDD as the destination type. We will use the whole disk, as this is a USB drive. All disks that we can use will appear in the list. As you can see, TCL recognized my USB flash drive as a removable device.

Please, check this post for an additional details.

VirtualBox_TCL install_05_01_2018_22_11_10

 

The choice of file system

The second step was choice of the file system type. You can choose between 4 types –VFAT (i.e. FAT16/32) or EXT2, EXT3 or EXT4 (the native Linux formats).

Whenever we’re using a removable memory based disk (like a USB flash, SD or CF cards), we should choose either EXT2 or VFAT. Please, check this post for a detailed explanation.

I will show you both options, but I opted for EXT2 for my drive.

VirtualBox_TCL install_05_01_2018_22_14_12

On the third screen, we may add additional startup parameters. I already discussed them here.

I would like to discuss here more information about the disk identifier or UUID. As you already can see on the previous screenshot, I used the following command in the terminal window

blkid /dev/sda1

This command will return the UUID number that uniquely identifies each disk in the system. Additionally, you can see the file system type.

I will show on the next screenshot the same command for the EXT2 formatted disk.

VirtualBox_TCL install_05_01_2018_22_51_11

Why you should use UUID instead of the drive name? TCL will allow you to specify tce=sda1 as an additional parameter. That’s fine as long as your USB drive is the first and/or only drive in a system.

On any other computer, TCL will assign sda to the first hard disk in a system. That means that sda1 will be assigned to the first partition on that disk. Consequently, your USB will be identified probably as sdb and the first (and only) partition on it will be marked as sdb1.

Immediately, all references in the boot file will be wrong and TCL will not find any directory on the disk sda1. Your TCE (local repository), OPT or HOME directories are now on sdb1.

In the other hand, if you use UUID as the disk destination, it will be preserved through all systems, regardless of local disk configuration.

 

Additional options

The next screen will give us the opportunity to choose between the GUI or CLI only versions and the additional tools that we may want to install.

VirtualBox_TCL install_05_01_2018_22_22_31

I chose the GUI version and wireless support. I didn’t need any other options, as I can always download them later. With all this, I’m ready for the installation overview and…

 

The deployment

You will get the screen similar to this one

VirtualBox_TCL install_05_01_2018_22_22_45

We just need to click on the button named [ Proceed ]; similarly to the CLI procedure.

I want to draw here your attention to one detail. I told you that you should unmont the partition before installation. As you can see on the screenshot, I didn’t do that and I got an installation error.

VirtualBox_TCL install_05_01_2018_22_23_02

When I re-run the installation, I didn’t mount the partition and everything passed fine.

VirtualBox_TCL install_05_01_2018_22_25_57

 

If you want to specify UUID later

Even if you didn’t specify UUID earlier, you can do that after the installation.

Finish the installation and close the installation tool.

Then, open the terminal window and find the UUID with the blkid command. That partition must be mounted.

On my system (in this VM), the USB disk was the only drive. It was recognized as the sda device or /dev/sda. The first partition must be sda1. Therefore, my command was

blkid /dev/sda1

Select using the mouse the whole string starting with UUID= until the second quotation mark (“).

When you release the left button, selected text is copied to clipboard. You will paste selection using either the middle mouse button (or press the wheel). Only a newer GUI applications may use CTRL+V like in Windows.

VirtualBox_TCL install_05_01_2018_22_52_25

Now, use your favorite text editor (like vi, nano or beaver2 to name a few) to edit the file extlinux.conf. This file is located on the path /mnt/sda1/boot/extlinux.

In case that you chose the VFAT file system, this file will be named syslinux.cfg.

 

The first test

The last step was the live test. I left the USB drive attached to my laptop and restarted it. Depending on the BIOS settings, your computer may be immediately booted from a USB device. In my case, I needed to choose a USB device as my boot device.

screenshot_0105230019

When Linux booted, I connected it to my WiFi network and began to download additional applications (named extensions in TCL). I collected all extension that I may need in my work.

I tested this USB drive on a few computers and it worked without any problem. I opened new possibilities to use Linux for everyday work without the need to install it.

My plan is to add the sound support to it. It’s not a mandatory for many applications, but I want to build a workstation or even a multimedia center. This is my next project with this disk and another story to tell.

Don’t forget, if you have any question about this subject or liked this post – leave a comment, like it or share it.

Stay tuned.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.