Language Selection

English French German Italian Portuguese Spanish

The Lazy Guide to Installing Knoppix on a USB Key

Filed under
Howtos

Knoppix, the famous live Linux CD that practically started the live CD trend, needs no introduction to most people. One of the things that's so great about it is that you can take it with you and boot to a familiar Linux environment on almost any modern computer, without touching the OS that's already installed on it.

Of course, it can be even more portable when it runs entirely off of an inexpensive USB key. So let's install it to a 1 GB USB key, and create a persistent home directory in which to store files. Only let's do it the lazy way, and keep use of the command prompt to a bare minimum.

You will need a copy of the latest Knoppix CD (v5.1.1 as of this writing) and, of course, a 1 GB USB key. If there's any data on that key you want to keep, save it before starting, because the key's going to get repartitioned (and reformatted) and any existing data will get wiped out.

A note about the mysterious art of booting from USB keys. Some computers can do it, and some can't. (Now that was a really technical statement, wasn't it?) The newer the computer's BIOS, the greater the possibility that it will work.

Generally speaking, there are two ways of booting from a USB key. The first way, the computer treats it as if it were booting from a Zip drive. This was the first way to go about it, and it requires special partitioning (so that your USB key's partition layout actually resembles that of a Zip drive). If your computer can only boot from a USB key using Zip drive emulation, then a saavy user's written a very good how-to about how to use a script on the Knoppix CD to do the partitioning, and posted it to the Knoppix.net wiki. My how-to owes him a debt, because I used some of his ideas.

The current way is to simply treat the USB key as if it were a hard drive. This is the method we'll use here, due to its simplicity.

Also, note that Damn Small Linux (a tiny, 50 MB Knoppix-based distro) includes an easy-to-use script that will format and put DSL onto a USB key, using either Zip drive emulation or hard drive emulation. To avoid frustration, you might want to use Damn Small Linux to see if your computer actually will boot from a USB key as if it were a hard drive before performing all these steps!

To get started, boot from the Knoppix CD. When the (KDE) desktop is up and running, the first thing to do is to set a root password (by default, there is none) by clicking on the penguin icon next to the K menu and choosing "Set password for root" from the menu.


1. Creating a root password


2. Creating a root password, continued

Next, insert your USB key. KDE will most likely pop up a window asking if you want to either "Open in a new window" (i.e. browse the files on it), or "Do nothing." Choose to do nothing (or click Cancel), because we don't want it mounted just yet. The key's icon should show up on the desktop, usually as sda1 or sdb1. Carefully make note of its name (in the form "sdxy") for the next step.

Go to the K Menu > System and choose GParted, a GUI-based partition editor, enter your root password when prompted, and choose your USB key from the drop-down menu to the right of the toolbar. Delete the partition on it (you did back up your data, didn't you?) and create two new partitions, both FAT16. Partition one should be 750 MB; the second should take up the remaining space. (Make 100% sure you're partitioning your USB key, not your hard drive!) When you're done, the results should look similar to this:


3. Preparing for partitioning

When you're ready, click the Apply button.

Next, right-click on Partition #1 to bring up a context menu, and choose "manage flags." Set the flag on your new partition to "boot."


4. Setting the boot flag

When you're all done, it should look about like this in GParted:

5. Done partitioning

Again, at this point KDE may pop up two windows (for the two partitions you created) asking if you want to either see what's on your USB key or not. Tell it "no." Next, bring up a console window, type "su" to get root, and install syslinux on the USB key, using the command

syslinux /dev/sda1

(substitute the real name of your USB key's first partition for "sda1" here, if it's not sda1).


6. Installing syslinux

There are some files you'll now need to copy to your USB key's first partition, so go ahead and mount it and make it writeable. You do that by right-clicking on the key's desktop icon to bring up a context menu, and first select "mount" from the menu, and then "change read/write mode," pressing "Yes" when it asks for confirmation. At this point, there should be one file on your USB key's first partition, named "ldlinux.sys."


7. Mount the USB key's first partition


8. Make it writeable

Now we need to copy files off of the Knoppix CD onto the first partition of the USB key. Start up Konqueror as root by choosing K Menu > System > More Applications > File Manager - Super User Mode. Give it your root password when asked.


9. Start Konqueror as root

Open the /cdrom/boot/isolinux directory, select all the files in it, and copy them to the root of your USB key.


10. Copying files - 1

Next, rename the "isolinux.cfg" file on the USB key to "syslinux.cfg" and delete the unneeded file, "isolinux.bin." Continuing on, copy the "KNOPPIX" directory and the files at the root of /cdrom to the USB key.


11. Copying files - 2

It'll ask you if you want to overwrite "cdrom.ico" and "index.html". Let it, by clicking "Overwrite All". This step will take a while, since you're copying a file that's almost 700 MB in size to your USB key.


12. Copying files - 3

When that's finally done, you can make some changes to "syslinux.cfg," which is (as you might guess) the configuration file for syslinux. Select it in Konqueror, which (unless you've changed your defaults) will bring up KWrite (a text editor). At the end of the second line, the one that begins with "APPEND," try adding "dma noeject noprompt home=/media/sda2/knoppix.img", which does the following:

  • "dma" turns on dma settings for all hard drives and CD-ROM drives, which can speed things up
  • "noeject" and "noprompt" makes it so that Knoppix won't try to eject the CD (since you're using a USB key) and won't prompt you to remove the CD before rebooting
  • "/home=/media/sda2/knoppix.img" will load your soon-to-be-made persistent disk image

