Tiny Core Linux

Tiny Core Base => TCB Tips & Tricks => Topic started by: reidi on January 17, 2010, 09:19:31 PM

Title: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: reidi on January 17, 2010, 09:19:31 PM
[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:

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:


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:
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:

Copy the Tinycore files:

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.

Title: Re: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: gerald_clark on January 17, 2010, 09:50:26 PM
The usbinstall program can create either a FAT or EXT2 installation.
Title: Re: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: roberts on January 18, 2010, 06:35:15 AM
Looks like I will be cutting the FAT leaving only native Linux file system in the usbinstall script.
Title: Re: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: reidi on January 18, 2010, 08:22:47 PM
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.

Title: Re: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: reidi on January 18, 2010, 08:36:10 PM
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]"


Title: Re: How-To: USB Pen Drive Installation of Tiny Core Linux on an Ext2 File System
Post by: roberts on January 19, 2010, 06:41:34 AM
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