Tiny Core Base > TCB Tips & Tricks

Howto: Create Bootable USB Stick

(1/6) > >>

dmoerner:
This is a shameless modification of the old DSL instructions (written by SaidinUnleashed, to give full credit).  This was performed from a Debian Sid x86 system.  The USB stick is /dev/sdc1.

1) Install necessary tools.  On Debian this is syslinux, mtools, and dosfstools:


--- Code: ---aptitude install syslinux mtools dosfstools
--- End code ---

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.


--- Code: ---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
--- End code ---

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.


--- Code: ---dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdc
--- End code ---

Now, make a FAT 32 partition:


--- Code: ---mkfs.vfat -F 32 /dev/sdc1
--- End code ---

3) Copy over the files

You will need to mount the iso image using loopback and then copy over the files.


--- Code: ---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
--- End code ---

4) Set up syslinux

Since the ISO uses isolinux, we will need to make some changes


--- Code: ---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
--- End code ---

5) Cross your finger, 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.

APPENDIX A: Using Grub

You can also use grub to manage booting the pendrive, as described at http://tinycorelinux.com/files/extensions/grub-0.97-splash.tce.info.  However, the process is a bit more involved than that.  After installing grub, you need to do the following:


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

--- End code ---

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.

EDIT 12/2/08: Added grub appendix, corrently cited SaidinUnleashed after discussion on IRC :)

roberts:
Bootable pendrive are always a challenge.

If the target is a bootable pendrive, then might try unetbootin from other OS (Windows or Linux).
It worked very for me:

1. format pendrive fat32 from other OS
2. download tc iso
3. run unetbootin

unetbootin is a single exe that does not need to be installed on the other OS.

Just choose iso image and specify full path
then specify the pendrive

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

You can get unetbootin from:
http://unetbootin.sourceforge.net

SaidinUnleashed:
Wow, that's useful, and much simpler than my hacked up w32 version of syslinux.

Editus: Except that I can't get it to boot...

paulc:

Couldn't get the above going but did manage an "old style"  copy all files into the top directory of the pendrive and point the syslinux.cfg to the new location (i.e. delete /boot/ and directory structure). Then it flies...........

.......boots a variety of eBox's (including the 200MHz one) and an eee 701 beautifully.

Nice work.



cjgau:
Unetbooting is really easy; I run it on my office M$ machine; and then boot my Asus901 right away under my desk. =o)

Thanks, Robert.

Navigation

[0] Message Index

[#] Next page

Go to full version