Those of you who've used Knoppix will recognize those as Knoppix "cheatcodes." Putting them here means you won't have to type them at the "boot:" prompt.


13. Modify syslinux.cfg

Almost done! Now to make the persistent disk image, which does more than just store your personal files from /home/knoppix -- it also saves changes you've made to configuration files, and even allows you to install programs, just as if you were running from a hard drive. (Granted, 200 MB isn't that much room.) To start, go to the Knoppix menu (the one with the penguin icon next to the K Menu) and select Configure > Create a persistent KNOPPIX disk image.


14. Create a persistent disk image - 1

When it asks you which partition to write it to, choose the second partition on your USB key. (I know the partitions are labelled "vfat" in the screenshot, but the partitions really are formatted as FAT16. Trust me.)


15. Create a persistent disk image - 2

It'll ask you to tell it how large to make the persistent disk image. Choose a number close to, but not completely filling, the partition's capacity. 200 MB should be good.


16. Create a persistent disk image - 3

Now you're (finally) done and ready to boot from the USB key. You will have to sort of babysit the boot process, because there's a dialog box that asks if you want to actually use your persistent home that comes up. (Then again, maybe you don't want to use it all the time, especially if you're using more than one computer.) You also have to explicitly give it permission to write to your persistent home. (Hint: Use the arrow keys to move; use the spacebar to select.)

About BIOS settings and booting from a USB key: On one test machine, which has a Phoenix AwardBIOS, I have to go into the CMOS setup utility, to Advanced BIOS Features, and to Hard Disk Boot Priority, then press "Page Up" until the "USB-HDD0" entry is at the top, and then save my settings and exit. After that, it'll boot from the USB key, if it finds one. (If not, it boots from the hard drive.)

On my other test machine, which has an AMI BIOS, all I have to do is press F11 to call up a menu asking which device I wish to boot from at boot time. Naturally, this is much more convenient.

That's all, folks! Have fun. (And those of you with huge 8 GB USB keys, consider installing the DVD version of Knoppix, which has the kernel headers included -- which you need in order to install such nifty things as proprietary video drivers.)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Clarification in Article

I have followed the instructions and got a little confused here.
isolinux is a folder and has files in it. Knoppix is fighting me and not letting me copy the files, but copies the entire folder with the files. Is this right?

Open the /cdrom/boot/isolinux directory, select all the files in it, and copy them to the root of your USB key.

Also I am getting a write error when trying to edit and make the changes you have documented to "syslinux.cfg,"
It tells me it is not possilbe to write to file///media/sda1/isolinux/syslinux.org

I tried to complete the instructions with the isolinux folder being in /dev/sda1/isolinux (as a folder) but get an error can not find isolinux. You just get the boot prompt. I tried knoppix home=/dev/sda2 but it did not like that either.

