<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://mail.knoppix.net/wiki3/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://mail.knoppix.net/wiki3/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Krellan</id>
		<title>Knoppix Documentation Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://mail.knoppix.net/wiki3/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Krellan"/>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Special:Contributions/Krellan"/>
		<updated>2026-09-17T04:42:32Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2014-04-14T08:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: The mkdiskimage appears to now work for big USB sticks in Knoppix 7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Admin Notice''': You can create your own copy of Knoppix on a USB memory stick using the instructions here and at the [[USB Based FAQ]]. You could also [http://www.knoppix.net/buy-knoppix-usb.php buy it] (5.3.1 and 6.0.1) from $14.95 delivered.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
These instructions were originally written for Knoppix 5.  I tried early versions of Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  However, Knoppix 6.2.1 is once again useful, and these instructions also work (with a minor change described below) for Knoppix 6 and 7.&lt;br /&gt;
&lt;br /&gt;
Knoppix 6 and 7 also have their own built-in utility to create a USB key after booting from the CD, so using that might work easier.  Also, the [http://unetbootin.sourceforge.net/ UNetbootin] package can perform this installation automatically for you.  However, if you want to learn how these tools work their magic, read on.&lt;br /&gt;
&lt;br /&gt;
Even though Knoppix 5 is rather out of date these days, I still believe it set the high water mark for being packed full of useful software, both for system repair/recovery purposes, and for general productive use.  Later Knoppix versions stripped out much of this functionality, unfortunately.  However, they have updated Linux kernel and drivers, so will work better with newer hardware.  Choose whichever is best for your needs.  The beauty of having your operating system boot from a USB key is that it becomes easily interchangeable, unlike a permanent installation on your hard drive!&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 and newer boot rather nicely from a USB key.  Knoppix 5 will work better on older hardware, and has a larger selection of preinstalled software.  Knoppix 6 has better support for newer hardware, and does a better job of handling your encrypted home directory on USB.  Knoppix 7 is the latest and greatest.  Choose whichever you prefer.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
For Knoppix 5, I recommend version 5.3.1 for DVD, or version 5.1.1 for CD.  For Knoppix 6, I recommend version 6.2.1 for both DVD and CD.  For Knoppix 7, use the latest version (I have tested only 7.2.0).  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure SanDisk U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
Fortunately, SanDisk has listened to customer outcry, and has stopped infecting their USB keys with U3.  Newer USB keys should be U3 free, even from SanDisk.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''bs=1k count=16k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz bs=1k count=16k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
; Note: Newer USB keys larger than 8GB often work best with &amp;quot;superfloppy&amp;quot; format, see below.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size, first, try the same command as above:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size, and the above command didn't work (you got &amp;quot;divide by zero&amp;quot; or similar error), next, try this sequence of commands (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  (This bug might be fixed in Knoppix 7, as it seems to happen less often, but I've still seen it happen.)  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
Note the different location where the files on the CD appear.  In Knoppix 5, it's the /cdrom directory, but in Knoppix 6 and 7, it's the /mnt-system directory.&lt;br /&gt;
&lt;br /&gt;
This copies all files from that directory to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
Finish up:&lt;br /&gt;
&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
As with the earlier rsync command, select one of the above, depending on your version of Knoppix.&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
You will see a speed readout of how fast the files can be installed to your USB key.  Some keys are much faster than others.  Getting about 2MB per second is reasonable.  If your speed is extremely slow, such as getting KB per second instead of MB, check your USB ports, your hardware might be USB 1 instead of USB 2.  Avoid USB 1, it is frustratingly slow.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable, if running Knoppix 5.  Knoppix 6 and 7 autodetect the usage of USB keys, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix 5 into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory, if running Knoppix 5.  Knoppix 6 and 7 will automatically prompt you for this information when you boot it from your USB key for the first time, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix 5 &amp;quot;Create Persistent&amp;quot; utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2014-04-14T07:51:41Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Standardized on zeroing size to reuse at 16MB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Admin Notice''': You can create your own copy of Knoppix on a USB memory stick using the instructions here and at the [[USB Based FAQ]]. You could also [http://www.knoppix.net/buy-knoppix-usb.php buy it] (5.3.1 and 6.0.1) from $14.95 delivered.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
These instructions were originally written for Knoppix 5.  I tried early versions of Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  However, Knoppix 6.2.1 is once again useful, and these instructions also work (with a minor change described below) for Knoppix 6 and 7.&lt;br /&gt;
&lt;br /&gt;
Knoppix 6 and 7 also have their own built-in utility to create a USB key after booting from the CD, so using that might work easier.  Also, the [http://unetbootin.sourceforge.net/ UNetbootin] package can perform this installation automatically for you.  However, if you want to learn how these tools work their magic, read on.&lt;br /&gt;
&lt;br /&gt;
Even though Knoppix 5 is rather out of date these days, I still believe it set the high water mark for being packed full of useful software, both for system repair/recovery purposes, and for general productive use.  Later Knoppix versions stripped out much of this functionality, unfortunately.  However, they have updated Linux kernel and drivers, so will work better with newer hardware.  Choose whichever is best for your needs.  The beauty of having your operating system boot from a USB key is that it becomes easily interchangeable, unlike a permanent installation on your hard drive!&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 and newer boot rather nicely from a USB key.  Knoppix 5 will work better on older hardware, and has a larger selection of preinstalled software.  Knoppix 6 has better support for newer hardware, and does a better job of handling your encrypted home directory on USB.  Knoppix 7 is the latest and greatest.  Choose whichever you prefer.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
For Knoppix 5, I recommend version 5.3.1 for DVD, or version 5.1.1 for CD.  For Knoppix 6, I recommend version 6.2.1 for both DVD and CD.  For Knoppix 7, use the latest version (I have tested only 7.2.0).  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure SanDisk U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
Fortunately, SanDisk has listened to customer outcry, and has stopped infecting their USB keys with U3.  Newer USB keys should be U3 free, even from SanDisk.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''bs=1k count=16k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz bs=1k count=16k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
; Note: Newer USB keys larger than 8GB often work best with &amp;quot;superfloppy&amp;quot; format, see below.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
Note the different location where the files on the CD appear.  In Knoppix 5, it's the /cdrom directory, but in Knoppix 6 and 7, it's the /mnt-system directory.&lt;br /&gt;
&lt;br /&gt;
This copies all files from that directory to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
Finish up:&lt;br /&gt;
&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
As with the earlier rsync command, select one of the above, depending on your version of Knoppix.&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
You will see a speed readout of how fast the files can be installed to your USB key.  Some keys are much faster than others.  Getting about 2MB per second is reasonable.  If your speed is extremely slow, such as getting KB per second instead of MB, check your USB ports, your hardware might be USB 1 instead of USB 2.  Avoid USB 1, it is frustratingly slow.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable, if running Knoppix 5.  Knoppix 6 and 7 autodetect the usage of USB keys, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix 5 into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory, if running Knoppix 5.  Knoppix 6 and 7 will automatically prompt you for this information when you boot it from your USB key for the first time, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix 5 &amp;quot;Create Persistent&amp;quot; utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2014-04-14T06:58:30Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Updated text to mention Knoppix 7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Admin Notice''': You can create your own copy of Knoppix on a USB memory stick using the instructions here and at the [[USB Based FAQ]]. You could also [http://www.knoppix.net/buy-knoppix-usb.php buy it] (5.3.1 and 6.0.1) from $14.95 delivered.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
These instructions were originally written for Knoppix 5.  I tried early versions of Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  However, Knoppix 6.2.1 is once again useful, and these instructions also work (with a minor change described below) for Knoppix 6 and 7.&lt;br /&gt;
&lt;br /&gt;
Knoppix 6 and 7 also have their own built-in utility to create a USB key after booting from the CD, so using that might work easier.  Also, the [http://unetbootin.sourceforge.net/ UNetbootin] package can perform this installation automatically for you.  However, if you want to learn how these tools work their magic, read on.&lt;br /&gt;
&lt;br /&gt;
Even though Knoppix 5 is rather out of date these days, I still believe it set the high water mark for being packed full of useful software, both for system repair/recovery purposes, and for general productive use.  Later Knoppix versions stripped out much of this functionality, unfortunately.  However, they have updated Linux kernel and drivers, so will work better with newer hardware.  Choose whichever is best for your needs.  The beauty of having your operating system boot from a USB key is that it becomes easily interchangeable, unlike a permanent installation on your hard drive!&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 and newer boot rather nicely from a USB key.  Knoppix 5 will work better on older hardware, and has a larger selection of preinstalled software.  Knoppix 6 has better support for newer hardware, and does a better job of handling your encrypted home directory on USB.  Knoppix 7 is the latest and greatest.  Choose whichever you prefer.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
For Knoppix 5, I recommend version 5.3.1 for DVD, or version 5.1.1 for CD.  For Knoppix 6, I recommend version 6.2.1 for both DVD and CD.  For Knoppix 7, use the latest version (I have tested only 7.2.0).  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure SanDisk U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
Fortunately, SanDisk has listened to customer outcry, and has stopped infecting their USB keys with U3.  Newer USB keys should be U3 free, even from SanDisk.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
; Note: Newer USB keys larger than 8GB often work best with &amp;quot;superfloppy&amp;quot; format, see below.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
Note the different location where the files on the CD appear.  In Knoppix 5, it's the /cdrom directory, but in Knoppix 6 and 7, it's the /mnt-system directory.&lt;br /&gt;
&lt;br /&gt;
This copies all files from that directory to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
Finish up:&lt;br /&gt;
&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6 or 7:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
As with the earlier rsync command, select one of the above, depending on your version of Knoppix.&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
You will see a speed readout of how fast the files can be installed to your USB key.  Some keys are much faster than others.  Getting about 2MB per second is reasonable.  If your speed is extremely slow, such as getting KB per second instead of MB, check your USB ports, your hardware might be USB 1 instead of USB 2.  Avoid USB 1, it is frustratingly slow.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable, if running Knoppix 5.  Knoppix 6 and 7 autodetect the usage of USB keys, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix 5 into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory, if running Knoppix 5.  Knoppix 6 and 7 will automatically prompt you for this information when you boot it from your USB key for the first time, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix 5 &amp;quot;Create Persistent&amp;quot; utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2010-04-11T04:24:49Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Updated rsync and persistent instructions for Knoppix 6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Admin Notice''': You can create your own copy of Knoppix on a USB memory stick using the instructions here and at the [[USB Based FAQ]]. You could also [http://www.knoppix.net/buy-knoppix-usb.php buy it] (5.3.1 and 6.0.1) from $14.95 delivered.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
These instructions were originally written for Knoppix 5.  I tried early versions of Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  However, Knoppix 6.2.1 is once again useful, and these instructions also work (with a minor change described below) for Knoppix 6.&lt;br /&gt;
&lt;br /&gt;
Knoppix 6 also has its own built-in utility to create a USB key after booting from the CD, so using that might work easier.  Also, the [http://unetbootin.sourceforge.net/ UNetbootin] package can perform this installation automatically for you.  However, if you want to learn how these tools work their magic, read on.&lt;br /&gt;
&lt;br /&gt;
Both Knoppix 5 and Knoppix 6 boot rather nicely from a USB key.  Knoppix 5 will work better on older hardware, and has a larger selection of preinstalled software.  Knoppix 6 has better support for newer hardware, and does a better job of handling your encrypted home directory on USB.  Choose whichever you prefer.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
For Knoppix 5, I recommend version 5.3.1 for DVD, or version 5.1.1 for CD.  For Knoppix 6, I recommend version 6.2.1 for both DVD and CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 (or 6) from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/boot/isolinux/ ./&lt;br /&gt;
&lt;br /&gt;
The only difference between Knoppix 5 and 6 is the location where the files on the CD appear.  In Knoppix 5, it's the /cdrom directory, but in Knoppix 6, it's the /mnt-system directory.&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
Finish up:&lt;br /&gt;
&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 5:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
If you're running Knoppix 6:&lt;br /&gt;
&lt;br /&gt;
 rsync -av --progress /mnt-system/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
As with the earlier rsync command, select one of the above, depending on your version of Knoppix.&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
You will see a speed readout of how fast the files can be installed to your USB key.  Some keys are much faster than others.  Getting about 2MB per second is reasonable.  If your speed is extremely slow, such as getting KB per second instead of MB, check your USB ports, your hardware might be USB 1 instead of USB 2.  Avoid USB 1, it is frustratingly slow.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable, if running Knoppix 5.  Knoppix 6 autodetects the usage of USB keys, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix 5 into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory, if running Knoppix 5.  Knoppix 6 will automatically prompt you for this information when you boot it from your USB key for the first time, so this step is not necessary.&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix 5 &amp;quot;Create Persistent&amp;quot; utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2010-04-11T03:46:27Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Updating text to include Knoppix 6, not just Knoppix 5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Admin Notice''': You can create your own copy of Knoppix on a USB memory stick using the instructions here and at the [[USB Based FAQ]]. You could also [http://www.knoppix.net/buy-knoppix-usb.php buy it] (5.3.1 and 6.0.1) from $14.95 delivered.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
These instructions were originally written for Knoppix 5.  I tried early versions of Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  However, Knoppix 6.2.1 is once again useful, and these instructions also work (with a minor change described below) for Knoppix 6.&lt;br /&gt;
&lt;br /&gt;
Knoppix 6 also has its own built-in utility to create a USB key after booting from the CD, so using that might work easier.  Also, the [http://unetbootin.sourceforge.net/ UNetbootin] package can perform this installation automatically for you.  However, if you want to learn how these tools work their magic, read on.&lt;br /&gt;
&lt;br /&gt;
Both Knoppix 5 and Knoppix 6 boot rather nicely from a USB key.  Knoppix 5 will work better on older hardware, and has a larger selection of preinstalled software.  Knoppix 6 has better support for newer hardware, and does a better job of handling your encrypted home directory on USB.  Choose whichever you prefer.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
For Knoppix 5, I recommend version 5.3.1 for DVD, or version 5.1.1 for CD.  For Knoppix 6, I recommend version 6.2.1 for both DVD and CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 (or 6) from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-04-08T10:13:42Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added more superfloppy text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 evidently has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
I recommend Knoppix version 5.3.1 for DVD, or version 5.1.1 for CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.&lt;br /&gt;
&lt;br /&gt;
Clear the first 16MB of the USB key first (see the next section below for why):&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
The mkdosfs command will create your filesystem.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
Now, run the sfdisk command, to inform the kernel that you have just changed the filesystem, and that it should rescan the disk for changed partitions/filesystems.  The -R option to this command doesn't change what's on the disk, instead, it just forces the kernel to do a rescan of the disk so that it can detect your new filesystem.&lt;br /&gt;
&lt;br /&gt;
 sfdisk -R /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux /dev/sdz&lt;br /&gt;
&lt;br /&gt;
As you can see, I'm also experimenting with leaving out the -s option to syslinux.  It is much faster, but might be less compatible with some BIOS's.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-03-21T00:08:56Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Updated superfloppy text and cleaned up rsync advice&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 evidently has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
I recommend Knoppix version 5.3.1 for DVD, or version 5.1.1 for CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.  The rsync command is very fussy about spaces, dots, and slashes, so be careful you've typed in the command correctly.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory.  Again, don't forget to doublecheck your typing of the spaces, dots, and slashes in the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  The mkdiskimage sequence of steps is no longer necessary!&lt;br /&gt;
&lt;br /&gt;
Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-03-19T08:54:57Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Minor sizing updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 evidently has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
I recommend Knoppix version 5.3.1 for DVD, or version 5.1.1 for CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).&lt;br /&gt;
&lt;br /&gt;
To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key.  I've observed that Windows only writes data to about 16MB when formatting, so I'm guessing that 16MB is sufficient to get a clean reformat from Windows.  In Knoppix, the command to zero the first 16MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=16k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
Sometimes, ironically, Windows chooses to format the USB key in superfloppy format!  *Shrug*&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-03-19T06:28:01Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Cleaned up Knoppix version numbers and CD vs. DVD confusion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 evidently has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
I recommend Knoppix version 5.3.1 for DVD, or version 5.1.1 for CD.  Choosing DVD or CD is up to you.  It's a function of how large your USB key is, and how much free space you want to have remaining on the USB key after completing installation of Knoppix onto it.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5 from CD (or DVD), and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).  To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key, the first 1MB or so is sufficient.  In Knoppix, the command to zero the first 1MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=1k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-03-19T06:11:51Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Fixed signature and cleared up some commentary about superfloppy format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5.1.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version, such as 5.1.1) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.&lt;br /&gt;
&lt;br /&gt;
As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
You can then proceed with the rest of the instructions above, starting at the ''syslinux'' command.  Whenever the instructions mention a drive letter with a partition number, for example /dev/sdz1, you no longer need to supply the partition number, because there isn't one.  Just use the drive letter instead, /dev/sdz, in all of the commands.  As an example, here's the SYSLINUX command to use:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:11, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).  To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key, the first 1MB or so is sufficient.  In Knoppix, the command to zero the first 1MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=1k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2009-03-19T06:05:44Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added what I've learned about superfloppy format and Windows formatting, mentioned Knoppix 6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions are for Knoppix 5.  I tried Knoppix 6 and it was so stripped down that I did not want it on my USB key, as many of the useful tools were no longer there.  Knoppix 6 has its own built-in utility to create a USB key after booting from the CD, so these instructions aren't necessary for Knoppix 6 anyway.&lt;br /&gt;
&lt;br /&gt;
Knoppix 5.1.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version, such as 5.1.1) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the size of each drive and match it to the size of your USB key. If you confuse your hard drive with the USB key, you will destroy your hard drive installation with the instructions that follow. So, here is a little more info about identifying the USB key:&lt;br /&gt;
&lt;br /&gt;
USB keys are identified by the Linux kernel as a SCSI device (as implied by the preceding info). If your system has a SCSI hard drive, chances are you know about it already. If you only see one SCSI device (i.e. /dev/sda, /dev/sda1 or some other digit located where there is a &amp;quot;1&amp;quot;, here) and you are certain the USB key is not damaged, the odds favor the possibility that you just found the USB key. If you &amp;lt;i&amp;gt;do&amp;lt;/i&amp;gt; SCSI drives in your machine, the chances are that the kernel recognized them during boot and assigned the first (then second, and so forth) available identifier to these drives, which means the very last one that you see is probably the USB key. The most certain method of identifying the key is by using &amp;quot;fdisk -l&amp;quot;. Any SCSI devices will appear in this output, as the last devices to be shown. &lt;br /&gt;
&lt;br /&gt;
For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Superfloppy format==&lt;br /&gt;
&lt;br /&gt;
These days, USB keys larger than 1GB are common, and newer computers have improved BIOS support for booting from USB keys.  Therefore, USB-ZIP partition layout is not as necessary as it used to be, and in fact, can become a hindrance!  I am really starting to prefer the simplest partition layout of all: ''superfloppy format''.  As the name implies, this works by just formatting the entire USB key device as one big filesystem, without a partition table at all.  It's easy to do this.  When using the mkdosfs command, just use the &amp;quot;I&amp;quot; option, and give the device name containing the drive letter, without a partition number at all.  That causes the entire device to be formatted directly, as if it were one big partition, and you get a little more space as well, because you don't need to reserve any space for the partition table.  The command is this:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -I /dev/sdz&lt;br /&gt;
&lt;br /&gt;
==Letting Windows format it==&lt;br /&gt;
&lt;br /&gt;
Some BIOS's are cranky about superfloppy format, unfortunately.  Even on brand new hardware, I've seen really bad behavior from the BIOS supplied with &amp;quot;Shuttle&amp;quot; brand computers.  It's pathetic, really, how a company can spend so much money developing hardware and then put essentially zero effort into writing a decent BIOS for it.  Anyway, this BIOS seems to work best with USB keys that have been completely formatted by Windows (most likely, that's all they bothered to test with).  To let Windows format a USB key, the key must be zeroed, otherwise Windows will attempt to use what's already there and not let you reformat it.  Ironically, zeroing the key is something that can't be done under Windows.  It's not necessary to erase the entire key, the first 1MB or so is sufficient.  In Knoppix, the command to zero the first 1MB of the key is this:&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1k count=1k&lt;br /&gt;
&lt;br /&gt;
Then, remove the key from Knoppix and put it in a Windows machine, and format it under Windows.  You can then return to Knoppix and make the key bootable for Knoppix, just don't change anything about the partition or filesystem that Windows has applied to the key.&lt;br /&gt;
&lt;br /&gt;
Inspect the partition that Windows has applied to the USB key (most likely /dev/sdz1), and then go back to the ''syslinux'' command above.  Follow the steps from there.  For example, to apply SYSLINUX to the /dev/sdz1 partition, the command is this:&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz1&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:05, 19 March 2009 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/User_talk:ThurnerRupert</id>
		<title>User talk:ThurnerRupert</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/User_talk:ThurnerRupert"/>
				<updated>2009-02-11T07:03:32Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: New page: Hi.  I hope this works, I haven't used the wiki &amp;quot;talk&amp;quot; feature before.  As for Knoppix booting from a USB key and being able to be upgraded with &amp;quot;apt-get&amp;quot;, I don't think it would work.  Th...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi.  I hope this works, I haven't used the wiki &amp;quot;talk&amp;quot; feature before.  As for Knoppix booting from a USB key and being able to be upgraded with &amp;quot;apt-get&amp;quot;, I don't think it would work.  The Knoppix system will still think it's a CD-ROM, and thus not be very tolerant of writes.  Try it, though, and let me know if it works!&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:Main_Page</id>
		<title>Talk:Main Page</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:Main_Page"/>
				<updated>2008-09-10T08:52:25Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added mention of spam problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;getrolili&lt;br /&gt;
Nice site!&lt;br /&gt;
&lt;br /&gt;
If you have a little free time, read this post:,&lt;br /&gt;
&lt;br /&gt;
fo069.txt;3;6&lt;br /&gt;
&lt;br /&gt;
fo103.txt;3;6&lt;br /&gt;
&lt;br /&gt;
yqBAOz hdhfdhfd hdfh dfhfdhht5erhgbh fdhfh hfdhfd 7654 rfdghdfrgh dfhdf hd&lt;br /&gt;
&lt;br /&gt;
=== Red links ===&lt;br /&gt;
The red links are for when theres a link to a page but the page doesn't exist in the wiki, last night I clicked on my page and threw in some text to make my name not red[http://www.parkerscasino.com .] --[[User:Kyle|Kyle]] Tue Jan  4 19:12:05 UTC 2005&lt;br /&gt;
&lt;br /&gt;
=== Moving pages ===&lt;br /&gt;
[[Knoppix Customisations]] this page uses the word spelt with a z instead of an s inside, I notice this of course after I post to [[Customising FAQ]] blindly, hopefully someone can rename pages in the wiki --[[User:Kyle|Kyle]] Tue Jan  4 19:29:05 UTC 2005&lt;br /&gt;
&lt;br /&gt;
You can move the page to a new name but it seems the old one doesn't quite dissapear. And the red name is, of course, obvious now that you've said it :) --[[User:Markus|Markus]] 21:37, 4 Jan 2005 (GMT)&lt;br /&gt;
&lt;br /&gt;
=== Escaping wiki code ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;if [[ -e /proc/net/hostap ]]; then&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
showing nowiki tag for bash scripts, as I forgot where they are :)&lt;br /&gt;
--[[User:Kyle|Kyle]] Tue Jan 11 23:08:07 UTC 2005&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Adding Knoppix Section to Wikicities English Linux ===&lt;br /&gt;
&lt;br /&gt;
I'm just filling out the red link for Knoppix out at the [http://en.linux.wikicities.com/ Wikicities:Linux Wiki] (and wondering if the interwiki table on this site is hip to [[Wikicities:c:en.linux]] and [[Wikipedia:Knoppix]] links)&lt;br /&gt;
:And will someone please fix that missing search index!&lt;br /&gt;
::[[User:JimD|JimD]] 02:33, 5 Feb 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Main page Beta ===&lt;br /&gt;
&lt;br /&gt;
As the [[Main Page]] is write-protected, though it looks and works horrible , I'm now starting a '''[[Main Page Beta]]''' that everybody can edit. I hope that some of us will do, and that the wiki administrators (does they exist?) will notice our work, and import our changes to the real main page. (I've got this excellent idea from the [http://www.damnsmalllinux.org/wiki Damn Small Linux wiki] ;-D ) [[User:Qwerty|Qwerty]] 17:45, 3 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Enjoy ==&lt;br /&gt;
&lt;br /&gt;
hi&lt;br /&gt;
&lt;br /&gt;
== Spam problem ==&lt;br /&gt;
&lt;br /&gt;
Is there any way to deal with the spam?  This Wiki seems to get consistently hit.  People here are very good at manually catching it and reverting back, but automated spambots are still faster.  One of my pages, [[Bootable USB Key]], seems to be a popular target for attacks.  I wonder if captchas, or moderation, could help?&lt;br /&gt;
--[[User:Krellan|Krellan]] 09:52, 10 September 2008 (BST)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:Main_Page</id>
		<title>Talk:Main Page</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:Main_Page"/>
				<updated>2008-09-10T08:51:46Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: New section: Spam problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;getrolili&lt;br /&gt;
Nice site!&lt;br /&gt;
&lt;br /&gt;
If you have a little free time, read this post:,&lt;br /&gt;
&lt;br /&gt;
fo069.txt;3;6&lt;br /&gt;
&lt;br /&gt;
fo103.txt;3;6&lt;br /&gt;
&lt;br /&gt;
yqBAOz hdhfdhfd hdfh dfhfdhht5erhgbh fdhfh hfdhfd 7654 rfdghdfrgh dfhdf hd&lt;br /&gt;
&lt;br /&gt;
=== Red links ===&lt;br /&gt;
The red links are for when theres a link to a page but the page doesn't exist in the wiki, last night I clicked on my page and threw in some text to make my name not red[http://www.parkerscasino.com .] --[[User:Kyle|Kyle]] Tue Jan  4 19:12:05 UTC 2005&lt;br /&gt;
&lt;br /&gt;
=== Moving pages ===&lt;br /&gt;
[[Knoppix Customisations]] this page uses the word spelt with a z instead of an s inside, I notice this of course after I post to [[Customising FAQ]] blindly, hopefully someone can rename pages in the wiki --[[User:Kyle|Kyle]] Tue Jan  4 19:29:05 UTC 2005&lt;br /&gt;
&lt;br /&gt;
You can move the page to a new name but it seems the old one doesn't quite dissapear. And the red name is, of course, obvious now that you've said it :) --[[User:Markus|Markus]] 21:37, 4 Jan 2005 (GMT)&lt;br /&gt;
&lt;br /&gt;
=== Escaping wiki code ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;if [[ -e /proc/net/hostap ]]; then&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
showing nowiki tag for bash scripts, as I forgot where they are :)&lt;br /&gt;
--[[User:Kyle|Kyle]] Tue Jan 11 23:08:07 UTC 2005&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Adding Knoppix Section to Wikicities English Linux ===&lt;br /&gt;
&lt;br /&gt;
I'm just filling out the red link for Knoppix out at the [http://en.linux.wikicities.com/ Wikicities:Linux Wiki] (and wondering if the interwiki table on this site is hip to [[Wikicities:c:en.linux]] and [[Wikipedia:Knoppix]] links)&lt;br /&gt;
:And will someone please fix that missing search index!&lt;br /&gt;
::[[User:JimD|JimD]] 02:33, 5 Feb 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Main page Beta ===&lt;br /&gt;
&lt;br /&gt;
As the [[Main Page]] is write-protected, though it looks and works horrible , I'm now starting a '''[[Main Page Beta]]''' that everybody can edit. I hope that some of us will do, and that the wiki administrators (does they exist?) will notice our work, and import our changes to the real main page. (I've got this excellent idea from the [http://www.damnsmalllinux.org/wiki Damn Small Linux wiki] ;-D ) [[User:Qwerty|Qwerty]] 17:45, 3 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Enjoy ==&lt;br /&gt;
&lt;br /&gt;
hi&lt;br /&gt;
&lt;br /&gt;
== Spam problem ==&lt;br /&gt;
&lt;br /&gt;
Is there any way to deal with the spam?  This Wiki seems to get consistently hit.  People here are very good at manually catching it and reverting back, but automated spambots are still faster.  One of my pages, [[Bootable USB Key]], seems to be a popular target for attacks.  I wonder if captchas, or moderation, could help?&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2008-09-07T20:48:45Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added lsscsi command as additional source of drive letter info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
 lsscsi -k&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2008-09-07T20:47:33Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Removed &amp;quot;test&amp;quot; and clarified wording of U3 uninstall&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
Newer SanDisk USB keys come with a built in uninstall application.  Try that first, before trying the above solutions.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2008-07-31T23:40:07Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Undo vandalism&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is not installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
SanDisk's Cruzer has a built in uninstall application to remove its own U3 system and make it like a regular USB key.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2008-04-16T21:54:12Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Removed last edit that somehow replaced a section with gibberish&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD (or any later version)&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
However, if your USB key is 5GB or larger, you can experiment with trying to use the DVD instead of the CD.&lt;br /&gt;
&lt;br /&gt;
* 1GB or larger USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend a USB key of exactly 1GB in size.&lt;br /&gt;
&lt;br /&gt;
Smaller sizes won't hold the entire CD.&lt;br /&gt;
&lt;br /&gt;
Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
&lt;br /&gt;
* Download a Knoppix image and burn it to CD or DVD.&lt;br /&gt;
&lt;br /&gt;
* Back up all data on your USB key, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Make sure U3 is now installed on the USB key&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
SanDisk's Cruzer has a built in uninstall application to remove its own U3 system and make it like a regular USB key.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/ ./&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
This copies all files from /cdrom/boot/isolinux/ to the current directory (the rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors).  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/ ./ --exclude boot&lt;br /&gt;
&lt;br /&gt;
This should take a while -- we are filling up the USB key with the contents of the Knoppix CD. The excluded &amp;quot;boot&amp;quot; directory was already copied earlier.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key</id>
		<title>Talk:Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key"/>
				<updated>2007-10-26T18:43:10Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Answered someone's question, put link to main forums to ask help in&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi ! I tried to follow your instructions for booting from a Kingston Datatraveler 2GB U3 . I used the &amp;quot;more than 1GB tip&amp;quot; but when i try to boot the led light is on but nothing happens. should i use different number of sectors and cylinders ? Is there a way to find the correct values ?&lt;br /&gt;
&lt;br /&gt;
== Bootable USB Key ==&lt;br /&gt;
&lt;br /&gt;
I have an 8GB JetFlash from Transcend. I installed Knoppix 5.0.1 as described. I followed the recommendation for large drives when using the mkdiskimage command formatting to FAT32. This worked great for me. It boots on my Compaq Presario Laptop when selecting usb hard drive for startup drive in the bios. There is no choice for usb flash. So far I haven't been able to get the optional suggestion to work....&lt;br /&gt;
It read... On line 2, add a few more options to the end of the line.&lt;br /&gt;
noswap noeject noprompt dma home=scan...&lt;br /&gt;
I'm very new at using the terminal and I'm not sure where this command was supposed to go. I am surprised how well this procedure worked for me considering my lack of experience. The live flash drive operates the computer with great speed compared to a live cd. It felt as though I was running from the hard drive.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Answers to questions above)&lt;br /&gt;
&lt;br /&gt;
U3 = U3 is evil!  Avoid U3.  This can cause big problems when trying to boot up.  U3 does something very nonstandard: in addition to being a USB key, it fakes out an additional &amp;quot;CD-ROM drive&amp;quot; inside the USB key, that holds the U3 software.  This can confuse a BIOS when booting.  I recommend deleting U3 if possible, or choosing another USB key that does not have U3.  I personally have had at least one USB key ruined by U3.&lt;br /&gt;
&lt;br /&gt;
Number of cylinders/heads/sectors = The mkdiskimage command will calculate the number of cylinders for you,  when it is set to 0, so don't worry about that.  See the bottom of the page for alternate mkdiskimage command lines you can try, for large USB keys.  I recommend either &amp;quot;0 64 32&amp;quot; (64 heads and 32 sectors) for 1GB keys.  For keys larger than 1GB, you might want to try these: &amp;quot;0 128 32&amp;quot;, &amp;quot;0 256 32&amp;quot;, &amp;quot;0 256 63&amp;quot;, &amp;quot;0 255 32&amp;quot;, &amp;quot;0 255 63&amp;quot;.  Unfortunately I can't recommend a specific one because it's really a crapshoot with the BIOS: sometimes it works, sometimes it doesn't, and it is different on different computers!&lt;br /&gt;
&lt;br /&gt;
8GB USB keys = Good, I'm glad the alternate mkdiskimage command worked for you.  I do not have access to such large keys to try myself.&lt;br /&gt;
&lt;br /&gt;
The options to the end of the line = By this, I meant to use a text editor and edit the file with it.  You don't actually type the options directly at the terminal.  In Knoppix, click on the &amp;quot;K&amp;quot; menu, then choose &amp;quot;Editors&amp;quot; from the big list, and choose your favorite text editor.  I recommend &amp;quot;NEdit&amp;quot;, as it is easy to use and doesn't add any formatting to the file.  It is essential that you leave the file as plain text, without forwarding, so be sure to use a simple editor and not a full-featured word processor (this will ruin the file).  The &amp;quot;NEdit&amp;quot; text editor should be safe to use.  Save the file and exit the text editor when done.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 09:04, 28 Dec 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
I have the same problem as above. I followed the directions on the main site exactly for useing knoppix on my sandisk 2gb (cruzer) stick and everything works fine. The stick will boot the non-moded mod just great. The problem comes when I attempt to modify the knoppix boot menu using the &amp;quot;optional&amp;quot; steps. I do the do the &amp;quot;Make usb writeable&amp;quot; step everything appears to work. It also appears to save the changes to the /media/sdb4/syslinux.cfg file (eg the adding of noswap, noeject, noprompt and dma to the second line). However, once I reboot somthing strange happens. Apperntly the device can no longer be detected as a bootable device, and boots up into windows instead. Not only that but windows cant even read or detect it any longer. To rectify this, I must start over and reformat the entire stick in knoppix again (using mkdiskimage 0 64 62 , btw). I've used the tool sandisk provide to remove U3 and the disk has been formated many times over, so that shouldnt be a problem. I am also using vi to edit the config file so that shouldnt do anything...I think the problem is deeper, like perhaps the way you are having people mount the usb key so it can be written to? I didnt see that the CD rom was mounted at all when I booted into knoppix from the stick..it seemed to recognize it was booting from the stick.I dont know. Anways,mabey I am just screwing up the config file as well. If you could perhaps post what your looks like, it might be helpfull.&lt;br /&gt;
&lt;br /&gt;
So any suggestions?&lt;br /&gt;
&lt;br /&gt;
--[[User:kryptofox|kryptofox]] 02:01, 25 Jan 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
That's a weird one.  Maybe there is something wrong with making the &amp;quot;CD&amp;quot; writeable inside of Knoppix.  I don't think so, though, and I've never had a problem as bad as that, where it completely fails to boot up afterwards.&lt;br /&gt;
&lt;br /&gt;
Make sure you can boot up repeatedly, 2 or 3 times in a row.  Some BIOS's are weird about only letting you boot into USB once, from a cold start.  If you do a warm boot, they won't see the USB stick at all.  Mine is that way, and it's a pain.  I have to turn the computer completely off and on.  So, it might not be the fault of Knoppix at all, if you can't boot into Knoppix more than once.&lt;br /&gt;
&lt;br /&gt;
Also, please post questions like this into the main forums here:&lt;br /&gt;
&lt;br /&gt;
http://www.knoppix.net/forum/viewforum.php?f=9&lt;br /&gt;
&lt;br /&gt;
That way, everybody will be able to see them, and hopefully respond sooner.  Not many people check this &amp;quot;Talk:&amp;quot; page here, unfortunately.  This isn't Wikipedia :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 18:43, 26 Oct 2007 (UTC)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2007-10-23T09:25:50Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Recommend rsync instead of cp, add note about syslinux -s, add note about dd with count&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD (or any later version)&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
However, if your USB key is 5GB or larger, you can experiment with trying to use the DVD instead of the CD.&lt;br /&gt;
&lt;br /&gt;
* 1GB or larger USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend a USB key of exactly 1GB in size.&lt;br /&gt;
&lt;br /&gt;
Smaller sizes won't hold the entire CD.&lt;br /&gt;
&lt;br /&gt;
Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
; Note: If you're repeating your installation and have already zeroed your USB key at least once, then you can add ''count=1k'' to the line below.  It becomes ''dd if=/dev/zero of=/dev/sdz count=1k'' which will just zero out the first few sectors of your USB key.  This avoids wear and tear on your USB key, but still writes to enough sectors to clean out any existing formatting on your USB key.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility, although if you want your USB key to boot a little faster, you can omit the -s option.  Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /dev/sdz4 /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Although Knoppix should have autodetected the new partition and set up a fstab entry for it, Knoppix's fstab options are incorrect.  So, by giving both the device and the mountpoint directory on the command line, we mount it manually, with no options. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the rsync command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
The rsync command is an improvement over the cp command for handling large amounts of files, as it is better at handling errors.  Ignore any warnings about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of the rsync command.&lt;br /&gt;
&lt;br /&gt;
 rsync -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2007-10-18T10:55:47Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added workaround for udev failure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD (or any later version)&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
However, if your USB key is 5GB or larger, you can experiment with trying to use the DVD instead of the CD.&lt;br /&gt;
&lt;br /&gt;
* 1GB or larger USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend a USB key of exactly 1GB in size.&lt;br /&gt;
&lt;br /&gt;
Smaller sizes won't hold the entire CD.&lt;br /&gt;
&lt;br /&gt;
Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
When running Knoppix 5.1.1, and booting from your USB key, sometimes udev hardware detection will fail, or lock up entirely.  This is strange, and I don't know why this happens.  This doesn't happen when booting from the original CD.&lt;br /&gt;
&lt;br /&gt;
The workaround is to use the &amp;quot;noudev&amp;quot; cheatcode.  However, when using this cheatcode, fewer of your peripherals will be detected correctly.  It's better than having the system lock up, though.  If this cheatcode is necessary for you, consider editing it into your ''syslinux.cfg'' file as described above, so that you won't need to enter it every time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 10:55, 18 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2007-10-18T10:47:43Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added comment about cp overwrite, cleaned up a spammer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD (or any later version)&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
However, if your USB key is 5GB or larger, you can experiment with trying to use the DVD instead of the CD.&lt;br /&gt;
&lt;br /&gt;
* 1GB or larger USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend a USB key of exactly 1GB in size.&lt;br /&gt;
&lt;br /&gt;
Smaller sizes won't hold the entire CD.&lt;br /&gt;
&lt;br /&gt;
Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
 fdisk -l&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
; Note : If your USB stick is FAT-formatted and has enough free capacity, you can skip the following repartitioning phase and jump to installing SYSLINUX section. Just make sure your stick's partition has it's boot flag activated so the boot loader works properly. This can be done with the command fdisk /dev/sdz and subsequent commands (example: a 1 p w )&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
If, during the copy, it asks if you want to overwrite the files ''cdrom.ico'' and ''index.html'', say Yes.  This message appears because in later Knoppix versions, these files were doubled-up on the Knoppix CD (possibly a bug).&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Enable &amp;quot;USB Keyboard and Legacy Support&amp;quot; if it is disabled.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is an another project based on PortableApps, with the addition of [http://tor.eff.org/ TOR-networking] enabled by default. This makes it possible to anonymize web surfing at the cost of speed.&lt;br /&gt;
&lt;br /&gt;
More info at http://www.democrakey.com/&lt;br /&gt;
&lt;br /&gt;
--[[User:Neva|Neva]] 18:54, 20 Jun 2007 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type:&lt;br /&gt;
&amp;lt;code&amp;gt;hdparm /dev/sd?&amp;lt;/code&amp;gt;&lt;br /&gt;
Where '?' is the drive letter. It will output the &amp;quot;Geometry: x/y/z&amp;quot; where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.&lt;br /&gt;
&lt;br /&gt;
--[[User:Geekner|Geekner]] 18:53, 7 Oct 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2007-02-27T08:00:02Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Expanded mkdiskimage for keys larger than 1GB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD (or any later version)&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
However, if your USB key is 5GB or larger, you can experiment with trying to use the DVD instead of the CD.&lt;br /&gt;
&lt;br /&gt;
* 1GB or larger USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend a USB key of exactly 1GB in size.&lt;br /&gt;
&lt;br /&gt;
Smaller sizes won't hold the entire CD.&lt;br /&gt;
&lt;br /&gt;
Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software ([http://www.digg.com/security/U3_USB_Flash_Drives_install_junk_on_any_Windows_PC_you_plug_into badware]?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
The U3 removal software searches for a valid U3 installation before removing it!  There seems to be no way to just wipe U3 cleanly away, unfortunately.  You have to infect your computer with U3, in order to use their software to clean your USB key.  About the only workaround for this Catch-22 situation is to avoid purchasing a USB key with U3 in the first place.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 (or any later version) from CD, and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
Choose ''only one'' of these sections to try, based on the size of your USB key.&lt;br /&gt;
&lt;br /&gt;
If your USB key is exactly 1GB in size:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
Here are some alternatives you can try, for larger USB keys.  If the above command worked for your USB key, then you do not need to try these!  Simply proceed to the SYSLINUX step below.&lt;br /&gt;
&lt;br /&gt;
If your USB key is 2GB or less in size, but larger than 1GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 128 32&lt;br /&gt;
&lt;br /&gt;
If your USB key is 8GB or less in size, but larger than 2GB:&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
If your USB key is larger than 8GB in size (see cautions below):&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 1 255 63&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64&lt;br /&gt;
 echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz&lt;br /&gt;
 mkdosfs /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
The final section above, for keys larger than 8GB, is rather tricky.  The mkdiskimage script can't handle partitions larger than 8GB, so I have to hack around it a bit.  What we are doing here is making a dummy partition of only 1MB(!) in size, so that mkdiskimage can prepare the MBR properly.  Then, we manually delete that partition, by doing some surgery in the partition table.  We then use sfdisk to re-create the partition properly, using the full size of your USB key as FAT32, and finally format it with mkdosfs.&lt;br /&gt;
&lt;br /&gt;
Please be very careful typing in the command(s) in your section above.  If using the final section for keys larger than 8GB, the 0's in the echo command above are zeroes, not the letter O, and please be sure to use single quotes instead of double quotes.  This should work for all USB storage devices, up to 2TB in size.  I tested this using a 320GB USB hard drive, and it worked.  Beyond 2TB, you're on your own....&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big partition, either FAT16 or FAT32. Even though I prefer FAT32, I'm still recommending FAT16 for smaller keys, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
* Close KDE's popup window.&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition.&lt;br /&gt;
If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage command is very sensitive to the size of your USB key.  I have included several variations to try, in the above article.  Here are some more alternatives, for completeness.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your [http://mydatapages.com/usb_key.html USB] key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-12-29T08:48:56Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added note about PortableApps wanting to overwrite a file&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software (badware?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
''Caution about USB keys larger than 1GB: This mkdiskimage command might not work.  If you get an error, then see the bottom of this page for alternate mkdiskimage commands that you can try.''&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
When installing PortableApps to a USB key that already has Knoppix on it, PortableApps will complain about overwriting the autorun.inf file.  This is fine.  Say Yes to the overwrite.  This will allow the USB key to bring up the PortableApps menu, instead of the Knoppix homepage, when clicking on it from within Windows.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-12-29T08:43:09Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Cleaned up links from a spammer, and expanded PortableApps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software (badware?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
''Caution about USB keys larger than 1GB: This mkdiskimage command might not work.  If you get an error, then see the bottom of this page for alternate mkdiskimage commands that you can try.''&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: &lt;br /&gt;
&lt;br /&gt;
http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
With a 1GB key formatted as FAT16, as per the above instructions, there is, unfortunately, just barely not enough room for both Knoppix and the full PortableApps suite to coexist.  The workaround is to &amp;quot;install&amp;quot; PortableApps to a spare empty folder on your hard drive first.  Make edits to that folder as necessary, deleting some apps you can live without.  Then, copy the entire folder manually to your USB key from there.&lt;br /&gt;
&lt;br /&gt;
Formatting as FAT32 will work, as FAT32 is more efficient at cramming in the thousands of small files PortableApps creates.  A larger USB key will provide much more room for both Knoppix and PortableApps, and enough extra left over for a decently-sized Knoppix home directory as well.  See above for alternate mkdiskimage command lines you can try, when formatting larger USB keys or using FAT32.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key</id>
		<title>Talk:Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key"/>
				<updated>2006-12-28T09:12:41Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Answering a question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi ! I tried to follow your instructions for booting from a Kingston Datatraveler 2GB U3 . I used the &amp;quot;more than 1GB tip&amp;quot; but when i try to boot the led light is on but nothing happens. should i use different number of sectors and cylinders ? Is there a way to find the correct values ?&lt;br /&gt;
&lt;br /&gt;
== Bootable USB Key ==&lt;br /&gt;
&lt;br /&gt;
I have an 8GB JetFlash from Transcend. I installed Knoppix 5.0.1 as described. I followed the recommendation for large drives when using the mkdiskimage command formatting to FAT32. This worked great for me. It boots on my Compaq Presario Laptop when selecting usb hard drive for startup drive in the bios. There is no choice for usb flash. So far I haven't been able to get the optional suggestion to work....&lt;br /&gt;
It read... On line 2, add a few more options to the end of the line.&lt;br /&gt;
noswap noeject noprompt dma home=scan...&lt;br /&gt;
I'm very new at using the terminal and I'm not sure where this command was supposed to go. I am surprised how well this procedure worked for me considering my lack of experience. The live flash drive operates the computer with great speed compared to a live cd. It felt as though I was running from the hard drive.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Answers to questions above)&lt;br /&gt;
&lt;br /&gt;
U3 = U3 is evil!  Avoid U3.  This can cause big problems when trying to boot up.  U3 does something very nonstandard: in addition to being a USB key, it fakes out an additional &amp;quot;CD-ROM drive&amp;quot; inside the USB key, that holds the U3 software.  This can confuse a BIOS when booting.  I recommend deleting U3 if possible, or choosing another USB key that does not have U3.  I personally have had at least one USB key ruined by U3.&lt;br /&gt;
&lt;br /&gt;
Number of cylinders/heads/sectors = The mkdiskimage command will calculate the number of cylinders for you,  when it is set to 0, so don't worry about that.  See the bottom of the page for alternate mkdiskimage command lines you can try, for large USB keys.  I recommend either &amp;quot;0 64 32&amp;quot; (64 heads and 32 sectors) for 1GB keys.  For keys larger than 1GB, you might want to try these: &amp;quot;0 128 32&amp;quot;, &amp;quot;0 256 32&amp;quot;, &amp;quot;0 256 63&amp;quot;, &amp;quot;0 255 32&amp;quot;, &amp;quot;0 255 63&amp;quot;.  Unfortunately I can't recommend a specific one because it's really a crapshoot with the BIOS: sometimes it works, sometimes it doesn't, and it is different on different computers!&lt;br /&gt;
&lt;br /&gt;
8GB USB keys = Good, I'm glad the alternate mkdiskimage command worked for you.  I do not have access to such large keys to try myself.&lt;br /&gt;
&lt;br /&gt;
The options to the end of the line = By this, I meant to use a text editor and edit the file with it.  You don't actually type the options directly at the terminal.  In Knoppix, click on the &amp;quot;K&amp;quot; menu, then choose &amp;quot;Editors&amp;quot; from the big list, and choose your favorite text editor.  I recommend &amp;quot;NEdit&amp;quot;, as it is easy to use and doesn't add any formatting to the file.  It is essential that you leave the file as plain text, without forwarding, so be sure to use a simple editor and not a full-featured word processor (this will ruin the file).  The &amp;quot;NEdit&amp;quot; text editor should be safe to use.  Save the file and exit the text editor when done.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 09:04, 28 Dec 2006 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key</id>
		<title>Talk:Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:Bootable_USB_Key"/>
				<updated>2006-12-28T09:04:09Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Answering a question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi ! I tried to follow your instructions for booting from a Kingston Datatraveler 2GB U3 . I used the &amp;quot;more than 1GB tip&amp;quot; but when i try to boot the led light is on but nothing happens. should i use different number of sectors and cylinders ? Is there a way to find the correct values ?&lt;br /&gt;
&lt;br /&gt;
== Bootable USB Key ==&lt;br /&gt;
&lt;br /&gt;
I have an 8GB JetFlash from Transcend. I installed Knoppix 5.0.1 as described. I followed the recommendation for large drives when using the mkdiskimage command formatting to FAT32. This worked great for me. It boots on my Compaq Presario Laptop when selecting usb hard drive for startup drive in the bios. There is no choice for usb flash. So far I haven't been able to get the optional suggestion to work....&lt;br /&gt;
It read... On line 2, add a few more options to the end of the line.&lt;br /&gt;
noswap noeject noprompt dma home=scan...&lt;br /&gt;
I'm very new at using the terminal and I'm not sure where this command was supposed to go. I am surprised how well this procedure worked for me considering my lack of experience. The live flash drive operates the computer with great speed compared to a live cd. It felt as though I was running from the hard drive.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Answers to questions above)&lt;br /&gt;
&lt;br /&gt;
Large 8GB USB keys = Good, I'm glad the alternate mkdiskimage command worked for you.  I do not have access to such large keys to try myself.&lt;br /&gt;
&lt;br /&gt;
The options to the end of the line = By this, I meant to use a text editor and edit the file with it.  You don't actually type the options directly at the terminal.  In Knoppix, click on the &amp;quot;K&amp;quot; menu, then choose &amp;quot;Editors&amp;quot; from the big list, and choose your favorite text editor.  I recommend &amp;quot;NEdit&amp;quot;, as it is easy to use and doesn't add any formatting to the file.  It is essential that you leave the file as plain text, without forwarding, so be sure to use a simple editor and not a full-featured word processor (this will ruin the file).  The &amp;quot;NEdit&amp;quot; text editor should be safe to use.  Save the file and exit the text editor when done.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 09:04, 28 Dec 2006 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-12-19T11:16:46Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added SanDisk U3 uninstaller as well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a [http://mydatapages.com/usb_key.html USB] key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software (malware?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
Find a Windows machine, and try these programs to uninstall U3.  Unfortunately, they are a bit flaky.  If one does not work, try the other:&lt;br /&gt;
&lt;br /&gt;
http://www.sandisk.com/Assets/u3/launchpadremoval.exe&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the U3 vendors are secretive, so there's no way to manipulate it from Linux.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
''Caution about USB keys larger than 1GB: This mkdiskimage command might not work.  If you get an error, then see the bottom of this page for alternate mkdiskimage commands that you can try.''&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the [http://mydatapages.com/syslinux.html SYSLINUX] installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
With a 1GB key, there is just barely enough room for both Knoppix and PortableApps to coexist.  A larger USB key will provide plenty of room, and enough extra left over for a decently-sized Knoppix home directory as well.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-12-19T09:41:04Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added warning about U3 and link to U3 uninstaller&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key, U3-free&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
Unfortunately, many newer USB keys come with &amp;quot;U3&amp;quot; Windows software (malware?) preinstalled.  Removing U3 is highly recommended, and will free up additional space on your USB key, as well as eliminate a source of potential conflicts.&lt;br /&gt;
&lt;br /&gt;
http://www.u3.com/uninstall/final.aspx&lt;br /&gt;
&lt;br /&gt;
To my knowledge, U3 has not yet been reverse-engineered, and the vendor is secretive, so there's no way to manipulate it from Linux.  Fortunately, the vendor provides this uninstallation program, which seems to work, but must be ran under Windows.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
''Caution about USB keys larger than 1GB: This mkdiskimage command might not work.  If you get an error, then see the bottom of this page for alternate mkdiskimage commands that you can try.''&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.  Much better and cleaner than U3!&lt;br /&gt;
&lt;br /&gt;
With a 1GB key, there is just barely enough room for both Knoppix and PortableApps to coexist.  A larger USB key will provide plenty of room, and enough extra left over for a decently-sized Knoppix home directory as well.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to use this guide to setup and boot from Knoppix on a Creative Zen Vision:M MP3 player. Details here: http://www.francisshanahan.com/detail.aspx?cid=509&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-11-27T19:38:19Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Fixed PortableApps size requirement to 260MB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  Also, if you have a large USB key with roughly 260MB of free space or more, and need to also work under Windows, you can install PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 260MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.&lt;br /&gt;
&lt;br /&gt;
With a 1GB key, there is just barely enough room for both Knoppix and PortableApps to coexist.  A larger USB key will provide plenty of room, and enough extra left over for a decently-sized Knoppix home directory as well.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-11-27T19:23:40Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: Added PortableApps mention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.  I recommend a minimum of 100MB free space, for PortableApps (see below).&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==PortableApps==&lt;br /&gt;
&lt;br /&gt;
Here's also something great I found.  If you have roughly 100MB or more of free space remaining on your USB key, you might want to drop PortableApps on there.&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/suite&lt;br /&gt;
&lt;br /&gt;
http://portableapps.com/&lt;br /&gt;
&lt;br /&gt;
This is a suite of freeware Windows utilities, and will help you if you need to do work within Windows without being able to reboot into Knoppix.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 19:23, 27 Nov 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-10-19T20:30:05Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
==Large USB keys==&lt;br /&gt;
&lt;br /&gt;
For USB keys over 1GB in size, you might want to try alternate command lines for the mkdiskimage command above.&lt;br /&gt;
&lt;br /&gt;
Here are some recommendations.  These are untested, as the USB key I currently own is only 1GB in size.  Feel free to post results here.&lt;br /&gt;
&lt;br /&gt;
These will break USB-ZIP compatibility, as it is a USB-ZIP requirement to have 64 heads and 32 sectors.  Unfortunately, there is no other way, as a valid cylinder count (less than 1024) is also a requirement.  So, try USB-HDD instead of USB-ZIP.  The tradeoff is that it won't be as compatible with as many BIOS's as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
This will allow you to partition a USB key up to 8GB in size.  You probably could also use 256 heads instead of 255, for a little more space, but 255 heads is recommended, as it's slightly more compatible.&lt;br /&gt;
&lt;br /&gt;
You may then run into the 2GB limit of the FAT16 partition.  Beyond 2GB, it is probably best to use FAT32 instead.  Supply the -F option to mkdiskimage.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -F -4 /dev/sdz 0 255 63&lt;br /&gt;
&lt;br /&gt;
At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
However, it did not work on as many BIOS's, so I now recommend FAT16, unless you have a USB key that is larger than the 2GB limit of FAT16.&lt;br /&gt;
&lt;br /&gt;
The other instructions on the page above should still be valid.  Only the mkdiskimage command line needs to be changed, for use with large keys.&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 20:30, 19 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
mkdiskimage won't set up a 2 gb USB device with the USB-ZIP format using the example given. According to other FAQ's this is an issue with too many cylinders. A 1 gb drive is supposed to work fine. You may be able to manually create two drives on the device and manually format it in order to set it up as USB-ZIP.&lt;br /&gt;
&lt;br /&gt;
Depending on the USB device, you can use fdisk to figure out the cylinders, heads and sectors and get mkdiskimage to work with these values. The one I used had 1015 cylinders, 64 heads and 62 sectors per track -- these values worked fine and I was able to create a bootable Knoppix USB key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/USB_Based_FAQ</id>
		<title>USB Based FAQ</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/USB_Based_FAQ"/>
				<updated>2006-10-14T20:45:18Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==KNOPPIX USB==&lt;br /&gt;
&lt;br /&gt;
Knoppix is a GNU/Linux distribution that boots and runs completely from cd it can also boot and run completely from a USB drive.&lt;br /&gt;
&lt;br /&gt;
 Edit from Krellan on 14 Oct 2006:&lt;br /&gt;
 I have tested and came up with an alternate &amp;quot;recipe&amp;quot; for creating a&lt;br /&gt;
 Knoppix-based bootable USB key:&lt;br /&gt;
 http://www.knoppix.net/wiki/Bootable_USB_Key&lt;br /&gt;
 These instructions are for use under the Knoppix 5.0.1 CD, and don't require&lt;br /&gt;
 the HP Windows XP USB formatter tool.  It doesn't use GRUB.  Instead,&lt;br /&gt;
 it boots with the same title screen Knoppix already uses for the CD,&lt;br /&gt;
 so all &amp;quot;cheat codes&amp;quot; will continue to work.  Remaining space on the USB&lt;br /&gt;
 key can still be seen by Windows if necessary, and/or a Knoppix persistent&lt;br /&gt;
 encrypted home directory can be created in that space.  I recommend trying&lt;br /&gt;
 this &amp;quot;recipe&amp;quot;, as it has worked quite well for me and others.&lt;br /&gt;
 --[[User:Krellan|Krellan]] 20:45, 14 Oct 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
 Edit from Ruymbeke on March 23rd 2006:&lt;br /&gt;
 A lot of, if not most of the USB dongles are not bootable by default.&lt;br /&gt;
 You may want to use the HPUSBFW.EXE tool (XP only) to make it bootable&lt;br /&gt;
 by changing the geometry of the device and perform a low level (re-)format.&lt;br /&gt;
 It may reduce slightly the overall size of the drive (to make it bootable)&lt;br /&gt;
 but I have run it successfuly on all my USB dongles: pqi, lexar, corsair, ...&lt;br /&gt;
 You will find this tool and an alternate method for booting Knoppix 4.02&lt;br /&gt;
 from a USB dongle using grub.exe or loadlin.exe from a dos boot in here:&lt;br /&gt;
 http://www.knoppix.net/forum/viewtopic.php?p=93758#93758&lt;br /&gt;
 http://www.knoppix.net/forum/viewtopic.php?p=101293#101293 (Knoppix 5.0 addon)&lt;br /&gt;
&lt;br /&gt;
  Edit from mswoon on 14 Apr 2006: &lt;br /&gt;
  &lt;br /&gt;
  I didn't have to do the above - just add &lt;br /&gt;
  &lt;br /&gt;
  test -n &amp;quot;$FOUND_USB&amp;quot; -a -z &amp;quot;$NOUSB&amp;quot; &amp;amp;&amp;amp; DEVICES=&amp;quot;$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]&amp;quot; &lt;br /&gt;
  &lt;br /&gt;
  at the right place in linuxrc as documented in &lt;br /&gt;
  &lt;br /&gt;
  http://www.knoppix.net/forum/viewtopic.php?p=64999&lt;br /&gt;
  &lt;br /&gt;
  and it worked on a 2GByte Memorex with no problem. &lt;br /&gt;
  &lt;br /&gt;
  Not that I don't trust you, but can you release the source code for that XP-only software?&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Create a file system on the partition.&lt;br /&gt;
You can use an existing VFAT filesystem (to keep compatibility with Windows/DOS). &lt;br /&gt;
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 &amp;quot;file ...boot/grub/stage1 not read correctly&amp;quot;.)  Assuming you settle on an ext3 filesystem:&lt;br /&gt;
&lt;br /&gt;
 # mke2fs -j /dev/sda1&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To prevent fsck from being run on it:&lt;br /&gt;
&lt;br /&gt;
 # tune2fs -c 0 -i 0 /dev/sda1&lt;br /&gt;
&lt;br /&gt;
Mount the partition and copy the contents of the KNOPPIX ISO image (named KNOPPIX.iso below) to it:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/sda1 /mnt&lt;br /&gt;
 # losetup /dev/loop0 KNOPPIX.iso&lt;br /&gt;
 # mkdir knoppix&lt;br /&gt;
 # mount /dev/loop0 knoppix&lt;br /&gt;
 # cp -r knoppix/* /mnt&lt;br /&gt;
 # sync&lt;br /&gt;
 # umount knoppix&lt;br /&gt;
 # rmdir knoppix&lt;br /&gt;
 # losetup -d /dev/loop0&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 # mkdir -p /mnt/boot/grub&lt;br /&gt;
 # cp -r /boot/grub/* /mnt/boot/grub&lt;br /&gt;
&lt;br /&gt;
(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.)&lt;br /&gt;
To install the stage1 boot loader to the drive's master boot record (MBR), edit the device.map file to tell grub-install that /dev/sda1 is a bios drive:&lt;br /&gt;
&lt;br /&gt;
 # echo '(hd0) /dev/sda' &amp;gt; /mnt/boot/grub/device.map&lt;br /&gt;
&lt;br /&gt;
and then install Grub to /dev/sda:&lt;br /&gt;
&lt;br /&gt;
 # grub-install --root-directory=/mnt --no-floppy '(hd0)'&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 DEFAULT linux&lt;br /&gt;
 APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce quiet BOOT_IMAGE=knoppix&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 title           Knoppix&lt;br /&gt;
 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&lt;br /&gt;
 initrd          /boot/isolinux/minirt.gz&lt;br /&gt;
 boot&lt;br /&gt;
&lt;br /&gt;
Add the above to /mnt/boot/grub/menu.lst. Add the following lines to the beginning of the file to have Knoppix boot automatically:&lt;br /&gt;
&lt;br /&gt;
 default         0&lt;br /&gt;
 timeout         2&lt;br /&gt;
&lt;br /&gt;
Finally, unmount the partition.&lt;br /&gt;
&lt;br /&gt;
 # umount /mnt&lt;br /&gt;
&lt;br /&gt;
You should now be booting Knoppix from your USB drive.&lt;br /&gt;
&lt;br /&gt;
==Booting to an Image on an Alternative Device==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
What you will need:&lt;br /&gt;
&lt;br /&gt;
* Computer with [http://www.wikipedia.org/wiki/BIOS 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).&lt;br /&gt;
* 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 http://arstechnica.com/reviews/hardware/flash2005.ars .  Only 3 of 10 reviewed sticks are bootable.)&lt;br /&gt;
* Linux with [http://en.wikipedia.org/wiki/GRUB GRUB] grub boot loader already installed. I just use Knoppix.&lt;br /&gt;
* Read [[Win Partition]] Poor Man Installation for the more versatile boot mechanism we gonna utilize here.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
(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 [http://www.knoppix.net/forum/viewtopic.php?p=64999#64999 link] above)&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Mount the partition and install grub boot loader on this device ( mount /dev/sda1 /mnt/usb &amp;amp;&amp;amp; 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.&lt;br /&gt;
# 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 [http://s94002264.onlinehome.us/grub/grube.zip Ruymbeke's files].&lt;br /&gt;
# Create a file ''menu.lst'' under dir ''/mnt/usb/boot/grub'', I just copied the one from [http://s94002264.onlinehome.us/grub/grube.zip 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.&lt;br /&gt;
&lt;br /&gt;
DONE.&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:USB_Based_FAQ</id>
		<title>Talk:USB Based FAQ</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:USB_Based_FAQ"/>
				<updated>2006-09-18T01:27:54Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ==&lt;br /&gt;
&lt;br /&gt;
Hello!  After discussion in the forums, I made a new Wiki page about installing Knoppix on a USB key and making it bootable.&lt;br /&gt;
&lt;br /&gt;
http://www.knoppix.net/wiki/Bootable_USB_Key&lt;br /&gt;
&lt;br /&gt;
If this new page looks good to you, is it OK to link it in from this page, so that others will have an easier time finding it?&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 01:26, 18 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&lt;br /&gt;
Great instructions here but I wouldn't call this a FAQ.  More like 'Boot from USB Key Howto'.&lt;br /&gt;
&lt;br /&gt;
== 3.9 ==&lt;br /&gt;
&lt;br /&gt;
Most of these instructions appear to be dated - my install of 3.9 (home= problems notwithstanding) was much simpler, but did require up-to-date versions of install-mbr (1.1.8) and syslinux (3.0.8). I have a writeup, but need to flesh it out before changing this page. Also, the anonymous poster above is right - this is more of a HOWTO, rather than a FAQ, at least in its current form. --[[User:NightMonkey|NightMonkey]] 09:23, 24 Jun 2005 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Talk:USB_Based_FAQ</id>
		<title>Talk:USB Based FAQ</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Talk:USB_Based_FAQ"/>
				<updated>2006-09-18T01:26:36Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: /* 3.9 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Great instructions here but I wouldn't call this a FAQ.  More like 'Boot from USB Key Howto'.&lt;br /&gt;
&lt;br /&gt;
Hello!  After discussion in the forums, I made a new Wiki page about installing Knoppix on a USB key and making it bootable.&lt;br /&gt;
&lt;br /&gt;
http://www.knoppix.net/wiki/Bootable_USB_Key&lt;br /&gt;
&lt;br /&gt;
If this new page looks good to you, is it OK to link it in from this page, so that others will have an easier time finding it?&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 01:26, 18 Sep 2006 (GMT)&lt;br /&gt;
&lt;br /&gt;
== 3.9 ==&lt;br /&gt;
&lt;br /&gt;
Most of these instructions appear to be dated - my install of 3.9 (home= problems notwithstanding) was much simpler, but did require up-to-date versions of install-mbr (1.1.8) and syslinux (3.0.8). I have a writeup, but need to flesh it out before changing this page. Also, the anonymous poster above is right - this is more of a HOWTO, rather than a FAQ, at least in its current form. --[[User:NightMonkey|NightMonkey]] 09:23, 24 Jun 2005 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/User:Krellan</id>
		<title>User:Krellan</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/User:Krellan"/>
				<updated>2006-09-10T00:56:47Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey, it's [http://krellan.com/ me]....&lt;br /&gt;
&lt;br /&gt;
I'm Krellan2 on the forums here (not Krellan, there was some glitch during registration and I had to create a second account).&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-09-10T00:51:50Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ''ldlinux.sys''&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
# Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
# Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
# Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
# Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
# If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
 noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
; noswap : Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
; noeject : You can't physically eject a USB key.&lt;br /&gt;
; noprompt : Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
; dma : Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
; home=scan : This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
==You're done!==&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-09-10T00:43:14Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
== Ingredients&lt;br /&gt;
&lt;br /&gt;
* Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
* 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
== Instructions&lt;br /&gt;
&lt;br /&gt;
* Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ldlinux.sys&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
** Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
** Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
** Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
** Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
** If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
** noswap = Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
** noeject = You can't physically eject a USB key.&lt;br /&gt;
** noprompt = Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
** dma = Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
** home=scan = This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
== You're done!&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
--[[User:Krellan|Krellan]] 00:43, 10 Sep 2006 (GMT)&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	<entry>
		<id>https://mail.knoppix.net/wiki/Bootable_USB_Key</id>
		<title>Bootable USB Key</title>
		<link rel="alternate" type="text/html" href="https://mail.knoppix.net/wiki/Bootable_USB_Key"/>
				<updated>2006-09-10T00:40:19Z</updated>
		
		<summary type="html">&lt;p&gt;Krellan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Knoppix 5.0.1 boots rather nicely from a USB key. It's getting easier to get it working, as the USB bugs from the previous versions have been fixed.&lt;br /&gt;
&lt;br /&gt;
This is a &amp;quot;recipe&amp;quot; for creating a Knoppix bootable USB key.  It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402&lt;br /&gt;
&lt;br /&gt;
* Ingredients:&lt;br /&gt;
&lt;br /&gt;
** Knoppix 5.0.1 CD&lt;br /&gt;
&lt;br /&gt;
It must be the CD.  The DVD is much too large.&lt;br /&gt;
&lt;br /&gt;
** 1GB USB key&lt;br /&gt;
&lt;br /&gt;
I recommend 1GB.  Smaller sizes won't hold the entire CD.  Larger sizes may have trouble booting on older BIOS's (see below about USB-ZIP).&lt;br /&gt;
&lt;br /&gt;
Back up all data on your USB key first, because we will be erasing and reformatting it!&lt;br /&gt;
&lt;br /&gt;
* Instructions:&lt;br /&gt;
&lt;br /&gt;
** Boot Knoppix 5.0.1 from CD and make sure that it works.&lt;br /&gt;
&lt;br /&gt;
As soon as the title screen of Knoppix appears (the cheatcode entry screen), put in the USB key.&lt;br /&gt;
&lt;br /&gt;
Do this before Knoppix starts to load, so that your USB key is sure to be found by Knoppix's autodetection.&lt;br /&gt;
&lt;br /&gt;
Do not use the &amp;quot;toram&amp;quot; cheatcode when booting Knoppix. The RAM copy of the CD omits the /boot directory, but we require this directory, so we can't use the RAM copy.&lt;br /&gt;
&lt;br /&gt;
* Once Knoppix is up and running, open a root shell (from the penguin icon).&lt;br /&gt;
&lt;br /&gt;
Now, we need to find the drive letter of your USB key. It will be something like /dev/sda, /dev/sdb, /dev/sdc, and so on. Be very careful and make absolutely sure you have the drive letter correct, because you will be erasing the USB key, and you don't want to erase your hard drive by mistake!&lt;br /&gt;
&lt;br /&gt;
Examples of possible commands to try:&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i scsi&lt;br /&gt;
&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
&lt;br /&gt;
 cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
Look at the sizes of the various drives you see here. Find your USB key, and do not get it confused with your hard drive! For the rest of this example, I'm going to be using ''/dev/sdz'', a fictional drive letter that nobody has, just to prevent bad mistakes from typing in commands blindly.&lt;br /&gt;
&lt;br /&gt;
* Erase your entire USB key.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=/dev/sdz&lt;br /&gt;
&lt;br /&gt;
Did you use the right drive letter? ''Did you?'' If not, you'll be crying, right about now....&lt;br /&gt;
&lt;br /&gt;
This command will take a while to finish. By writing to every block on the USB key, we are also testing it for bad blocks.&lt;br /&gt;
&lt;br /&gt;
You should get the &amp;quot;no space left on device&amp;quot; error message when it finishes erasing and reaches the end of the drive. Any other error messages might mean bad blocks: if you notice any, your key might be worn out and you'll need to buy another one (cheap keys are notorious for wearing out very quickly).&lt;br /&gt;
&lt;br /&gt;
* Run the mkdiskimage script, to automatically partition and format your USB key.&lt;br /&gt;
&lt;br /&gt;
 mkdiskimage -4 /dev/sdz 0 64 32&lt;br /&gt;
&lt;br /&gt;
This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT16 partition. Even though I prefer FAT32, I'm recommending FAT16 here, for increased compatibility with some strange BIOS's.&lt;br /&gt;
&lt;br /&gt;
The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. It's nice that Knoppix now includes this script by default. Here's the webpage for mkdiskimage, for additional reference: http://syslinux.zytor.com/usbkey.php&lt;br /&gt;
&lt;br /&gt;
KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.&lt;br /&gt;
&lt;br /&gt;
* Run the SYSLINUX installer on your new partition.&lt;br /&gt;
&lt;br /&gt;
 syslinux -s /dev/sdz4&lt;br /&gt;
&lt;br /&gt;
This installs the SYSLINUX bootloader onto the newly-created partition, and includes a special file, ldlinux.sys. The -s option is for safety and additional compatibility. Notice the partition is the fourth partition on the drive, not the first. This is for USB-ZIP compliance.&lt;br /&gt;
&lt;br /&gt;
* Mount your new partition.&lt;br /&gt;
&lt;br /&gt;
 mount /media/sdz4&lt;br /&gt;
&lt;br /&gt;
Knoppix should have autodetected the new partition and set up a fstab entry for it. The /media/sdz4 directory should now correspond to the /dev/sdz4 partition.&lt;br /&gt;
&lt;br /&gt;
 cd /media/sdz4&lt;br /&gt;
 ls&lt;br /&gt;
&lt;br /&gt;
You should notice one, and only one, file in this directory now: ldlinux.sys&lt;br /&gt;
&lt;br /&gt;
If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of the Knoppix CD's boot directory, onto your USB key.&lt;br /&gt;
&lt;br /&gt;
You should already be in the ''/media/sdz4'' directory, from the cd command above.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/boot/isolinux/* .&lt;br /&gt;
 mv isolinux.cfg syslinux.cfg&lt;br /&gt;
 rm -f isolinux.bin&lt;br /&gt;
&lt;br /&gt;
Don't forget the dot on the end. It tells the cp command to copy everything into your current directory, which is what we want. Notice that there is a space between the asterisk and the dot!&lt;br /&gt;
&lt;br /&gt;
Ignore any errors about &amp;quot;failed to preserve ownership&amp;quot;. This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.&lt;br /&gt;
&lt;br /&gt;
What we're doing here is copying the Knoppix CD's /boot directory first. This increases reliability, by getting it as close to the beginning of the drive as possible. This should help on systems with buggy CHS handling of USB keys, which may become an issue as new USB keys get larger.&lt;br /&gt;
&lt;br /&gt;
We are renaming Knoppix's isolinux.cfg file to syslinux.cfg, and then removing the unnecessary isolinux.bin file. ISOLINUX (used to boot the CD) and SYSLINUX (what we just installed to your USB key) are really two different variations of the same bootloader program. They accept the same config file format, so we don't need to change anything at all, just rename.&lt;br /&gt;
&lt;br /&gt;
BTW, since ISOLINUX has isolinux.bin as its main program file, can you guess what is the equivalent file for SYSLINUX? If you guessed ldlinux.sys, the file you saw earlier, good job!&lt;br /&gt;
&lt;br /&gt;
* Finish copying the rest of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
Again, you should still be in the ''/media/sdz4'' directory. Again, don't forget the dot on the end of this command.&lt;br /&gt;
&lt;br /&gt;
 cp -av /cdrom/* .&lt;br /&gt;
 rm -rf ./boot&lt;br /&gt;
&lt;br /&gt;
This should take a while. We are filling up the USB key with the contents of the Knoppix CD.&lt;br /&gt;
&lt;br /&gt;
We already copied Knoppix's /boot directory earlier, in the previous step. We don't need two copies of it just wasting space, so we remove the extra copy.&lt;br /&gt;
&lt;br /&gt;
* You are now ready to boot!&lt;br /&gt;
&lt;br /&gt;
Cleanly unmount the USB key.&lt;br /&gt;
&lt;br /&gt;
 sync&lt;br /&gt;
 cd /&lt;br /&gt;
 umount /media/sdz4&lt;br /&gt;
 sync&lt;br /&gt;
&lt;br /&gt;
Shut down Knoppix, and remove the CD when it tells you to.&lt;br /&gt;
&lt;br /&gt;
* Reset your computer and fiddle with the BIOS until it sees the USB key.&lt;br /&gt;
&lt;br /&gt;
After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.&lt;br /&gt;
&lt;br /&gt;
Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:&lt;br /&gt;
&lt;br /&gt;
** Try a different USB port. Some BIOS's only search a few ports, not all of them.  Avoid using a USB hub, if possible.&lt;br /&gt;
&lt;br /&gt;
** Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.&lt;br /&gt;
&lt;br /&gt;
** Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially &amp;quot;hard drives&amp;quot; and &amp;quot;removable devices&amp;quot; and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.&lt;br /&gt;
&lt;br /&gt;
** Turn your computer completely off and on again. Some BIOS's require you to physically turn the computer off and on again, before they will see newly attached &amp;quot;hard drives&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
** If all else fails, try a different PC. It's still fairly rare these days to find a computer that has a good ability to boot from USB devices, and it's not something that motherboard makers advertise, so it takes a bit of luck to find a computer that can do this.&lt;br /&gt;
&lt;br /&gt;
* Boot into Knoppix from your USB key.&lt;br /&gt;
&lt;br /&gt;
The USB key will be slow to load at first, especially during the cheatcode screen, because most BIOS's will default to running USB devices in a very slow mode.  Once Knoppix detects and autoconfigures the USB port during booting, though, it will return to normal speed.&lt;br /&gt;
&lt;br /&gt;
If it works, that's great. Notice how much faster it is. There's zero seek time on a USB key, so even though it isn't very fast, it feels a lot faster than the CD. Programs are surprisingly quick to load.&lt;br /&gt;
&lt;br /&gt;
Find the drive letter for your USB key again. It should not change, but it might have.&lt;br /&gt;
&lt;br /&gt;
* Make the USB key writeable.&lt;br /&gt;
&lt;br /&gt;
Knoppix assumes that the &amp;quot;CD-ROM&amp;quot; that it booted from is impossible to write to, but we have a USB key now, not a CD-ROM. So, we must fool Knoppix into letting you write to it.&lt;br /&gt;
&lt;br /&gt;
 mount -o remount,rw /cdrom&lt;br /&gt;
 mount --bind /cdrom /media/sdz4&lt;br /&gt;
&lt;br /&gt;
* Optional step: Modify the Knoppix boot menu&lt;br /&gt;
&lt;br /&gt;
This is an optional step, for customization. We want Knoppix to autofind the persistent home directory (once we make it), and fix a few other things.&lt;br /&gt;
&lt;br /&gt;
 vi /media/sdz4/syslinux.cfg&lt;br /&gt;
&lt;br /&gt;
On line 3, the default timeout is 300. Lower this, to around 50 or so (5 seconds, since this counter is in tenths of seconds).&lt;br /&gt;
&lt;br /&gt;
It's nice to have it boot faster, without waiting for you to hit Enter, so you can put in the USB key and walk away, coming back in a few minutes to a fully booted system.&lt;br /&gt;
&lt;br /&gt;
On line 2, add a few more options to the end of the line.&lt;br /&gt;
&lt;br /&gt;
noswap noeject noprompt dma home=scan&lt;br /&gt;
&lt;br /&gt;
Here's a little explanation of what each option does.&lt;br /&gt;
&lt;br /&gt;
** noswap = Security fix: assuming you're going to be using the USB key on a bunch of different computers you don't own, you don't want to be swapping your memory onto their hard drives.&lt;br /&gt;
&lt;br /&gt;
** noeject = You can't physically eject a USB key.&lt;br /&gt;
&lt;br /&gt;
** noprompt = Gets rid of the &amp;quot;remove CD and close drive door&amp;quot; prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.&lt;br /&gt;
&lt;br /&gt;
** dma = Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.&lt;br /&gt;
&lt;br /&gt;
** home=scan = This will cause Knoppix to pick up your persistent home directory automatically the next time you boot up, asking you for the password as needed. You will get an extra menu during bootup, asking you if you want to mount your home directory or not.&lt;br /&gt;
&lt;br /&gt;
Save the file and quit the editor.&lt;br /&gt;
&lt;br /&gt;
* Optional step: Create a Knoppix persistent home directory&lt;br /&gt;
&lt;br /&gt;
Now, we can run the Knoppix persistent utility, to create something that will save your settings across a reboot.&lt;br /&gt;
&lt;br /&gt;
(It's under the penguin menu, Configure, Create Persistent.)&lt;br /&gt;
&lt;br /&gt;
Choose your drive from the menu that appears, and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
When making your encrypted persistent home directory, choose a size that is a good balance.  I recommend not using the entire remaining space on the USB key.  It's handy to have some extra free space, for quick file copying and such.&lt;br /&gt;
&lt;br /&gt;
The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with &amp;quot;dmesg&amp;quot; again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!&lt;br /&gt;
&lt;br /&gt;
* You're done!&lt;br /&gt;
&lt;br /&gt;
Now, you should be all set. Reboot again, to make sure it all works.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Knoppix-on-a-keychain!&lt;br /&gt;
&lt;br /&gt;
Josh&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Krellan</name></author>	</entry>

	</feed>