Tiny Core Linux
Tiny Core Base => TCB Tips & Tricks => Topic started by: SvOlli on July 03, 2011, 01:28:32 PM
-
Hello,
I've had some discussions lately on howto install Tiny Core Linux on a machine that doesn't have a CD-ROM drive. Here's a small howto on chain-booting an ISO-image.
First of all you need GRUB4DOS. Despite the name, it doesn't need DOS.
You can download it on Tiny Core using this command:
tce-load -wi grub4dos
When your stuck with an Linux distro or Windows, so you'll need to download the package:
https://code.google.com/p/grub4dos-chenall/downloads/list
On Windows you'll also need another tool to write the first stage boot loader. It's in the package grubinst-1.1-bin-w32-2008-01-01.zip, available here:
http://download.gna.org/grubutil/
1. Format the USB stick with a partition using FAT12/16/32, NTFS or EXT2/3 (not EXT4)
You create the first stage boot loader on a Linux system running bootlace.com:
./bootlace.com --time-out=0 /dev/of_usb_stick (like /dev/sdb, not /dev/sdb1)
2. Copy the file "grldr" at the root of that partiton. And copy the tinycore-iso file to that same place and rename it to "tinycore.iso".
3. Create a file "menu.lst" at the same place containing this:
find --set-root /tinycore.iso
map --mem /tinycore.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
After these steps, booting from the USB stick should give you the familiar boot screen from Tiny Core Linux.
Greetings,
SvOlli
P.S.: Why do people still keep using syslinux/isolinux/extlinux/pxelinux? ;)
-
Hi SvOlli
I thought EXT3 is a journaling file system, and that it should not be used on a USB stick.
-
It was stating what is technically possible using the first stage loader, not what is sane to use on a USB stick. NTFS is also a journaling file system.
-
Hi SvOlli
Since this is being offered as a how to and might be used by someone who is unaware of it, I will
state it.
Do not use a journaling file system on a USB stick or any flash storage medium. It will cause it to
wear out prematurely.
-
It is also not ideal to use a FAT12/16/32 filesystem, as you have a greater likelihood of filesystem corruption.
It is ideal to use ext2.
It is also about free choice. For example, some people may use a journalling filesystem, Knowing that the drive may not last as long. USB drives are not that expensive to replace.
-
Hi Guy
My post was not made to take away free choice, just to allow someone who is unaware of the possible
consequences to make an informed choice. They are, as always, free to ignore my advice.
-
Not trying to suggest that you were.
It is good that you let them know.
-
Hi Guy
Fair enough. I misunderstood the message.
-
I use gru4dos exclusively now (due mostly because of the lack of support or bug for older systems in isolinux/syslinux v4) now that i've found how versatile grub4dos is I can't ever see going back to anything else.
I agree ext2 works best on all nand drive/sticks
-
Thanks SvOlli!
I've tried with ext2fs and fat32 and it works perfectly. I like the ease of updating to the most current as the only thing that has to be done is to download TC and rename it to tinycore.iso and off you go. Thanks again for sharing this! :)
Have fun tweaking TC to your liking,
meo
-
I've had some success extending the OP method (thanks SvOlli).
The Main Goals:
1. Supply bootcodes via the bootloader in the usual TC manner
2. Reduce time GRUB4DOS takes to access the TC ISO
3. Produce a simple to maintain USB flash drive, able to boot multiple OSs via ISO
I managed to achieve 1 and 3, and hope progress might be possible on 2 with help from the Core team.
The following method illustrates how to create a USB device that directly boots ISOs and images via different GRUB4DOS methods.[1]
What is needed:
Tools
* dosfstools.tcz
* grub4dos.tcz
* mke2fs (provided by default in standard TC)
ISOs and Images
* Tinycore ISO (tested with v3.7.1 - 10MB - uses mapping to memory) [2]
* UBCD ISO (tested with v5.1 - 352MB - uses direct mapping) [3]
* Balder10 IMG (FreeDOS floppy disk from Finnix - 1.4MB uses direct mapping) [4]
Storage
* USB flash drive (suggest size=1GB for demo)
Prepare the USB Flash Drive [5]
* Blank the start (or all) of the device
* Create 2 partitons
sdx1=FAT16 size=500MB (for ISO/IMG storage) [6]
sdx2=ext2 size=all remaining space (for TC data storage)
Prepare the ISOs and Images
* Ensure the files are named:
tinycore.iso
ubcd51.iso
balder10.img
Store the ISOs and Images
* Mount /mnt/sdx1
* Copy the files to /mnt/sdx1
Make the USB Device Bootable
* Copy /usr/local/share/grub4dos/grldr to /mnt/sdx1
* Create the following text file /mnt/sdx1/menu.lst [8]
# menu.lst displays a menu when booting via GRUB4DOS
# http://diddy.boot-land.net/grub4dos/Grub4dos.htm
timeout 5
default 0
color cyan/black black/light-gray green/black yellow/black
# 0
title Tinycore Desktop (Mount Mode, Persistent Extensions, /home, /opt)
root ()
map --mem /tinycore.iso (hd32)
map --hook
root (hd32)
kernel /boot/bzImage quiet waitusb=5 norestore tce=UUID=uuid-of-sdx2 home=UUID=uuid-of-sdx2 opt=UUID=uuid-of-sdx2
initrd /boot/tinycore.gz
# 1
title UBCD Toolkit (inc Clonezilla, MHDD, Parted Magic)
root ()
map /ubcd51.iso (hd32)
map --hook
chainloader (hd32)
# 2
title Balder10 FreeDOS (Defrag FAT16 Partition)
root ()
map /balder10.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
map --floppies=1
* Unmount /mnt/sdx1
* Create a Master Boot Record on the USB Device
/usr/local/share/grub4dos/bootlace.com --time-out=0 /dev/sdx
Notes:
[1] GRUB4DOS has two methods of accessing an ISO or image file. Mapping to memory is the slowest and is best suited to small files. Direct mapping is almost instantaneous and suited to both small and large files.
[2] http://distro.ibiblio.org/tinycorelinux/downloads.html
[3] http://www.ultimatebootcd.com/download.html
[4] http://www.finnix.org/Balder
[5] The method assumes the USB device to be /dev/sdx, change this to the actual value.
[6] Direct mapping requires that the file occupies contiguous disk space. The developer of GRUB4DOS has indicated that ext2/3 may not be the best choice for this. Balder10 includes a defragmenter for FAT16.
[7] Defragmenting sdx1 might also be done by copy out of files from sdx1, reformat sdx1, return files to sdx1.
[8] Replace uuid-of-sdx2 with the actual UUID value
Outcome
I have other ISOs and images that might have been illustrated but felt that too many examples might not be helpful. Adding another ISO or image is a simple matter of dropping it into the root of sdx1 and adding an entry in menu.lst. Updating is just a matter of replacing the old ISO or image file with a newer one.
TC can be started with the preferred bootcodes automatically provided by the boot loader. Its usual persistent directories are maintained on a separate ext2 file system - transparently from the user viewpoint.
Tinycore can only be made to operate using the map --mem method. This prolongs the overall loading time as the ISO must first be read into memory before TC starts to load. UBCD and Balder are much larger and smaller respectively than TC. Both begin loading faster than TC as a result of using the direct mapping mode. This is where the Core team might be able to help obtain a TC ISO that can be booted via direct mapping.
Edit
Incorrectly stated achieved goals 1 &2. Corrected to achieved goals 1 & 3.
Corrected some typos.
Minor amendments to improve clarity.
-
Hi Y'all!
I have problems with one of my USB Flash Drives. When I issue the bootlace command i get the message "Invalid partition table ...". Can someone give me a hint how to make it work? Thanks beforehand!
Have fun using TC,
meo
-
Repartition. Use fdisk, part of base.
-
Thanks bmarkus!
I just tested the USB Flash Drive (2 GB) formatted in ext2fs and got another error message: "No boot signature(55 AA). Must specify floppy --floppy explicitly for floppy." I just have to make another repartition I guess.
Have fun trying the limits of TC,
meo
-
Try deleting the partition, and creating a new one.
You can use fdisk, as already mentioned.
Another option is to use GParted which can be installed in Tinycore, or run from Parted Magic.
If you use fdisk, you need to format the partition as well. GParted does it automatically.
-
get the message "Invalid partition table ...".
got another error message: "No boot signature(55 AA)....
It might be helpful to blank the first part of the USB device by writing zeros to the first 1k of it. This will remove any existing Master Boot Record and Partition Table. The result will be the device is no longer bootable and everything on it will no longer be accessible or usable. Partitions may then be created and formatted as desired.
Of course, this should be conducted with extreme caution - blanking the wrong device could have catastrophic effects on your machine.
-
Thanks for your response SamK!
I did just that yesterday and got everything to work just nice finally. I' writing from TC installed on the very same USB Flash Drive that didn't want to work the way I wanted it to at first. Thanks for your suggestion anyway; it was just the thing to do. And, by the way, I did it on the right device too. ;D
Keep on having fun with TC and MC,
meo