[Show/Hide Left Column]
[Show/Hide Right Column]

Location : Tiny Core Linux > Installing TC on USB

Installing TC on USB

Table of contents



1. General Notes


  • Download custom essays (external link) for installation tips and step-by-step procedure.
  • Obtain a TC .iso image - download the latest release (external link)
  • The target system can boot from USB devices (or can chainload to do so)
  • Popular bootloaders include: syslinux, extlinux, GRUB
  • Some parts of this page was based on USB forum thread (external link)
  • In the case of a microcore installation, inclusion of core elements makes it impossible to unmount the usb drive. In this case just add a file called core2ram.flg in tce directory.

  • Note:
    • Some USB storage devices can take a while before the system recognizes it
    • If errors are encountered during boot, it is likely that this is the cause of the problem
    • Try the boot option waitusb=10 by appending it to the kernel line in your bootloader configuration
    • See Boot Options for more info

  • Choose one of the guides below



2. usbinstall script: Installing within TC


This provides USB-HDD (ext2 or FAT) and USB-ZIP support.

As of TC 2.1, the usbinstall script is included in the base. MicroCore (MC) support can be found in 2.2rc2 or later.

The tool is found in the menu (Tools -> USB_Installation), or the control panel GUI as "USB Install"

If using MC, the usbinstall script must be executed with root privileges:
sudo usbinstall


The installer will ask you what kind of boot method you wish, and will give you dmesg output to help you discover where your USB stick is located.

Upgrade

There is an prompt to upgrade instead of Install. If anyone knows what this does, please edit.

Install from Running OS

If you choose to install from the running OS, and you are booted from the ISO, then you have no /boot directory, whose contents are required to complete installation. For this reason you must mount the cdrom.
mkdir /mnt/cdrom
mount /dev/hdc /mnt/cdrom

When prompted by the installer for path to bzImage and tinycore.gz, enter
/mnt/cdrom/boot/

Install from ISO

The installer must have access to the ISO file, NOT a mount of the ISO file. I am unsure where this is located in a running TC session being run from the CDROM.

3. Installing to USB with GRUB under a Linux distro

This part was originally written from dentonlt

