Bootable USB Key


From Knoppix Documentation Wiki
Revision as of 07:32, 18 September 2008 by 122.52.97.39 (Talk)

Jump to: navigation, search

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.

This is a "recipe" for creating a Knoppix bootable USB key. It was originally posted to the forums: http://knoppix.net/forum/viewtopic.php?t=25402

Preparation

  • Download a Knoppix image and burn it to CD or DVD.
  • Back up all data on your USB key, because we will be erasing and reformatting it!
  • Make sure U3 is not installed on the USB key

Unfortunately, many newer USB keys come with "U3" 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.

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:

http://www.sandisk.com/Assets/u3/launchpadremoval.exe

http://www.u3.com/uninstall/

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.

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.

Newer SanDisk USB keys come with a built in uninstall application. Try that first, before trying the above solutions.

xbBJHg gki8Tvqq3PngJ02lH

You're done!

Now, you should be all set. Reboot again, to make sure it all works.

Enjoy your Knoppix-on-a-keychain!

Josh

--Krellan 00:43, 10 Sep 2006 (GMT)

Large USB keys

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.

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.

mkdiskimage -4 /dev/sdz 0 255 63

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.

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.

mkdiskimage -F -4 /dev/sdz 0 255 63

At first, I did recommend FAT32 for all users: http://www.knoppix.net/forum/viewtopic.php?t=25402

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.

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.

--Krellan 20:30, 19 Oct 2006 (GMT)

PortableApps

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.

http://portableapps.com/suite

http://portableapps.com/

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!

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.

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 "install" 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.

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.

--Krellan 19:23, 27 Nov 2006 (GMT)


There is an another project based on PortableApps, with the addition of TOR-networking enabled by default. This makes it possible to anonymize web surfing at the cost of speed.

More info at http://www.democrakey.com/

--Neva 18:54, 20 Jun 2007 (GMT)


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.

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.


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


For the Cylinders/Head/Sectors issue, an easy way to find the information is simply type: hdparm /dev/sd? Where '?' is the drive letter. It will output the "Geometry: x/y/z" where X=Cylinders, Y=Heads, Z=Sectors. Enter those in for the last three variables on the mkdiskimage command and you are all set.

--Geekner 18:53, 7 Oct 2007 (UTC)

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.

The workaround is to use the "noudev" 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.

--Krellan 10:55, 18 Oct 2007 (UTC)