Can you help me out?

re: Clarification in Article

Please make sure a) you know the names of your USB key's partitions (sda1/sda2? sdb1/sdb2?); Cool you've got your USB key partitions mounted read-write; and c) you've started Konqueror as root.

You'll want to copy the files in the isolinux directory (not the directory itself) to the root level of your USB key.

Truth be told, it's easier to do this at the bash prompt. For example (as root, and assuming the first partition on your USB key is "sda1"):

# cd /media/sda1
# cp -av /cdrom/boot/isolinux/* .
(don't forget the dot "." at the end)
# mv isolinux.cfg syslinux.cfg
# rm -f isolinux.bin

(The "#" represents the root prompt; don't type it.)

And to edit "syslinux.cfg", try doing it using mcedit, as root, also in a console.

(Trying to be lazy sometimes has its drawbacks. I admit to running "kcontrol" as root and changing the mouse setting to double-click to open files before doing anything with Konqueror. Makes it much easier to select files -- instead of unintentionally opening them -- that way.)

I had the same problem

What I did was save a new file called isolinux.cfg. Then I deleted the syslinux.cfg file and renamed the new isolinux.cfg to syslinux.cfg

Upon finishing, I rebooted and the key booted and I got as far as the bootup screen that says hit enter to start knoppix or F2 or F3 for help or boot options. and there it sits. Sad Any ideas? Could this have something to do with the appended options? dma perhaps? Any help running this down would be greatly appreciated as I've been trying to get linux on a stick now for days. This is as close as I've been able to get so I'm assuming it's something simple because the stick does boot. (UNlike the attempts with the Fedora approach). Many thanks for the great writeup, and TIA for any help running down the glitch!

Part 2

U of H student Tom

I also tried to edit the syslinux.cfg and get the same message. Seems like some type of security on the file.

Part 3

U of H student Tom
I right clicked on the file and went to properties and clicked on permissions gave everyone read and write and still get an error. "Could not change permissions".

Part 4

I went to the Shell console
typed in su
got to root@Knoppix

cd /media/sda1(Worked)

cp -av /cdrom/boot/isolinux/* . (don't forget the dot "." at the end)

balder.img -> cp: cannot create regular file Read only file system.
boot.cat same
boot.msg same

cp: overwrite './cdrom
.ico, overriding mode 0555?

Files did not copy.

mv isolinux.cfg syslinux.cfg
rm -f isolinux.bin

Seems like the CD being in read only mode is causing issues. Should I have loaded it to RAM?

U of H student Tom

Got it

I rebooted the machine and this time used the USB Knoppix copy I had versus running the CDROM version, went to root changed to SU, check the mounting status of the TOBE USB stick, updated to write access and ran the commands and it worked.

It works fine!

Some nice ideas there. Thank you

Escolar

Knoppix

When Knoppix was first released it was heralded as revolutionary in the Linux world. Its autodetection and configuration capabilities were unsurpassed. Many of my colleagues remarked that if 'KNOPPIX can't do it, Linux can't do it'. Theoretically, one would be able to get a Knoppix CD, pop it into an arbitrary system, run it, save one's data to a partition, USB stick, etc....), reboot and the existing system would be left completely as it was before the CD was placed in the system.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
don't buy World of Warcraft Gold, make'em.

Thanks

Hello !

Thank you very much for the information. I need all this information to do something..Thanks again Knoppix

___________________________________
Libros Gratis

need a step-by-step note for booting knoppix DVD from USB flash

First of all, thanks knoppix and this nice step-by-step note for installing knoppix boot image onto a USB pendrive.

I downloaded a Knoppix 5.2.0 DVD and want to put it on a 8GB USB pendrive. I followed the steps in this note and failed because of the size limit for a FAT16 partition.

There are two really huge files under the KNOPPIX directory on the knoppix 5.2.0 DVD: KNOPPIX (2.0 GB) and KNOPPIX2 (2.1 GB). I can not copy them into one FAT16 partition which was made to 4GB on my pendrive. 4GB is already the ultimate limit for a FAT16 partition.

Is there a note for making a Knoppix DVD to boot from high-capacity pendrive? Moreover, is the FAT16 partition a must for booting from a USB pendrive? Is it possible to make the partition to be ext2? I appreciate in advance for your kind help!

Great help

Thanks a lot, it was of a great help for me.
I made a change in step 4 where I created only one partition (4Gb) in FAT32, it's working well.... seems to.

thanks again,

+--
¦ All computers wait at the same speed
+----

partition problems

If you go with one partition, do you lose your persistent storage option?

I have a 4MB and have been messing with it too much, with no luck. If I make a second partition, I cannot mount it in winXP to use it there (I tried both FAT16 and FAT32 -- of course, ext2 wouldn't work either). It boots ok, but that's about it.
Is there any way to get persistent storage with a bigger USB drive and allow WinXP to read/write?
Kurt

I think this guide was

I think this guide was written especially for even lazy users like me Smile
I understood almost all of that, but file syslinux.cfg
it still insufficient clear for me.
Is "timeout" string really have influence for anything?

No Such Device

I created 2 partitions inside an extended partition, on a 2 GB USB stick. I didn't get the "manage flags" option so I set the 1st partition to "Active", which I guess is the same as boot. The properties in Knoppix identified the USB drive as sdc1, yet when I ran the command "syslinux /dev/sdc1" from root, I got: "no such device".

sdc1

I am using Knoppix 5.1 & booted the live disk, with the USB stick already in. I was able to set permissions, mount & un-mount the device & create partitions, so I guess it must be mounted.

My knowledge of Linux is basic, so I don't know how to hotplug.

News NOT Support

Tuxmachines is a NEWS (and Review) site - perhaps you'd find answers to your tech support questions on a TECH SUPPORT Site.

http://www.knoppix.net/forum/
http://www.linuxforums.org/forum/knoppix-help-forum/
http://www.knoppixforum.de/
http://www.google.com/

Re: Support.

Point taken about the forums, anyway it still didn't work so I gave up. However the method I found below worked, on re-start I had to remove & re-insert the stick, to make the PC boot from USB, (hotplug?):

http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510/

The home-page of the above site, has a list of USB install tutorials for various Linux distros.

re: support

I think what Vonskippy meant was that although your support questions are more than welcomed at Tuxmachines, they will probably receive faster and perhaps more accurate responses at forums that specialize in the software about which you're asking.

Superb Tutorial!

White modifying the KNOPPIX configuration file, those having the flash drive as 'sdbX' please use 'sdbX' in place of 'sdaX'.

Had a charm bro... Thank!

Awesome

Thank you very much for this EXCELLENT tutorial.
I'm kind of new to Knoppix and Linux on the whole and this tutorial provided me structured and clear information and screenshots, exactly what I needed.
I've tried two other similar tutorials just yesterday, without success. This one did the trick!
I swear, if I could, I'd start humping you right away from happiness. *joke* =D
Thanks once again!
--
[sCYTHe] aka 88scythe

Installing Knoppix 6.2 from DVD on a 16GB USB Key

I followed your instructions verbatim, until I came
to a show stopper problem.
You say at step 11:

10. Copying files - 1

Next, rename the "isolinux.cfg" file on the USB key to "syslinux.cfg" and delete the unneeded file, "isolinux.bin." Continuing on, copy the "KNOPPIX" directory and the files at the root of /cdrom to the USB key.
-----------------------------------------

Well, on the knoppix dvd, the directory KNOPPIX is almost 4GB in size.

Our root partition on the USB stick is 750MiB.

Could you be a little more exact as to which files in the
KNOPPIX directory shoudl be copied to our USB root partition?

Cheers,

JD

More in Tux Machines

Programming Leftovers

  • HEURISTIC ALGORITHMS FOR THE PROBLEM OF OPTIMIZATION OF THE DRAIN AREA IN UNCONVENTIONAL FIELDS OF HYDROCARBONS

    In a previous work, a linear programming based procedure was presented for this problem, and this procedure allowed to solve real-life instances, albeit -in some cases- producing plans with overlappings among the pads (since a relaxation is solved) and suffering from memory issues.

  • Getting Started With Async Features in Python

    Have you heard of asynchronous programming in Python? Are you curious to know more about Python async features and how you can use them in your work? Perhaps you’ve even tried to write threaded programs and run into some issues. If you’re looking to understand how to use Python async features, then you’ve come to the right place.

  • Anaconda Enterprise Receives Honors in Fourth Annual Datanami Readers’ and Editors’ Choice Awards

    Anaconda’s enterprise data science platform has been recognized in the fourth annual Datanami Readers’ and Editors’ Choice Awards, presented during the Strata Data Conference.

  • Exploratory Data Analysis Made Easy At The Command Line

    There are countless tools and libraries in Python for data scientists to perform powerful analyses, but they often have a setup cost that acts as a barrier to ad-hoc exploration of data. Visidata is a command line application that eliminates the friction involved with starting the discovery process. In this episode Saul Pwanson explains his motivation for creating it, why a terminal environment is a useful place for this work, and how you can use Visidata for your own work. If you have ever avoided looking at a data set because you couldn't be bothered with the boilerplate for a Jupyter notebook, then Visidata is the perfect addition to your toolbox. [...] There are countless tools and libraries in Python for data scientists to perform powerful analyses, but they often have a setup cost that acts as a barrier to ad-hoc exploration of data. Visidata is a command line application that eliminates the friction involved with starting the discovery process. In this episode Saul Pwanson explains his motivation for creating it, why a terminal environment is a useful place for this work, and how you can use Visidata for your own work. If you have ever avoided looking at a data set because you couldn’t be bothered with the boilerplate for a Jupyter notebook, then Visidata is the perfect addition to your toolbox.

SUSE and Red Hat Leftovers

  • Skuba on SUSE CaaS Platform 4

    With SUSE CaaS Platform 4 we heard our customers feedback and decided to change what the lifecycle of the platform looks like. Previous versions of SUSE CaaS Platform included an administrator node that despite being useful for managing the whole platform, was another component to take care of, and an extra machine to take into account when deploying the platform. This administrator node used Salt to set up and maintain the Kubernetes cluster among the different nodes comprising your cluster. During this time, your feedback has been that a little more flexibility on the deployment was appreciated, so you could experiment with slightly different setups, even if they were for proof of concepts while you were fleshing out the details of production clusters.

  • Kubernetes Rolling Update Strategy in our production infra

    Kubernetes rolling update strategy means suppose we are running pod (containers) in our live infra and we want to update new changes into our running pod like build update, confrontational changes etc. While deployment new pod with new changes suppose our containers got stuck or failed due to any reason. So, we have to redeploy old pod with old changes again to avoid downtime of our application. This complete process is called rolling update strategy in Kubernetes. Kubernetes rolling update strategy Before moving to next we should aware about new pod deployment strategy of Kubernetes means how many new pods it will deploy at a time without taking downtime. Because high availability of our website is our first priority. So, while deploying new pod Kubernetes will deploy 25% or you can say one fourth of the total pod. Suppose we are running four pods first it will terminate 25% of total pod means one pod. Then it will launch 25% new pod and so on.

  • Tackle OpenStack networking woes with SUSE OpenStack Cloud Crowbar

    By far, the most difficult aspect of successfully deploying OpenStack is getting the networking right, a challenge that has caused many a well-intentioned IT team to throw up its hands and toss in the towel. Fortunately, SUSE OpenStack Cloud removes much of that pain by automating most of the network deployment and dramatically simplifying custom network set-ups.

  • Grow your virtualization environments without breaking the bank

    An IT director at a large financial services company shares the benefits and cost reductions they’ve experienced by switching to Red Hat Virtualization. In just three years, it’s paved the way for an efficient, stable and cost-effective virtualization environment.

  • How to Handle OpenShift Worker Nodes Resources in Overcommitted State

    One of the benefits in adopting a system like OpenShift is facilitating burstable and scalable workload. Horizontal application scaling involves adding or removing instances of an application to match demand. When OpenShift schedules a Pod, it’s important that the nodes have enough resources to actually run it. If a user schedules a large application (in the form of Pod) on a node with limited resources , it is possible for the node to run out of memory or CPU resources and for things to stop working! It’s also possible for applications to take up more resources than they should. This could be caused by a team spinning up more replicas than they need to artificially decrease latency or simply because of a configuration change that causes a program to go out of control and try to use 100% of the available CPU resources. Regardless of whether the issue is caused by a bad developer, bad code, or bad luck, what’s important is how a cluster administrator can manage and maintain control of the resources. In this blog, let’s take a look at how you can solve these problems using best practices.

  • How the new Quarkus extension for Visual Studio Code improves the development experience

    Earlier this year, we were introduced to Quarkus, the next-generation, container-first framework for Java applications. As expected, such new frameworks and technologies make way for new developer tools focused on making the development experience even better. The recent Quarkus extension for Visual Studio Code release aims to do just that, by bringing features specific to Quarkus project development within VS Code. The new VS Code extension is dependent on a couple of Java extensions for VS Code, so it is recommended that you have the Java Extension Pack installed. This article outlines what the Quarkus extension for VS Code has to offer: convenient features for an already convenient Java framework.

Security: New Updates and "Optimizing KVM Virtualization Performance Stemming From Spectre"

  • Security updates for Monday

    Security updates have been issued by Debian (expat, php-pecl-http, and php7.0), Fedora (ImageMagick, jackson-annotations, jackson-bom, jackson-core, jackson-databind, and rubygem-rmagick), Mageia (chromium-browser-stable, ibus, kernel, samba, and thunderbird), openSUSE (chromium), Oracle (dovecot and kernel), Red Hat (dbus, kernel, kernel-alt, and kpatch-patch), Scientific Linux (dovecot and kernel), and SUSE (expat, ibus, kernel, kernel-source-rt, nmap, openssl, and webkit2gtk3).

  • Red Hat Working On Optimizing KVM Virtualization Performance Stemming From Spectre

    Red Hat's Andrea Arcangeli sent out an interesting patch series on Friday to micro-optimize the Kernel-based Virtual Machine (KVM) to enhance the VMEXIT performance in wake of Spectre mitigations. The "KVM monolithic" patch series ends up linking the KVM common code both into kvm-intel and kvm-amd so that the common "kvm" kernel module can be dropped. This occupies more disk space but should yield better run-time performance particularly for systems mitigated against Spectre Variant Two.

  • 10 Best Anonymous Browser Apps for Android to Stay Incognito

    Android isn’t the most secure platform out there, but with the 10 best apps for anonymous browsing, you can greatly enhance your privacy online. Today we’ll define what anonymous browsing actually entails, run through 10 essential Android apps, and present the 2 best Android VPNs for the ultimate mobile cybersecurity.

Kernel: AMD Navi 10 Firmware and Linux 5.4 Additions

  • AMD Navi 10 Firmware Finally Lands In The Linux-Firmware Tree

    While AMD has provided open-source Radeon RX 5700 series (Navi 10) support since launch and that code since worked into the various mainline code-bases from the Linux kernel to Mesa, one kink in their support has been their binary microcode images not being available from the reference linux-firmware.git location as needed to initialize the hardware. That Navi 10 firmware/microcode issue has finally been rectified with the images landing this morning. Up until now any Radeon RX 5700 series Linux customers or distribution/third-party driver packagers have had to pull these binary bits from this Navi10 directory on the personal site of AMDGPU lead maintainer Alex Deucher. Via his site is where he normally stages these binary microcode files until landing in linux-firmware.git as the de facto location for all Linux drivers' firmware files.

  • Linux 5.4 Brings Support For Wacom's MobileStudio Pro 13, Logitech Lightspeed Receivers

    Jiri Kosina on Sunday sent out the HID subsystem updates for the in-development Linux 5.4 kernel. The HID pull once again features support for several new devices particularly on the Logitech side.

  • Wireless USB + UWB Demotion Goes Ahead For Linux 5.4

    Back in August I noted that Wireless USB and Ultra Wideband would be deprecated within the Linux kernel and that is indeed happening for Linux 5.4. The Wireless USB (WUSB) and Ultra Wideband (UWB) subsystems within the Linux kernel were already orphaned for years with having no maintainer while now they are officially deprecated and demoted to the kernel's staging area. If no one steps up soon to maintain the code, it will be dropped in forthcoming kernel releases.