WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System  (Read 14077 times)

Offline reidi

  • Newbie
  • *
  • Posts: 13
[sysadm - this is from a more nicely formatted odt document if you would like a copy.  I realize there is a USB_Install tool - as far as I can tell it doesn't allow an ext2 install.]

7. USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System

This is modified from original material written by dmoerner et.al.
Author: Ian Reid, 20100117

Here is how to create a pen drive with an ext2 filesystem, that boots into Tiny Core Linux 2.7.  The installation allows persistent personal file storage, as well as both automatic and on-demand extension loading.

The procedure is fast, and uses both the command-line and easily installable Tinycore extensions.  The most time-consuming part is typing in all the long pathnames.

Caution: you MUST be able to ascertain the correct mount point for your USB pen drive partition.  Writing the bootloader to the wrong partition can render your host computer unbootable.  Incorrect partitioning can erase all data on the host machine.
The USB device mount point in this example is /dev/sda1, yours could well differ.

You need:
  • A Tinycore boot CD.
    A host computer with CD, USB and ability to boot from either device.   This example was performed on an old Fujitsu notebook with 512MB RAM.
    A wired internet connection.
    A USB pen drive –  I recommend 128MB or larger.

7.1. Preparation
Boot from CD.
insert USB pen drive
Download iso:
$ cd /tmp
$wget ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/tinycore_2.7.iso
Here is another address if you need to get the iso some other way: ftp.nluug.nl/pub/os/Linux/distr/tinycorelinux/2.x/release/tinycore_2.7.iso

Using Appbrowser, install:

  • beaver2.tcz
    gparted.tcz
    syslinux.tcz

7.2. Partition the thumb drive
Start gparted from the tinycore menu.
Use extreme caution, close gparted without writing changes if you are not sure what you are doing.
Make sure you are viewing the USB pen drive.  You can usually tell by the drive and partition sizes displayed adjacent to the device name in the partition selector in the upper right-hand corner. 
Note the device name for future reference, e.g. /dev/sda1
If the device auto-mounted, you will have to unmount it before proceeding. See Partition menu in gparted.
Remove all partitions on the pen drive.
Create a new primary ext2 partition:
  • Make size at least 128 MB .
    Set the Label as “tinycore”  (no quotes).
Apply the changes.
After creation, go to “Manage boot flags” and tick the Boot flag.

Close gparted.

Mount the new partition.  Panel/Mount Tool is an easy way to this.   If /dev/sda1 is not visible immediately after the partitioning, then remove the pen drive, wait 10 seconds, replace and wait a few seconds.

7.3. Mount the Pen Drive and Copy Over the Tinycore files
Mount the downloaded Tinycore iso file:
  • $ sudo mkdir  /mnt/iso
    $ sudo mount /tmp/tinycore_2.7.iso  /mnt/iso -o loop

Copy the Tinycore files:
  • $ cd /mnt/iso
    $ sudo cp -R *  /mnt/sda1

7.4. Use Extlinux to Make the Pen Drive Bootable
$ sudo mkdir -p /mnt/sda1/boot/extlinux

Carefully double-check disk partition entry in next step:
$ sudo extlinux -i  /mnt/sda1/boot/extlinux

Copy and rename config from tinycore iso:
$ sudo cp /mnt/iso/boot/isolinux/isolinux.cfg  /mnt/sda1/boot/extlinux/extlinux.conf


7.5 Check Disk Volume Label and Add Boot Codes

Check partition label:
$ blkid -s LABEL /dev/sda1  - this should return, in part:  LABEL=”tinycore”
If partition label is wrong or missing:
$ sudo tune2fs -L tinycore  /dev/sda1
Check your results:
blkid -s LABEL /dev/sda1      - this should return, in part:  LABEL=”tinycore”

Edit /mnt/sda1/boot/extinux/extlinux.conf
Example:
$ cd /mnt/sda1/boot/extlinux
$ sudo beaver extlinux.conf
find the line that starts with “append”
Append this string to the end, do NOT add any carriage returns:
waitusb=5 tce=LABEL=tinycore home=LABEL=tinycore opt=LABEL=tinycore restore=LABEL=tinycore

Your final append statement will look something like:

append initrd=/boot/tinycore.gz quiet max_loop=255 waitusb=5 tce=LABEL=tinycore home=LABEL=tinycore opt=LABEL=tinycore restore=LABEL=tinycore

7.6 Reboot and Add Extensions

Use the Mount Tool to unmount sda1 (or whatever partition your pen drive is)
Reboot the computer, making sure to remove the CD, and that your BIOS is set to allow booting from a USB HDD device.

  • My base install size was ~35MB on pen drive.
    Use Appbrower to add desired extensions.
    Adding Firefox, getFlash10, pcmanfm, flit, OSS, wireless-tools, wireless-2.6.29-1-tinycore, wpa_supplicant, Broadcom firmware and all the dependencies increased the total install size on disk to about 74MB.
    RAM usage is about 220MB with Firefox/Flash and pcmanfm running.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
The usbinstall program can create either a FAT or EXT2 installation.

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Looks like I will be cutting the FAT leaving only native Linux file system in the usbinstall script.
10+ Years Contributing to Linux Open Source Projects.

Offline reidi

  • Newbie
  • *
  • Posts: 13
The usbinstall program can create either a FAT or EXT2 installation.

Guess I glossed over those usbinstall options a little too quickly...  Ah, well, I understand more about boot loaders now.


Offline reidi

  • Newbie
  • *
  • Posts: 13
Looks like I will be cutting the FAT leaving only native Linux file system in the usbinstall script.

I tested the usbinstall "Ext" option on machine A.   When I did an "Ext" install that way, the boot code string I added was prepended to what appears to be a default 'waitusb=5 tce=UUID="[long_hex_sting"'.

So the final boot code string after the usbinstall was something like:
waitusb=5 tce=LABEL=tinycore home=LABEL=tinycore opt=LABEL=tinycore restore=LABEL=tinycore waitusb=5 tce=UUID="[long-hex-string]"



Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Persistent home and or opt is not recommended on flash type drives, i.e., pendrives.
This is due to the limited number of write cycles. Of course you can choose to setup this way.

The install script completely sets up the pendrive with the recommended setup.
Both the tce directory and backup, as well as device independent UUID is deployed.

If you choose not to use our recommendations, you can always edit the
boot/extlinux/extlinux.conf
10+ Years Contributing to Linux Open Source Projects.