What follows is a brief howto (about four steps) for installing to a USB stick from within Linux. You need:

  • The current TC iso
  • GRUB (if it's not on the stick already)
  • a working Linux installation
  • to know how to use a terminal & text editor
  • to know your USB stick device path (something like sda1, sdb2, etc.)


3.1. Mount the TC iso file locally


Use sudo if needed:
mount isofile isomountdirectory -o loop
where isofile is the current TC iso file, and isomountdirectory is the directory you'll mount it to.


3.2. Mount your USB stick and copy the contents of the iso file to your USB stick


Do something like:
mount /dev/sda1
cp -vR /isomountdirectory/*.* /usbmountpoint/
where isomountdirectory is from step 1, sda1 is your drive, and usbmountpoint is ... yep. Your usb mount point.


3.3. Install GRUB to your USB stick


(if it's not there already). See the details in the Installing GRUB section of Installing TC if you need a primer. BE CAREFUL - don't overwrite your hard drive bootloader. Enough said.


3.4. Edit your GRUB menu.lst file


(probably in usbstick/boot/grub) to include a standard TC item:
title tinycore
kernel /boot/bzImage
initrd /boot/tinycore.gz

All done - go at it.


3.5. Notes


Optionally, include your extension/app directory on the kernel line (read about extensions at the TC Core Concepts page (external link)). Specify the device as the information after /dev/. Something like:
kernel /boot/bzImage tce=device/tcedirectoryname




4. UNetbootin


If the target is a bootable pendrive, then one might try UNetbootin from another OS (Windows or Linux).

You can get UNetbootin from: http://unetbootin.sourceforge.net (external link)

  1. Format pendrive fat32 from the other OS
  2. Obtain the TC iso
  3. Run unetbootin

Just choose iso image and specify full path then specify the pendrive to use.

After successful installation you can edit syslinux.cfg file to add/change boot options.



5. Installing under Debian

This part was originally written from dmoerner
This is a shameless modification of the old DSL instructions (written by SaidinUnleashed, to give full credit).

A user reported that there is a problem with this guide, see -Note 1- in subsection 4

Please report findings on this page or via the forum thread: http://tinycorelinux.com/forum/index.php?topic=111.0 (external link)

This was performed from a Debian Sid x86 system.  The USB stick is /dev/sdc1.


5.1. Install necessary tools


On Debian this is syslinux, mtools, and dosfstools:
aptitude install syslinux mtools dosfstools


5.2. Partition the thumb drive


I used fdisk to partition the thumb drive into one large FAT32 partition.  The following directions are from memory but should be correct.
umount /dev/sdc1 # Never use fdisk on a mounted partition
fdisk /dev/sdc1
d
1
d
2
d
3
d  # These commands delete all partitions currently on the device
n
p
1 # This makes a new primary partition
a
1 # This makes it bootable
t
1
b # This makes it FAT 32
w

Now, I always overwrite the drive's mbr in case it was used for booting from grub sometime in the past.  This is not normally necessary.
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdc

Now, make a FAT 32 partition:
mkfs.vfat -F 32 /dev/sdc1


5.3. Copy over the files


You will need to mount the iso image using loopback and then copy over the files.
mkdir /mnt/iso
mount -o loop tinycore_1.0rc1.iso /mnt/iso
mkdir /mnt/usb
mount /dev/sdc1 /mnt/usb
cp /mnt/iso/* /mnt/usb


5.4. Set up syslinux


Since the ISO uses isolinux, we will need to make some changes
mv /mnt/iso/boot/isolinux /mnt/iso/boot/syslinux
mv /mnt/iso/boot/syslinux/isolinux.cfg /mnt/iso/boot/syslinux/syslinux.cfg
rm -f /mnt/iso/boot/syslinux/isolinux.bin # This didn't stop it from working for me, but I'm not sure if this file is necessary.
syslinux /dev/sdc1


-Note 1- the above should probably be
mv /mnt/usb/boot/isolinux /mnt/usb/boot/syslinux
mv /mnt/usb/boot/syslinux/isolinux.cfg /mnt/usb/boot/syslinux/syslinux.cfg
rm -f /mnt/usb/boot/syslinux/isolinux.bin # This didn't stop it from working for me, but I'm not sure if this file is necessary.
syslinux /dev/sdc1


5.5. Cross your fingers, unmount the flash drive, and reboot.


If you get an error like "image linux not found" when booting, you forgot to correctly rename the isolinux files to syslinux.


5.6. Appendix

5.6.1. APPENDIX A: Using Grub

You can also use grub to manage booting the pendrive, as described at grub-0.97-splash.tce.info (external link).  However, the process is a bit more involved than that.  After installing grub, you need to do the following:

mkdir -p /mnt/usb/boot/grub
rm -rf /mnt/usb/boot/isolinux
cp /usr/lib/grub/i386-pc/*stage* /mnt/usb/boot/grub
grub # now follow the instructions in the .info document
cat > /mnt/usb/boot/grub/menu.lst << EOF
default 0
timeout 5
title tinycorelinux
root (hdX,Y)
kernel /boot/bzImage quiet
initrd /boot/tinycore.gz
EOF


5.6.2. APPENDIX B: Persistent /home

I have not tested this yet, but if you want a persistent, encrypted /home on the thumb drive, the easy method would probably be to use fdisk to make one tiny FAT32 partition on the thumb drive and one larger ext2 partition.  Then specify the ext2 partition using the directions in the "help" file to use an encrypted home.



6. Booting from ISO


Using Grub4dos (external link) it's possible to boot directly from an iso image. Grun4dos (external link) extends the functionality of regular Grub.

6.1. Possible options


6.1.1. From a USB stick

Grub4dos can be installed directly into the MBR on a USB stick or it can be chainloaded from other bootloaders such as syslinux, lilo or grub thereby eliminating the need to install it onto the MBR. See here (external link).

6.1.2. From Windows

It is also possible to have Grub4dos (grldr) loaded directly by NTLDR and also Vista's boot manager. See here (external link).

6.2. Menu entry


The next step is to create a suitable entry in menu.lst for the tinycore/microcore linux iso

title Tinycore Linux
find --set-root /images/tinycore_2.5.iso
map --mem /images/tinycore_2.5.iso (0xff)
map --hook
chainloader (0xff)


That will then boot the iso as if it were on a CD and load ISOLINUX.

Note that an emulated CD cannot be accessed once the Tiny Core kernel starts executing http://diddy.boot-land.net/grub4dos/files/map.htm#hd32 (external link):

"The "map" process is implemented using INT 13 - any disk emulation will remain accessible from an OS that uses compatible mode disk access, e.g. DOS and Windows 9x. The emulation can't however, be accessed from an OS which uses protected mode drivers (Windows NT/2000/XP/Vista, Linux, FreeBSD) once the protected mode kernel file(s) take control."

In particular, Tiny Core extensions in a top-level /tce directory of an ISO cannot be loaded from an emulated CD. The boot process does work with extensions that are contained within the /opt/tce directory of the initrd file /boot/tinycore.gz (or /boot/microcore.gz) on an ISO on an emulated CD.

Contributors to this page: VitaminJ , JedzRose , vitex , indie , vinnie , curaga and thehatsrule .
Page last modified on Thursday 04 of February, 2010 11:08:07 MST by VitaminJ.

Menu [toggle]

Search Box (new)

in:

Navigate