Knoppix is a GNU/Linux distribution that boots and runs completely from cd it can also boot and run completely from a USB drive.
Edit from Krellan on 14 Oct 2006: I have tested and came up with an alternate "recipe" for creating a Knoppix-based bootable USB key: These instructions are for use under the Knoppix 5.0.1 CD, and don't require the HP Windows XP USB formatter tool. It doesn't use GRUB. Instead, it boots with the same title screen Knoppix already uses for the CD, so all "cheat codes" will continue to work. Remaining space on the USB key can still be seen by Windows if necessary, and/or a Knoppix persistent encrypted home directory can be created in that space. I recommend trying this "recipe", as it has worked quite well for me and others. --Krellan 20:45, 14 Oct 2006 (GMT)

To boot an unmodified Knoppix from a USB stick or USB hard drive is quite easy although it requires a few of steps. This tutorial assumes that you are already running GNU/Linux (and has been tested on Debian).
Edit from Ruymbeke on March 23rd 2006: A lot of, if not most of the USB dongles are not bootable by default. You may want to use the HPUSBFW.EXE tool (XP only) to make it bootable by changing the geometry of the device and perform a low level (re-) format. It may reduce slightly the overall size of the drive (to make it bootable) but I have run it successfuly on all my USB dongles: pqi, lexar, corsair, ... You will find this tool and an alternate method for booting Knoppix 4.02 from a USB dongle using grub.exe or loadlin.exe from a dos boot in here: (Knoppix 5.0 addon) Edit from mswoon on 14 Apr 2006: I didn't have to do the above - just add test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]" at the right place in linuxrc as documented in and it worked on a 2GByte Memorex with no problem. Not that I don't trust you, but can you release the source code for that XP-only software?

Attach your USB device to your computer and create a partition (using e.g. cfdisk) large enough to hold the contents of the ISO image plus about 5%. The rest of this discussion assumes that you can address this partition using /dev/sda1. Create a file system on the partition. You can use an existing VFAT filesystem (to keep compatibility with Windows/DOS). Regardless, make sure the partition type (set when you partition the drive) matches the filesystem you install. (If they differ, grub-install will fail with a confusing message "file ...boot/grub/stage1 not read correctly".) Assuming you settle on an ext3 filesystem:
# mke2fs -j /dev/sda1

To prevent fsck from being run on it:
# tune2fs -c 0 -i 0 /dev/sda1

Mount the partition and copy the contents of the KNOPPIX ISO image (named KNOPPIX.iso below) to it:
# # # # # # # # # mount /dev/sda1 /mnt losetup /dev/loop0 KNOPPIX.iso mkdir knoppix mount /dev/loop0 knoppix cp -r knoppix/* /mnt sync umount knoppix rmdir knoppix losetup -d /dev/loop0

To set up Grub to boot from the USB drive, copy Grub's working files, namely, stage1, stage2 and the appropriate stage1_5 file, to the partition. It is easiest to simply copy all of Grub's files. Assuming your distribution has Grub's loader in /boot/grub:
# mkdir -p /mnt/boot/grub # cp -r /boot/grub/* /mnt/boot/grub

(Note - You may want to try the grub-install command below before bothering to find those stage* files, since a recent version will do the copy itself.) To install the stage1 boot loader to the drive's master boot record (MBR), edit the file to tell grubinstall that /dev/sda1 is a bios drive:
# echo '(hd0) /dev/sda' > /mnt/boot/grub/

and then install Grub to /dev/sda:
# grub-install --root-directory=/mnt --no-floppy '(hd0)'

Finally, create a menu.lst file. (Note: On Redhat/Fedora based systems, the grub configuration file is called grub.conf, not menu.lst as on Debian systems, so replace menu.lst with grub.conf below.) Look at /mnt/boot/isolinux/isolinux.cfg. These are the different default Knoppix configurations. The default configuration on 4.0.2 is:
DEFAULT linux APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce quiet BOOT_IMAGE=knoppix

Converting this to a Grub boot is relatively straight forward. On booting, the root is set to the boot device. This is the Knoppix partition which is exactly what we want. The line starting with DEFAULT tells isolinux which kernel in /boot/isolinux to use. APPEND tells isolinux the arguments to pass to the kernel. Grub needs to load the initrd on its own and the arguments go on the kernel line. With a bit of rearranging, we get the following:
title Knoppix kernel /boot/isolinux/linux ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce quiet BOOT_IMAGE=knoppix initrd /boot/isolinux/minirt.gz boot

Add the above to /mnt/boot/grub/menu.lst. Add the following lines to the beginning of the file to have Knoppix boot automatically:
default timeout 0 2

Finally, unmount the partition.
# umount /mnt

You should now be booting Knoppix from your USB drive.

[edit] Booting to an Image on an Alternative Device
Poor Man's USB Based Boot (Boot from USB flash memory stick and then continue boot with Knoppix image stored on a harddisk or a CD or an external USB harddisk ) How To: What you will need:

Computer with BIOS capable of booting from USB keydrive (select USB-HDD). (Unfortunately, some buggy BIOS just wont boot from my USB stick, such as all versions up to F9 for the Gigabyte GA-8IEXP motherboard). USB keydrive that can boot as USB-HDD device. Make sure you read the product specification, only some USB flash sticks support this feature. (or see this 4/05 review on Ars Technica . Only 3 of 10 reviewed sticks are bootable.)

• •

Linux with GRUB grub boot loader already installed. I just use Knoppix. Read Win Partition Poor Man Installation for the more versatile boot mechanism we gonna utilize here.

Steps: (Cautions: Unmount usb stick before you remove it from USB slot to avoid data loss. Backup the MBR of harddisk and USB stick, see the link above) 1. Insert the USB stick, use cfdisk to create a partition with boot flag on this device ( cfdisk /dev/sda ). Create a file system on the newly created partition.(eg. mke2fs -m0 /dev/sda1) 2. Mount the partition and install grub boot loader on this device ( mount /dev/sda1 /mnt/usb && grub-install --root-directory=/mnt/usb /dev/sda ). Now the USB stick is already bootable, you will enter the interactive GRUB shell enviroment if you boot with it. 3. Copy kernel and initrd to USB stick. To continue boot from an knoppix 3.6 ISO image stored on a NTFS/FAT harddisk partition, you will need the kernel and miniroot.gz files from Ruymbeke's files. 4. Create a file menu.lst under dir /mnt/usb/boot/grub, I just copied the one from Ruymbeke's files pasted in Win Partition PMI. Specify the location of the newly copied kernel and minirt files in this file, note (hd0,0) is the first partition on USB stick when you boot from it, and the first harddisk likes to be hd1. To find out how GRUB map devices, press key c when you see GRUB boot menu at boot time, then type root ( and press TAB key, see the GRUB texinfo for detail. DONE. I have created a 32M boot partition on a 128M USB flash stick, and use it to boot Knoppix ISO image stored in a FAT32 partition shared by Windows, or to boot ubuntu live CD (basemodule is Morphix) already copied to another partition. The purpose is to reduce the time to burn these Linux Live CDs and less CDs to carry with. Retrieved from ""

Sign up to vote on this title
UsefulNot useful