PDA

View Full Version : Got Knoppix 5.0.1 successfully booting from USB key



Krellan2
09-03-2006, 10:45 AM
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.

I have a 1GB USB key, so using the Knoppix CD was the best fit (the DVD is much too large).

Here's a rather long thread I started a while ago, about getting an older version of Knoppix up and running: http://www.knoppix.net/forum/viewtopic.php?t=23558

I've simplified that somewhat. Here's a mini-guide:

* Boot Knoppix 5.0.1 from CD and make sure it works.

Put in your USB key as soon as possible, when you see the title screen of Knoppix, so that it is sure to be found by Knoppix autodetection.

Do not use the "toram" 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.

* Once Knoppix is up and running, open a root shell (from the penguin icon). 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!

Commands to try:


dmesg | grep -i scsi

cat /proc/partitions

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.

* Erase the entire USB key.


dd if=/dev/zero of=/dev/sdz

Did you use the right drive letter? Did you? If not, you'll be crying, right about now....

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.

You should get the "no space left on device" 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).

* Make a quick patch to the mkdiskimage script.

We need it to write partition type 0C (FAT32 LBA). Unfortunately, "out of the box" it only writes partition type 0B (FAT32 CHS). We want to make sure Windows always uses LBA and not CHS, for increased reliability, just in case we ever use the USB key with Windows. So, an easy one-line change.

Use your favorite editor and edit /usr/bin/mkdiskimage.


vi /usr/bin/mkdiskimage

Go to line 237.

Change 0x0b to 0x0c then save the file and exit.

* Run mkdiskimage, to automatically partition and format your USB key.


mkdiskimage -F -4 /dev/sdz 0 64 32

This lays down a new MBR and partition table on the drive, and partitions and formats the entire drive as one big FAT32 LBA partition. I prefer FAT32 because it is a more efficient use of space than FAT16, and have noticed no difference in the ability of various systems to boot FAT32 as opposed to FAT16.

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: http://syslinux.zytor.com/usbkey.php

KDE may throw a stupid popup window in your face, once it recognizes your new partition. If this happens, close the window.

* Run the SYSLINUX installer on your new partition.


syslinux -s /dev/sdz4

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.

* Mount your new partition.


mount /media/sdz4

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.


cd /media/sdz4
ls

You should notice one, and only one, file in this directory now: ldlinux.sys

If you don't see this, then something probably went wrong earlier. Go back and try again before continuing.

* Copy the contents of the Knoppix CD's boot directory, onto your USB key.

You should already be in the /media/sdz4 directory, from the cd command above.


cp -av /cdrom/boot/isolinux/* .
mv isolinux.cfg syslinux.cfg
rm -f isolinux.bin

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!

Ignore any errors about "failed to preserve ownership". This is normal, because we're using the FAT filesystem, which does not support file ownership. This is not a problem for us.

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.

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.

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!

* Finish copying the rest of the Knoppix CD.

Again, you should still be in the /media/sdz4 directory. Again, don't forget the dot on the end of this command.


cp -av /cdrom/* .
rm -rf ./boot

This should take a while. We are filling up the USB key with the contents of the Knoppix CD.

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.

* You are now ready to boot!

Cleanly unmount the USB key.


sync
cd /
umount /media/sdz4

Shut down Knoppix, and remove the CD when it tells you to.

* Reset your computer and fiddle with the BIOS until it sees the USB key.

After unmounting above, the USB key can be removed. Some BIOS's require a removal and re-insertion before they will recognize it.

Other things to try, if you're having trouble getting the BIOS to see your USB key and let you boot from it:

Try a different USB port. Some BIOS's only search a few ports, not all of them.

Hit a special key to bring up a boot menu. Some BIOS's can only boot from USB when manually selected.

Go into your BIOS's setup menu, and walk through the boot settings. Look under all menus, especially "hard drives" and "removable devices" and other things like that. Some BIOS's will not search for newly attached devices until you manually go through the menus again.

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 drives.

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.

* Boot into Knoppix from your USB key.

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.

Find the drive letter for your USB key again. It should not change, but it might have.

* Make a persistent home directory, if you want.

Knoppix assumes that the "CD-ROM" 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.


mount -o remount,rw /cdrom
mount --bind /cdrom /media/sdz4

Now, we can run the Knoppix persistent home utility.

(It's under the penguin menu, Configure, Create Persistent.)

Choose your drive from the menu that appears, and follow the instructions.

The program should complete without errors. If the program suddenly disappears midway through, check the kernel logs with "dmesg" again. If you see pagefuls of SCSI errors and such, beware, you might have a worn-out USB key!

* Modify the Knoppix boot menu.

This is an optional step, for customization. We want Knoppix to autofind the persistent home directory, and fix a few other things.

You might have to repeat the above mounting steps, as the Knoppix persistent tool might randomly unmount the directory sometimes.


vi /media/sdz4/syslinux.cfg

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).

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.

On line 2, add a few more options to the end of the line.

noswap noeject noprompt dma home=scan

Here's a little explanation of what each option does.
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.
noeject = You can't physically eject a USB key.
noprompt = Gets rid of the "remove CD and close drive door" prompt when shutting down, as this prompt is rather misleading when it's really a USB key instead.
dma = Gets you a significant speed increase when dealing with many IDE drives, a good thing to have.
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.

Save the file and quit the editor.

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

Enjoy your Knoppix-on-a-keychain!

Josh

Harry Kuhman
09-03-2006, 11:59 AM
What a great write-up. I hope that you will consider putting a copy in the wiki where it will be easy for people to find.


...The mkdiskimage script is USB-ZIP compliant, which may help it boot on more systems than USB-HDD. ...
I'm particularly interested in this. My HP notebook has an option in the BIOS to boot from USB, but I have not yet managed to get it to boot a usb flash drive. My latest attempts were with the configuration that DSL writes to flash. Everything looked good, but it just would not boot (nor would it boot on an IBM laptop that I had a chance to try it on). I'm wondering if this is the issue. Can you explain how we can determine if a flash drive has been configured USB-ZIP or USB-HDD? Are there any trade-off we should know about? Unfortunatey, at this time my largest flash drive is 512 meg, too small for Knoppix. I would gladly buy a larger one if I thought that my notebook would boot it, but my bad experiences so far have discouraged me from buying a larger flash device; I have no use for more flash devices other that putting together a bootable Linux on flash (doesn't even have to be Knoppix, DSL or Puppy would be fine if I could get them to boot.) Can you suggest any test I can do with a smaller flash device (64, 256 or 512 meg) to confirm that my notebook will indeed boot a flash device?

Krellan2
09-06-2006, 05:03 AM
What a great write-up. I hope that you will consider putting a copy in the wiki where it will be easy for people to find.

Thanks. I am working on debugging one problem on a certain machine, but after that, I'll attempt making a wiki page.


I'm particularly interested in this. My HP notebook has an option in the BIOS to boot from USB, but I have not yet managed to get it to boot a usb flash drive. My latest attempts were with the configuration that DSL writes to flash. Everything looked good, but it just would not boot (nor would it boot on an IBM laptop that I had a chance to try it on). I'm wondering if this is the issue. Can you explain how we can determine if a flash drive has been configured USB-ZIP or USB-HDD? Are there any trade-off we should know about?

USB-ZIP and USB-HDD are both attempts to solve a problem: the BIOS expects all "disk" devices to have a traditional cylinder/head/sector count (CHS), but USB key s don't have this. Like most modern drives, they're just a total count of sectors (LBA). There's no need for the old cylinder/head/sector nonsense, but try telling that to the blunderheads who seem to be programming most BIOS's these days!

USB-ZIP attempts to simulate the layout of a ZIP drive: 64 heads, 32 sectors, and a variable number of cylinders depending on the size of the drive. In addition, ZIP drives use partition four (for whatever demented reason Iomega chose in the past). USB-ZIP was basically a hack to let a BIOS that was capable of booting from a ZIP drive, boot also from a USB key, with minimal reprogramming effort. Such is the state of the BIOS industry these days, I'm sad to say.

USB-HDD simply relaxes these restrictions. USB-HDD is supported by fewer BIOS's than USB-ZIP, however, so it's a tradeoff for compatibility. USB-ZIP will let your key boot up in more computers, so for now, it's the one to use.

You can change between USB-ZIP and USB-HDD by rewriting your partition table on the disk, and then reformatting.


Unfortunatey, at this time my largest flash drive is 512 meg, too small for Knoppix. I would gladly buy a larger one if I thought that my notebook would boot it, but my bad experiences so far have discouraged me from buying a larger flash device; I have no use for more flash devices other that putting together a bootable Linux on flash (doesn't even have to be Knoppix, DSL or Puppy would be fine if I could get them to boot.) Can you suggest any test I can do with a smaller flash device (64, 256 or 512 meg) to confirm that my notebook will indeed boot a flash device?

I'm not sure. The main reason I bought a 1GB USB key was to put a complete bootable "CD" on it :)

Maybe you can try it with a remastered Knoppix that cuts down on the optional software (such as DSL). I haven't tried this myself.

Harry Kuhman
09-06-2006, 05:47 AM
....You can change between USB-ZIP and USB-HDD by rewriting your partition table on the disk, and then reformatting.

....Maybe you can try it with a remastered Knoppix that cuts down on the optional software (such as DSL). I haven't tried this myself.

Most of what you wrote should be able to be cut and pasted into a wiki article pretty cleanly although code blocks and the like will take different formatting. But in the end it will be an easy thing for people to find; old forum posts tend to sink in the listings and are seldom see if they are not on the first page.

Thanks for the additional information. Let me ask my question a different way though. What in the partition table is it that flags USB-ZIP or USB-HDD? Lets assume I can byte edit the table, what bits or bytes am I looking for to tell me which I have?

DSL was one of the smaller bootable systems that didn't work for me (along with a few others, but the others were more convoluted to make and I could have done something wrong). Could I just hex edit the partition table to change from USB-HDD to USB-ZIP, or are the actual partitions different as well?

Give me low lever details, I can take it.

Krellan2
09-06-2006, 09:15 PM
Thanks for the additional information. Let me ask my question a different way though. What in the partition table is it that flags USB-ZIP or USB-HDD? Lets assume I can byte edit the table, what bits or bytes am I looking for to tell me which I have?

DSL was one of the smaller bootable systems that didn't work for me (along with a few others, but the others were more convoluted to make and I could have done something wrong). Could I just hex edit the partition table to change from USB-HDD to USB-ZIP, or are the actual partitions different as well?

Give me low lever details, I can take it.

In the partition table, it's the CHS information. Ending CHS must be a size of */64/32. This is the biggie, as it seems the BIOS gets its CHS sizing information from what's read from the partition table! Starting CHS should probably be the standard 0/1/1, with starting LBA to match. Ending LBA should be truncated to match the ending CHS, so unfortunately, you end up losing a few KB from your USB key. But, it's worth it, if doing so lets it boot!

Your data partition must also be partition 4, and marked active. I haven't found a difference in filesystem type, as the BIOS should only care about this silly CHS information, and leave filesystems up to the OS.

Here's my partition table, as seen by "fdisk":


Disk /dev/sda: 64 heads, 32 sectors, 977 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 0 0 0 0 0 0 0 0 00
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 80 1 1 0 63 32 976 32 2000864 0c

The hex dump (notice partitions 1, 2, 3 are all blank):


00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 01
000001f0 01 00 0c 3f e0 d0 20 00 00 00 e0 87 1e 00 55 aa


Notice I lose a little capacity from what my key really can hold:


SCSI device sda: 2001888 512-byte hdwr sectors (1025 MB)

Good luck! There's lots more to read online if you Google: "USB-ZIP" "USB-HDD"
(do not forget the quotation marks)

Josh

Harry Kuhman
09-06-2006, 10:52 PM
Thanks.

/-/oek
09-08-2006, 06:49 PM
Great info. And here's to not paying attention (me that is).
After redoing the whole setup several times, using syslinux but also trying grub, i just couldn't get the damn thing to boot.
My desktop has extensive BIOS so tried everything under the sky but to no avail....
Then, when dinner was on the table i left the machine to try and boot from the flash for the umpth time, it booted up hdd ubuntu, intead of knoppix dvd, and to my surprise i got 2 (TWO) usb-drive icons on my ubuntu (6.06) desktop.....that didn't show in knoppix...!!??

Opening both showed the "secret" (RTFM?) of the USB Disk Pro: I has a floppy-sized primary partition which holds a password/encryption tool to secure the second partition. Auto-format the key when 3 wrong pwds are given etc. That's why it never booted.
On XP it mounts as floppy and Removable, but i never noticed the floppy......

Time to sort out how to repartition the whole flash key.....later more on this.
Right now ubuntu mounts them as sda4 (after using mkdiskimage) 1027MB, and sdb 1MB

Edit: Think i'm screwed with this one. It appears to have firmware installed. The tool on the flash key: UDPV264.exe, i found a newer version, wich has an extra option of resizing the secure area, but trying to use that it stated Firmware not supporting option. How to get this mother to work.....to start i looks to behave as a usb-hub, ie 2 separate devices, sda and sdb.....

Sep 8 22:25:10 Acer kernel: usb 1-1: new full speed USB device using uhci_hcd and address 3
Sep 8 22:25:10 Acer kernel: usb 1-1: configuration #1 chosen from 1 choice
Sep 8 22:25:10 Acer kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Sep 8 22:25:15 Acer kernel: Vendor: Model: USB DISK Pro Rev: PMAP
Sep 8 22:25:15 Acer kernel: Type: Direct-Access ANSI SCSI revision: 00
Sep 8 22:25:16 Acer kernel: SCSI device sda: 2006016 512-byte hdwr sectors (1027 MB)
Sep 8 22:25:16 Acer kernel: sda: Write Protect is off
Sep 8 22:25:16 Acer kernel: sda: assuming drive cache: write through
Sep 8 22:25:16 Acer kernel: SCSI device sda: 2006016 512-byte hdwr sectors (1027 MB)
Sep 8 22:25:16 Acer kernel: sda: Write Protect is off
Sep 8 22:25:16 Acer kernel: sda: assuming drive cache: write through
Sep 8 22:25:16 Acer kernel: sda: sda4
Sep 8 22:25:16 Acer kernel: sd 1:0:0:0: Attached scsi removable disk sda
Sep 8 22:25:16 Acer kernel: sd 1:0:0:0: Attached scsi generic sg0 type 0
Sep 8 22:25:16 Acer kernel: Vendor: Model: USB DISK Pro Rev: PMAP
Sep 8 22:25:16 Acer kernel: Type: Direct-Access ANSI SCSI revision: 00
Sep 8 22:25:16 Acer kernel: SCSI device sdb: 2880 512-byte hdwr sectors (1 MB)
Sep 8 22:25:16 Acer kernel: sdb: Write Protect is off
Sep 8 22:25:16 Acer kernel: sdb: assuming drive cache: write through
Sep 8 22:25:16 Acer kernel: SCSI device sdb: 2880 512-byte hdwr sectors (1 MB)
Sep 8 22:25:16 Acer kernel: sdb: Write Protect is off
Sep 8 22:25:16 Acer kernel: sdb: assuming drive cache: write through
Sep 8 22:25:16 Acer kernel: sdb: unknown partition table
Sep 8 22:25:16 Acer kernel: sd 1:0:0:1: Attached scsi removable disk sdb
Sep 8 22:25:16 Acer kernel: sd 1:0:0:1: Attached scsi generic sg1 type 0

Capricorny
09-09-2006, 02:46 PM
I have followed the advice completely, but my new ASUS A3Hf was not able to boot from the 1GB Corsair USB stick. I can, however, boot with a 512MB Corsair wirh DSL 3.0.1 installed, so there may be something with some BIOS'es not working well with the larger sticks.

BUT, I'm writing this running that USB install. How could I boot it? By using GRUB already installed on the hard disk, just added an entry in /boot/grub/menu.lst for booting from the USB. Have to fix some parameters, though, because Knoppix came up completely German ;-)

So, the method clearly works well for transferring Knoppix to a USB, but we may still not be able to boot from it. A way out of this may be to install GRUB on a CD, with different options for booting different devices. Then we only need to use the CD for starting up. I think that method may be worthwhile to explore, because USB booting really seems to be an unpredictable mess right now.

Krellan2
09-09-2006, 10:30 PM
Time to sort out how to repartition the whole flash key.....later more on this.
Right now ubuntu mounts them as sda4 (after using mkdiskimage) 1027MB, and sdb 1MB


I thought you could get away with just blowing it all away by writing zeroes to the entire drive with "dd", but since it shows up as two devices, probably not. It's not a standard USB key: it's something else that is "smarter", unfortunately.



Edit: Think i'm screwed with this one. It appears to have firmware installed. The tool on the flash key: UDPV264.exe, i found a newer version, wich has an extra option of resizing the secure area, but trying to use that it stated Firmware not supporting option. How to get this mother to work.....to start i looks to behave as a usb-hub, ie 2 separate devices, sda and sdb.....


If you can get the firmware tool running, maybe you can get rid of the "secure area" entirely. Then, if it just shows up as a single device, you can erase that and just use it as a single drive.

Krellan2
09-09-2006, 10:36 PM
I have followed the advice completely, but my new ASUS A3Hf was not able to boot from the 1GB Corsair USB stick. I can, however, boot with a 512MB Corsair wirh DSL 3.0.1 installed, so there may be something with some BIOS'es not working well with the larger sticks.

That's the same reason I bought a 1GB drive for $58, when 2GB drives were just $80, not all that much more.

I don't trust the BIOS to boot pretty much anything right these days, and going over 1GB would break the USB-ZIP standard, as it would then go over 1024 "cylinders". So, I'm sticking with my 1GB drive.


BUT, I'm writing this running that USB install. How could I boot it? By using GRUB already installed on the hard disk, just added an entry in /boot/grub/menu.lst for booting from the USB. Have to fix some parameters, though, because Knoppix came up completely German ;-)

That's clever, but kind of defeats my purpose of wanting Knoppix bootable on a USB key: to be able to take it to all different computers everywhere, and have something that I can still boot from, no matter what's on the hard disk.


I think that method may be worthwhile to explore, because USB booting really seems to be an unpredictable mess right now.

That's putting it mildly. I'm amazed at the sheer incompetence of BIOS programmers these days. I really wish the BIOS would be split up into two parts: the motherboard-specific stuff that the motherboard maker puts in (the BSP), and then, a generic part that does all the menus, booting, etc. that people could reprogram and fix bugs on.

Krellan2
09-10-2006, 12:56 AM
OK, got a new USB key that works again! I burned out my old USB key testing it all (http://www.knoppix.net/forum/viewtopic.php?t=25402) these (http://www.knoppix.net/forum/viewtopic.php?t=23558) times (http://www.knoppix.net/forum/viewtopic.php?t=23431). :)

I only found one computer in which my earlier "strategy guide" failed to boot after being detected. It seemed to have some trouble recognizing the FAT32 filesystem, which is strange, because it worked just fine on other computers that were capable of detecting USB keys at bootup. Someone recommended that I try FAT16, and I did this on my new key. When I get access to this one computer, I will test it again.

Here's the changes to make, to use FAT16 instead of FAT32, above:

* Delete the reference to editing the mkdiskimage script.

Just leave the mkdiskimage script alone. :)

* Omit the -F flag to the mkdiskimage command.

The new command line becomes:


mkdiskimage -4 /dev/sdz 0 64 32

All other steps are the same.

FAT16 is not as efficient as FAT32 when dealing with disks that contain a lot of files, but that's not a big problem for Knoppix, as Knoppix stores all of its files inside one big compressed file anyway.

FAT16 also has the 2GB barrier. This isn't a problem, for my 1GB USB key. I could have bought a 2GB key, but chose not to, for greater reliability. There's a problem going over 1GB: the USB-ZIP standard will fail, as it will then go over 1023 cylinders, making its CHS layout impossible.

The solution for larger keys is to use USB-HDD, the default, and just blow off USB-ZIP support entirely. Thankfully, most newer BIOS's all boot USB-HDD by default anyway.

The strange thing is that my main PC's BIOS now recognizes my new USB key as a CDROM! Great, just what we need, a third booting standard. :) But, everything seemed to work correctly, as I'm typing this from my booted Knoppix USB key now.

Next USB key I'm going to buy will be a 5GB key, whenever they get around to finally making them. Then, we can go on to the extra challenge of getting the Knoppix DVD to boot from a USB key....

Krellan2
09-10-2006, 02:00 AM
What a great write-up. I hope that you will consider putting a copy in the wiki where it will be easy for people to find.

There, I did!

http://www.knoppix.net/wiki/Bootable_USB_Key

Not sure how to push this page into the overall index so that people will find it, though....

Capricorny
09-10-2006, 10:01 AM
BUT, I'm writing this running that USB install. How could I boot it? By using GRUB already installed on the hard disk, just added an entry in /boot/grub/menu.lst for booting from the USB. Have to fix some parameters, though, because Knoppix came up completely German ;-)

That's clever, but kind of defeats my purpose of wanting Knoppix bootable on a USB key: to be able to take it to all different computers everywhere, and have something that I can still boot from, no matter what's on the hard disk.

Sure it defeats mine too! But, I think it is a partial solution: Seems to be no way I can get that 1GB stick to boot on the two laptops I try, but installing GRUB on a smaller stick and start other devices from that would give us the "write once, run anywhere" we want. And preparing a boot CD should let us run it from most newer computers.

I think I'll stick with FAT32, for one of the next steps will be to use a 4GB stick, and setting up a structure similar to /usr/local for non-package installs. I have used that for Java, Wine and Mono, and things I occasionally compile myself, like PHP.

RandomGoon
10-19-2006, 03:53 PM
If this would work with a 6GB HDD from a laptop on a USB dongle...

I presume there should be some tweeking of the setup to account for actually using a hard drive with CHS information but being new to this deeper section of the pond I don't know what I should do. Anyway, from looking at the files on the DVD I don't see anything that breaks the 4GB barrier for FAT32 so I doubt I "need" any other file system (wouldn't hurt if I did tho - I only intend this to play around with).

Eagerly awaiting results,

'Goon

rajbabu
11-22-2006, 01:28 AM
Hi Krellan,

Heads up for the awesome post on how to get the Knoppix to boot from thumbrive. I am quite new to Linux allthough i have considerable experience in windows/dos when it comes to Linux i am im still in infancy. I have
some issue in getting my system to boot from thumbdrive i have followed your instruction step by step but im am stuck at the part where i need to load the bootloader into my new partition. Knoppix recognize my thumbdrive as sdb1 when i type cfdisk /dev/sdb1 this is what i see

name flags part type FS type Label Size (MB)
----------------------------------------------------------------------------------------------
sdb1p4 boot Primary W95 FAT32 (LBA) 1047.53


when i type the command syslinux -s /dev/sdb14
i get this following error message /dev/sdb14: No such file or directory.

no matter in what combination switch i type either /dev/sdb14 or /dev/sdb1p4 i get the same error message
i desperately need a helping hand here.

Thnks in advance.

Krellan2
11-22-2006, 03:07 AM
Hi Krellan,

when i type the command syslinux -s /dev/sdb14
i get this following error message /dev/sdb14: No such file or directory.



That's the problem right there. Using /dev/sdb14 refers to the 14th partition of the /dev/sdb disk, which is not what you want.

You have an old DOS/Windows partition still on your USB key, at /dev/sdb1 (the 1st partition).

You need to completely remove this partition first.

Did you remember to zero out your entire drive first?
That will erase all partitions.

This is the dd if=/dev/zero step. It's one of the first steps to do.

See the page:
http://www.knoppix.net/wiki/Bootable_USB_Key

rajbabu
11-23-2006, 03:28 AM
I did perform the dd if=/dev/zero of=/dev/sda1 and this is what i see in cfdisk after performing that

Disk Drive: /dev/sda1
Size: 1048543744 Bytes 1048 MB
Heads: 33 Sectors per track: 61 Cylinders: 1017

Name Flags Part Type FS Type [Label] Size (MB)
-------------------------------------------------------------------------------------------------------------------------------
Pri/Log Free Space 1048.18



and afterwhich when i type mkdiskimage -F -4 /dev/sdz 0 64 32 to create a partition subsequently this is what notice in fdisk

Disk Drive: /dev/sda1
Size: 1048543744 Bytes 1048 MB
Heads: 64 Sectors per track: 32 Cylinders: 999

Name Flags Part Type FS Type [Label] Size (MB)
-------------------------------------------------------------------------------------------------------------------------------
sda1p4 Boot Primary W95 FAT32 (LBA) 1047.53


i reckon the problem lies with mkdiskimage command probably its need a slight adjustment on my end to make it work. Please advise further
meanwhile i will look for other alternative way in booting from thumbdrive as well.

!! cheers !!

Krellan2
11-23-2006, 07:24 PM
I did perform the dd if=/dev/zero of=/dev/sda1 and this is what i see in cfdisk after performing that

Oops....

You did of=/dev/sda1 which is wrong.

It should have been of=/dev/sda to erase the entire disk.

What you did was erase just the first partition.

There's a big difference between sda1 (first partition of the disk) and sda (entire disk)!

You need to erase the entire disk, including the partition table, so that mkdiskimage can lay down a brand-new partition table for you.

Please read the commands very carefully before typing them in. One misplaced letter or number can be critical!

rajbabu
11-24-2006, 01:43 AM
i had to type if=/dev/zero of=/dev/sda1 because thats what knoppix recognize the thumbdrive as SDA1 with the thumbdrive icon. The results i shared previously in cfdisk indicates 1gb free of thumbdrive not the hardisk no where in my hardisk do i have a space of 1gb. Futher more i can boot to windows w/o any issues at all. plus when i do formatting i can notice the led of my thumbdrive rapidly flashing.

As mentioned before i will look for alternatives i found this cool website with an extremely easy steps to to get Knoppix booted from thumbdrive i did all this in less then 5 mins apart from Knoppix ISO extraction to the thumbdrive that took about 20mins the best part is this would work regardless the of the size of the thumbdrive. and here is the link. http://www.pendrivelinux.com/2006/08/29/boot-and-run-knoppix-from-a-usb-flash-memory-stick/

I would still give a try of your method if you share on how to adjust the mkdiskimage command to suite my thumbdrive. Mine is 1gb avixe usb 2.0.

Its so much convinent to run knoppix from thumbdrive versus the cdrom the latter will cause sluggish performance when you navigate through the OS frequently it will stop and read the content from cd before continuing this can be as fast 1sec or at time slow then 3 to 5 secs. Im glad that im finally able to run my knoppix from my thumbdrive.

and krellan keep up the good work.

Krellan2
11-26-2006, 09:31 AM
i had to type if=/dev/zero of=/dev/sda1 because thats what knoppix recognize the thumbdrive as SDA1 with the thumbdrive icon.

No, really, trust me, you have to type if=/dev/zero of=/dev/sda NOT sda1.

We're trying to erase the entire USB thumbdrive here, not just the one partition that Knoppix has recognized.

We're trying to erase the ENTIRE disk, not just ONE partition. That's the big difference between sda and sda1.

One of the hardest things for new Linux users, coming from Windows, is the difference between partitions and disks. Most Windows people use only one partition per disk, and treat them interchangeably, so they don't even know that there is a difference.

Erasing one partition isn't good enough for mkdiskimage. You have to start with a completely clean erased disk, including the partition table itself, and this can only be done by erasing the entire DISK with /dev/sda, not just one PARTITION with /dev/sda1.


http://www.pendrivelinux.com/2006/08/29/boot-and-run-knoppix-from-a-usb-flash-memory-stick/

This method is really similar to mine, except that it's done entirely from within Windows instead of Knoppix itself.



I would still give a try of your method if you share on how to adjust the mkdiskimage command to suite my thumbdrive. Mine is 1gb avixe usb 2.0.


If you have a 1GB thumbdrive, no adjustment is needed.

If you have a 2GB or larger thumbdrive, check my Web page, I posted some alternate mkdiskimage command lines you can try. They are near the bottom of the page.

http://www.knoppix.net/wiki/Bootable_USB_Key



Its so much convinent to run knoppix from thumbdrive versus the cdrom the latter will cause sluggish performance when you navigate through the OS frequently it will stop and read the content from cd before continuing this can be as fast 1sec or at time slow then 3 to 5 secs. Im glad that im finally able to run my knoppix from my thumbdrive.

and krellan keep up the good work.

Thanks! Yes, it is so much faster to run Knoppix purely from a USB key. It is slow to boot up, but once it gets going, it is incredibly fast, because there are no CD startup and seek times at all.

Godfearer22004
12-01-2006, 01:35 AM
Krellan2,
Thank you so much for the great posts and the wiki page. Finally some one who's talking English!

I followed the instructions given on the Wiki page and have the Knoppix image on a Fat 16 Flashdrive (I think). However the BIOS seems to simply be glazing over it and I'm not seeing any indication that the BIOS even knows its there. The 1GB Flashdrive is plugged in to built-in USB ports. My BIOS allows me to put "Removable devices" in the boot order, which I have done. I have put "Removable Devices" before the Harddrive with XP on it.

I'm confused.

I have tried it on a few computers, with similar results. I have been working on this a few times, and in previous attempts used tohd=/dev/sda1 in the boot command. I was able to use boot from the Flashdrive using fromhd=/dev/sda1
IF
I had the Knoppix cd in the CD drive. In this scenario the BIOS boots from the CD perfectly. It is also able to use the Knoppix image on the Flashdrive created by the tohd=/dev/sda1 command by Fromhd=/dev/sda1.

HOWEVER
The BIOS would treat the Flashdrive exactly as it does now, as if it didn't see it.

Initially I thought I would need to install GRUB or LILO onto the Flashdrive. But didn't know how to use these, and couldn't find understandable instructions. (I guess that's the catch with Linux right?):)

My goal is to create a perfectly portable OS that boots and has a PH on the Flashdrive. (Thus, I would be able to walk up to any BIOS supporting computer and boot into my desktop!)

Is this possible? I think your thread says it is...I just can't figure it out.

Have I done something wrong? Does the BIOS settings for Legacy support affect the matter? Do I need to use Fat32 instead of Fat16? ANY help in this matter would be helpful!

Thanks again

Godfearer22004

Krellan2
12-01-2006, 02:35 AM
Krellan2,
Thank you so much for the great posts and the wiki page. Finally some one who's talking English!

I followed the instructions given on the Wiki page and have the Knoppix image on a Fat 16 Flashdrive (I think). However the BIOS seems to simply be glazing over it and I'm not seeing any indication that the BIOS even knows its there. The 1GB Flashdrive is plugged in to built-in USB ports. My BIOS allows me to put "Removable devices" in the boot order, which I have done. I have put "Removable Devices" before the Harddrive with XP on it.


I don't think "Removable devices"is it. The USB drive, if detected, would probably present itself as a "hard disk", and show up under there, depending on the BIOS. Mine does. Under the menu of "hard disks", you see your USB drive's name. It is strange, but that's how it is.



I have tried it on a few computers, with similar results. I have been working on this a few times, and in previous attempts used tohd=/dev/sda1 in the boot command. I was able to use boot from the Flashdrive using fromhd=/dev/sda1
IF
I had the Knoppix cd in the CD drive. In this scenario the BIOS boots from the CD perfectly. It is also able to use the Knoppix image on the Flashdrive created by the tohd=/dev/sda1 command by Fromhd=/dev/sda1.


That's good, it means Linux is seeing your USB drive just fine. Knoppix has already booted from the CD, at that point. But, that still doesn't help us with the BIOS.

I'm guessing your BIOS didn't detect the USB drive, unfortunately. Maybe try again, trying some suggestions I put on the wiki page.

It's a real shame that BIOS manufacturers are so sloppy in their handling of USB drives. Until it really gets fixed, USB booting will remain somewhat of a novelty -- just like CDROM booting did, in the early 1990's, before everybody got their act together.

martinveasey
12-04-2006, 11:37 AM
There, I did!

http://www.knoppix.net/wiki/Bootable_USB_Key

Not sure how to push this page into the overall index so that people will find it, though....

Great work on the Wiki. However, I've got a couple of questions:

- How would one alter the instructions to achieve the same end but as USB-HDD rather than USB-ZIP. Is it as simple as just using Partition 1 rather than Partition 4 and how would one do this?

- I can't get my USB Key to boot correctly / at all - it is simply ignored at boot up. Is there a way of checking that I've done the partitioning, formatting, loading process correctly. At the moment, I don't know if it's a BIOS problem or a user problem in using your Wiki?

Many thanks, if you can help.

Martin

Godfearer22004
12-04-2006, 01:59 PM
I also am interested in martinveasey's questions. After my attempts at Bootable USB, I had moved on to trying to use Partition 1 instead of 4, but with similar results as before. I eventually settled on a Persistent Home and a freed-up CD.

"
- I can't get my USB Key to boot correctly / at all - it is simply ignored at boot up. Is there a way of checking that I've done the partitioning, formatting, loading process correctly. At the moment, I don't know if it's a BIOS problem or a user problem in using your Wiki? " -martinveasey

Yes, is there any way to check this? This would really help!

Thanks again.

Godfearer22004

Krellan2
12-04-2006, 08:50 PM
- How would one alter the instructions to achieve the same end but as USB-HDD rather than USB-ZIP. Is it as simple as just using Partition 1 rather than Partition 4 and how would one do this?


To my knowledge, USB-HDD is simply a relaxation of the USB-ZIP "standard".

Here's what makes USB-ZIP special:

It uses partition 4, not any other partitions
It uses CHS (cylinder head sector), not LBA, when booting the disk
It uses a variable number of cylinders, but it must use a constant 64 heads and 32 sectors
It has a maximum of 1GB in size, due to CHS's limit of 1024 cylinders

USB-HDD is simply a relaxation of these requirements, I think.

You can use whatever partition you want
You can use LBA, and in fact, it is highly recommended to do so
You can use 255 heads 63 sectors (the maximum allowed)
You can use a disk of whatever size you want

If this is wrong, please correct me.



- I can't get my USB Key to boot correctly / at all - it is simply ignored at boot up. Is there a way of checking that I've done the partitioning, formatting, loading process correctly. At the moment, I don't know if it's a BIOS problem or a user problem in using your Wiki?


In my Wiki page, I have a little checklist of 5 things you can try. It's about halfway down the page. I had to do each of those steps at various times, trying to get the BIOS on several different computers to correctly see the USB key.

I'm not sure how you would go about verifying that you got it set up correctly to boot. If you have an old small hard drive, around 1GB in size, that you know for sure that your BIOS will always recognize, you can try reformatting that old hard drive in exactly the same way you would the USB key. Then, try booting from the hard drive.

Linux is good about treating block devices all the same: the steps you use for the hard drive will work identically to the USB key. You can then use that hard drive for Knoppix :)

martinveasey
12-05-2006, 03:50 PM
In my Wiki page, I have a little checklist of 5 things you can try. It's about halfway down the page. I had to do each of those steps at various times, trying to get the BIOS on several different computers to correctly see the USB key.

I'm not sure how you would go about verifying that you got it set up correctly to boot. If you have an old small hard drive, around 1GB in size, that you know for sure that your BIOS will always recognize, you can try reformatting that old hard drive in exactly the same way you would the USB key. Then, try booting from the hard drive.

Linux is good about treating block devices all the same: the steps you use for the hard drive will work identically to the USB key. You can then use that hard drive for Knoppix :)

Many thanks for that. Interestingly, after prodding and poking around a bit, the boot is now working.

It won't help anyone else, but I think I'm sorted out.

Martin

Godfearer22004
12-05-2006, 07:11 PM
What did your BIOS see it as? Was it a "Removable Device" Or USB-HDD or Just HDD or what?

Godfearer22004

martinveasey
12-14-2006, 03:28 PM
What did your BIOS see it as? Was it a "Removable Device" Or USB-HDD or Just HDD or what?

Godfearer22004

It showed as USB-HDD

jasonl
12-27-2006, 04:44 PM
I tried folllowing the procedure to create bootable USB key but get the following message "syslinux: this doesn't look like a valid FAT filesystem". The message appears when I run the "syslinux -s /dev/sda4" command. I used the following mkdiskimage command to partition and format the key: "mkdiskimage -4 /dev/sda 0 255 63" I have also tried using the -F parameter. I should mention that it is a 2GB memory key.

jimmyG
01-06-2007, 12:37 AM
Hi, I'm pretty new to Linux, but I think it’s quite cool so I tried out Knoppix from USB.

My problem is, that I can boot it alright, but after the screen where you can enter the cheat codes, i press enter, it goes to the other screen, starts to boot.... and then it searches for USB devises.

When it does this, my USB Key seems to disconnect, and it stops loading. :?
Any ideas what I can do?

Thanks for your help :)


EDIT: Not to worry, i managed to get it working :D

NAvAP
01-08-2007, 04:08 AM
Is there a way to either make another partition or hide the Knoppix related files from showing up when the usb drive is inserted into Windows.

Or at the least be able to put both the Boot and Knoppix folder into one folder '~' so that it would be at the top and out of the way for any other software I put on the drive. It's a 4GB drive so I will be putting alot of Windows software on there as well.

xtronics
01-15-2007, 08:38 AM
I've found it easy to make copies of this boot drive with:

dd if=/dev/sdx of=/dev/sdy

You can even keep a back-up as a file

dd if=/dev/sdx of=/path/to/backupname

I am trying to make a grub setup where I can choose to boot into freeDOS.

pintree3
01-19-2007, 05:25 AM
Maybe I shouldn't be here since much written here is for more experienced users--if so feel free to tell me off but be nice enough to redirect me to where I should be.

see PC specs at end

In the Knoppix info page (www.knopper.net) ' it says as minimum requirements, 'Intel-compatible CPU' is AMD an Intel compatible? or is AMD, amd and therefore have nothing to do with Intel. Sounds like a stupid Q but 'compatible' can mean 'anything like it' therefore AMD or can mean Intel and only Intel.

Assuming AMD is fine, the next stuff I read has to do with NTFS-where problems arise. Here I got confused, since I assumed we are talking about booting from Knoppix, then this would over-ride anything to do with Windows and the fact that the drive was configured as NTFS. Or am I wrong here?

I can not burn Knoppix to CD hence my need for having done so to a USB 1G flash drive. I configured my BIOS to boot from the USB (the acceptable one being USB.zip) and it begins booting, the POST shows the flash drive, it then shows, "Verifying DMI pool Data" The flashing cursor can be seen write below it and nothing else happens.
Yes i did check the iso with the suggested software, so the download is complete and proper. I used daemon tools to get the image. I then copied all files within it to my USB. I then renamed the USB flash to KNOPPIX.

Now, should the following be of relevance I will etll you why I feel a need for this LiveCD. And it is because I can not boot into my Windows. Even after a chkdsk, Recovery Console command, 'fixboot' and reformatting the C: drive before and after the above. I keep on getting the "invalid partition table' message.

OS: Windows XP home OEM
Hardware: Computer: no brand name --OEM
AMD 64 Athlon 3500+,
MSI ‘K8N Neo4 motherboard, nVidia chipset based
nVidia GeForce LE Graphics card.
RAM 2 gig,
DVD: LiteOn DVD-rw SHM
CD: Lite-on LTR-52246 (CD-rw)
Floppy: none
Kitchen Stove: Just kidding ;-)
BIOS: Award ver. V1.D 052206 11:35:51
Note: in BIOS Standard CMOS settings IDE Primary Master and Slave are set to [none]. The Secondary Master is the DVD drive and the Secondary Slave is the CD drive. While the IDE Third Master is the HD ‘WDC WD1600JS-60MH
Drive C: and D: NTFS Drives E: and F: FAT32

This is way too long so you may not want to read further but just in case someone wants to know what the original problem as and why I came here I have included it.

Brief description, (Should you not have time to read the rest):
Windows XP home begins installing then after it reboots it begins the process again as if it never formatted or began installation. If I change the boot order (from CD 1st to HD 1st) It will read “Invalid Partition Table�. Prior to this attempt at installing Windows, it would not start neither in safe mode, safe mode with command prompt, previous installation, etc.

How the problem may have come about:

All was working relatively fine (‘relatively’ because I was having a problem with the computer hanging when going online possibly due to some ignorant use of a registry cleaner). Anyhow, all was working ‘relatively’ fine for the last 2 months, then after a torrent DVD download was complete I, on my uTorrent client, accidentally clicked on “Delete Torrent and data�. I then proceeded to use about 15 unerase/recovery programs most of which gave negative results—One found what I had lost but being trial I was not able to retrieve these files without payment. During this process the computer was rebooted 3X without problems and hung during the use of one program called ‘iRecover’ [It had previously warned me that my nVidia Chipset may cause problems and that a hanging may occur and if it did to change to the windows driver. Therefore after the hang I did reboot and uninstalled this software]. The reboot was normal.

After this reboot and uninstall I ask myself the question, “Is it worth it for me to pay for this software for only this one DVD?� Saying no I made my big mistake-perhaps. I go to serial/hack pages trying to find a serial key. As I go from page to page I decide this is not a good idea.
Meanwhile uTorrent downloading stuff; I continue to do email; use “Microsoft Word�, listen to music, and view pictures. This goes on for hours.

The following day, having realized that I haven’t rebooted my computer in a day I do so but now it hangs. I wait about 5 minutes and force a shutdown. It did not reboot. It went to the step ‘Windows is loading’ and nothing further. I rebooted a few times to no avail.

My 160 gig HD is divided into 4 partitions—C, D, E, F, where ‘C’ is where the OS was. C and D were NTFS partitions and E, F were FAT 32.

I place my Windows XP Home Edition CD (OEM legitimate copy) in the DVD Drive rebooted changed the boot order to choose DVD drive first but nothing happened. By this I mean nothing—the computer did not start, did not recognize the CD etc. It stopped at a dim light-blue screen—not the usual bright blue screen.

Remembering a past trick I placed a “Windows 98SE� CD and it did boot up to it. And here I saw something funny it said that Volume drive label C was my E, that Volume drive D was F etc. subsequently a ‘dir’ command did show that in fact the files in C were actually those of E etc.(In seeing this I asked is this correct or is this Windows98 thinking wrongly).

I then did a ‘chkdsk’ and had many prompts warnings of a sort whereby I chose one of them. [My apologies here for not being able to give more details for my memory fails me]. Thinking this was a bad idea. I rebooted.

Luckily, or so I thought, it now did recognize the Windows XP Home CD. But then the next bad news—there was no “C� drive. I chose the 1st top as the place to put my NTFS installation—which then became “Partition1 [New RAW]�. BTW the size for the partition was already there.

The copying files and all that begins—I am happy but worried since Win98 CD said that C was E (Was I. I asked myself, therefore formatting and deleting my E drive contents since C was maybe E?). The initial copying finishes and the PC reboots. But it won’t recognize that an installation has begun and instead the process of installing Windows begins. I did so again and again and….but same story. Each time changing the BIOS setting for the boot sequence.

One may note that it took a very long time, about 10 minutes, for the PC to reboot and recognize the cd. Then on the 2nd reboot I waited about another 5 minutes and this time I got the 3 choices, -1- install, -2- Recovery Console -3- reboot

I chose recovery console and in the black screen a ‘dir’ command showed the 4 partitions normally (unlike windows 98 but do recall a formatting of ‘C’ has happened by now).
I formatted the drive and through RC (recovery console) formatted the C drive again and reinstalled, again after the reboot Windows did not recognize that an installation had begun.
Back to the long wait and RC. This time I do the following command (without the quotes, naturally�): “format C: /fs/ntfs�
And nothing, all is the same as before. Back to RC and I do the following command on all 4 drives: “chkdsk /p /r�. RC finds irrecoverable errors on C, finds and recovers some errors on the other 3 partitions. (a future chkdsk on c: I ‘think’ did not find irrecoverable errors)

On reboot the screen asks for installation/setup; I do so and this time there is a ‘C’ drive so portioning/formatting is done on this C drive. But again and again the computer doesn’t recognize that an installation had begun. If I go to my BIOS and choose to boot from the HD (and do so) I see the following, “Invalid Partition Table�.
Back on RC (Recovery Console) I did a ‘Fixboot’ command and still nothing.
I hesitate to ask, “Where did I go wrong� for your list may be endless.
Note: On my PC details above I showed that the IDE Third Master is my HD. When I boot up I don’t see this IDE Third Master—the screen goes up too quickly and pressing the pause key on the keyboard doesn’t seem to work—so maybe it’s there or maybe it isn’t all I do get to see is the DVD and CD drives. Going on the Recovery Console however does show the drives and its contents so, one could assume the hard rive ‘is’ there.

I have thought of formatting the other 3 partitions as well but I really need the stuff (stupidly unbacked up) on them. If I must, I can repartition/format my ‘D’ [ ‘E’ and ‘F’ have important personal info, like letters, and other stuff.].

One Google search showed that the problem may be bad RAM, the PC is 4 months old, and to the best of my knowledge and according to a RAM testing software it is fine. If it is a boot virus I have no clue how to do anything about this.

There is one command on RC that I question if I should use—‘FIXMBR’. A help on it says, If FIXMBR detects an invalid or non-standard partition table signature, it prompts you before rewriting the master boot record [MBR]�. I tried the command and it said, that ‘it may damage all my partition tables. This could cause all the partitions on the current hard disk to become inaccessible.� So I cancelled it. Finally, in rebooting I do get a short beep, which, according to A BIOS website may mean, “DRAM refresh failure’.

So what does one suggest? I do have an external 30G hard drive (USB connection) and a 1Gig flash drive, and my 4-year old Acer TravelMate 270, all of which I hopefully can use to help this if necessary.

You have read this far, you are a hero and worthy of praise.

Harry Kuhman
01-19-2007, 05:34 AM
Pintree3: AMD is fine. UBS booting is very problem prone however. many computers that claim to be able to boot from USB in the BIOS just will not do it. Others make an effort but still have problems. Good luck to you, but if you are having problems getting your system to boot USB it might or might not be that the device was set up wrong.

I strongly suggest that before you fool with this falsh device further you run Knoppix from a disc as it is intended. You make a vague statement that you can't make a CD, but I have no idea why. If all else fails put that ISO (I assumed you confirmed the md5 sum) onto the flash device and take it to a friend who could burn the ISO, burning it properly, as an image (see the downloading faq for details if needed).

pintree3
01-19-2007, 10:23 AM
HI thanks bro--truly thanks

What I meant by i could not make a CD was that my cd and dvd burner is attatched to the defected PC and my laptop does not have a burner. BUt yes having realized that it was meant to be burned to CD i went over to a friend's and did exaclty that--and voila, though slow to get there, it did. And wow, what a surprise this LInux thing seems to be truly wonderful--WHy did I wait so long? (fear).
But now that I am there (and no I'm not writing to you thru it) I have no clue as to how I can move my folders from the drives to an external USB HDD or my laptop. What I am seeing is, 'sda5, sda6 etc.' instead of C:, D: etc. I tried to copy (Can't find how to move) but I get an error saying I can't do so (the exact message from the conqueror window is, 'Could not write to /media/sda7/ninjaiBird.jpg'). When I R-click on 'Copy to' I do see the actua; drives as written by WIndowsXP but how do I get there (the the C, D, instead of sd5, sd6)?

side note: the error message seems to say that it can't write to the jpg? how can this be so? Of course it can't writ to a jpg. I am r-clikcing on the jpeg which I want to copy to another folder and then it is saying it can't write to itself but on another folder? Confused!! I don't want to writ to the jpg I want to copy that jpg to another folder/drive.

Harry Kuhman
01-19-2007, 09:33 PM
Sounds like you need to do some reading. These questions have been covered in these forums many times before, as well as elsewhere on the web. I'll give you some quick answers but will not wite a full Linux tutorial however.

Windows uses letter like C and D for partitions. They don't tell you much and can even move around under windows when you add new partitions (breaking installed software). Linux uses discriptive names, like hda for the first hard drive on the primary IDE connection, and hda1 (note the number) for the first partition on hda. hda5 is the first logical drive (partition on an extended partition). These letterrs will not move unless you recable drives. Different type of interfaces use different letters, such as sda1 being a partition on a serial or usb device (or maybe scsi).

You can use the mount command (see man mount) to mount partitions, or you should be able to click on desktop icons that Knoppix uses to show you the partitions that you have. See answer 6 (http://www.knoppix.net/wiki/User:Harry_Kuhman) for details about making the partitions writeable, for safety reasons Knopppix defaults to read-only mounting.

If you are about to embrace Linux fully and move lots of stuff to it, I would urge you to consider the final goal here. Knoppix is a fine Live CD. It's not so great as a permanent OS. You would likely be much better off, if you like Knoppix, to install Debian, the intended for hard disk OS that Knoppix is based on. You can get the net-install ISO for Debian Etch here (http://www.debian.org/devel/debian-installer/). Yes, it's an iso, so you would either make another trip to your friend, or you can burn the ISO directly in Knoppix, but doing a CD burn in Knoppix requires that you have the disc drive free, so you'll either need two optical drives or a gig of memory to let you use the knoppix toram cheat code at boot time to load all of Knoppix to memory and free up the CD burner. (There are smaller Linux Live CDs like DSL (http://www.damnsmalllinux.org/download.html) that are handy to have for just this reason, they can be loaded to RAM in most systems and will free up the CD drive for burning.)

Welcome to Linux. Be warned that all is not roses here; in particular wifi support is not great and thanks to more and more manufacturers making drivers that are Windows only it's getting worse, not better, but there are more positives than negatives.

gturrill
01-22-2007, 05:09 AM
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.
and 5.1.1 on a 2Gb key too. I am composing this in Iceweasel after booting from the 2gb key. I followed Krellan2's instructions, with the modification for the 2Gb drive.

I am running a Dell Latitude D820 with an 80Gb SATA drive which is setup to dual-boot WinXP and Fedora Core 6. The NTFS partition is /dev/sda2 and the USB is /dev/sdb4.

when Knoppix sets itself up, it mounts the /dev/sdb4 partition as /cdrom, which is fine, but it also mounts /dev/sda2 as /cdrom as well. If I attempt to umount /cdrom I get the message that /cdrom is mounted multiple times.

Is there a way to prevent /dev/sda2 from being mounted as /cdrom. I have include the /etc/fstab from the Knoppix session below


knoppix@Knoppix:~$ cat /etc/fstab
/proc /proc proc rw,nosuid,nodev,noexec 0 0
/sys /sys sysfs rw,nosuid,nodev,noexec 0 0
/dev/shm /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
/dev/pts /dev/pts devpts mode=0622 0 0
/dev/fd0 /media/fd0 auto user,noauto,exec,umask=000 0 0
/dev/cdrom /media/cdrom auto user,noauto,exec,ro 0 0
/dev/hdc /media/hdc auto users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0
# Added by KNOPPIX
/dev/sda2 /media/sda2 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppi x 0 0
# Added by KNOPPIX
/dev/sda5 /media/sda5 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0
# Added by KNOPPIX
/dev/sda6 /media/sda6 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda7 /media/sda7 auto noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sdb4 /media/sdb4 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0

MrGreen
01-26-2007, 07:15 PM
Hi,

I have just manages to get knoppix [5.1.1] on my TrekStor 8g pendrive without too many problems

mkdiskimage and copying over files too forever lol but it worked

wiki page does not mention read/write mode for device?

I'm very happy all I have left to do is some tweaks to syslinux.cfg maybe set home a persistent home then good to go....

Thanks for a great howto & for sharing

MrG

Krellan2
01-27-2007, 02:58 AM
Hi,

I have just manages to get knoppix [5.1.1] on my TrekStor 8g pendrive without too many problems

mkdiskimage and copying over files too forever lol but it worked


Nice. You might be the first in this thread to try on an 8GB USB key.

Yes, mkdiskimage would take a long time. It reformats the entire key.

What was the mkdiskimage command you used? I'm guessing it was something like:
mkdiskimage -F -4 /dev/sda 0 255 63

You'd have to use 0 255 63 instead of 0 64 32, since 0 64 32 is only for the old USB-ZIP "standard" which maxes out at 1GB.

You'd have to use -F, for FAT32, since FAT16 maxes out at 2GB.

8GB is the barrier at which the old CHS standard also maxes out. I'm surprised it was able to work at all. Your USB key must be just under 8GB, perhaps 7.62 GB or so. 8,000,000,000 bytes to the company's PR department, but 7.62 GB to you :)

It's good to be a little under 8GB because your cylinder count will still be under the 1024 barrier. I'm guessing your cylinder count was around 972 or so.

Once we get USB keys above 8GB, the CHS standard won't work any more, and I have some ideas for working around that. A starting point is to hack the mkdiskimage script slightly, to change the FAT32 partition type byte it creates, from 0x0B (FAT32 CHS) to 0x0C (FAT32 LBA).



wiki page does not mention read/write mode for device?


Not sure what you mean by this. Edit the Wiki page, if you feel that it is missing an important piece of information.



I'm very happy all I have left to do is some tweaks to syslinux.cfg maybe set home a persistent home then good to go....

Thanks for a great howto & for sharing


You're welcome!

I'm envious of your 8GB key, you can put the entire Knoppix DVD (not CD!) on there with room to spare. Big persistent home directory. Then, a full PortableApps installation, for use with Windows. Lots of space left over for transferring files and any additional PortableApps you feel like having. I'll have to pick one of those up myself someday....

MrGreen
01-27-2007, 08:46 AM
Hi,

I mean you have to change read/write mode on mounted device [you know right click icon on desktop]

used


mkdiskimage -4 /dev/sdz 0 255 63

so as you say its just under 8gb [fat16]


sdd4 Boot Primary FAT16 7994.98

Was not my intension to put knoppix on it was more for backup for my laptop ... but as your how to states you need a 1gb or more

Knoppix dvd emmm it would take forever to copy over to key ;-)

Have ordered a 1gb drive so may put 5.1.1 [cd] on that

One thing that I could not get on there was persistent home it ran up to 96% then stopped maybe I could do it from cd & put it on usbdrive

Think lang=<foo> has to go on end of line but I'll check that not sure if its gb or uk lol anyway not a problem

As you say usb booting is hit and miss some machines it works other well nothing I know my old system never worked at all, been running usb knoppix on my laptop no problem ... not tried my desktop yet

Something others may like to try [if not already been said!] is stick a hard drive in an external enclosure small old drives are cheap and easy to pick up, enclosures are not that expensive. Always handy to have for backup ;-)

If you need any testing output or just a beer let me know

MrG

MrGreen
01-27-2007, 08:47 AM
Hi,

I mean you have to change read/write mode on mounted device [you know right click icon on desktop]

used


mkdiskimage -4 /dev/sdz 0 255 63

so as you say its just under 8gb [fat16]


sdd4 Boot Primary FAT16 7994.98

Was not my intension to put knoppix on it was more for backup for my laptop ... but as your how to states you need a 1gb or more

Knoppix dvd emmm it would take forever to copy over to key ;-)

Have ordered a 1gb drive so may put 5.1.1 [cd] on that

One thing that I could not get on there was persistent home it ran up to 96% then stopped maybe I could do it from cd & put it on usbdrive

Think lang=<foo> has to go on end of line but I'll check that not sure if its gb or uk lol anyway not a problem

As you say usb booting is hit and miss some machines it works other well nothing I know my old system never worked at all, been running usb knoppix on my laptop no problem ... not tried my desktop yet

Something others may like to try [if not already been said!] is stick a hard drive in an external enclosure small old drives are cheap and easy to pick up, enclosures are not that expensive. Always handy to have for backup ;-)

If you need any testing, output or just a beer let me know

MrG

Krellan2
01-27-2007, 11:11 PM
Hi,

I mean you have to change read/write mode on mounted device [you know right click icon on desktop]


Ah. Is that just after you finish installing Knoppix to your USB key, and then boot up into Knoppix, but before you create your persistent home dir? If so, then that's what the bind mount commands are doing, in the guide, under the "Make the USB key writeable" section.

I didn't know there was also a way to do it from the desktop :)



so as you say its just under 8gb [fat16]


sdd4 Boot Primary FAT16 7994.98


Wow, I'd be careful with that.

FAT16 maxes out at 2GB, normally.

Windows NT has a variant of FAT16 that uses 64K clusters, so FAT16 created under Windows NT maxes out at 4GB. This variant is unreadable on DOS and Windows 9X (95, 98, ME), though, so it is not recommended.

I don't know anything at all that would work with FAT16 at 8GB. Maybe Linux could do it, but it wouldn't be compatible with Windows at all. If you don't mind losing Windows compatibility, you'd be better off with a native Linux filesystem such as EXT3FS.

I'd try FAT32 instead. Add the -F option to your mkdiskimage command.



One thing that I could not get on there was persistent home it ran up to 96% then stopped maybe I could do it from cd & put it on usbdrive


That may be an indication of something going wrong with FAT16 being used on a disk that is way too large for it.




Something others may like to try [if not already been said!] is stick a hard drive in an external enclosure small old drives are cheap and easy to pick up, enclosures are not that expensive. Always handy to have for backup ;-)

If you need any testing output or just a beer let me know

MrG

Thanks! I could use a beer :)

I have a USB hard drive enclosure myself, 320GB. I'm just using it for data files now, but am thinking about throwing Knoppix on it :)

MrGreen
01-28-2007, 08:42 AM
Its more when you transfer files to usb_drive you cannot copy to device unless you change read/write mode [right click icon on desktop]

Yeah I think now that you have explained it FAT16 on my drive is not a good idea but I was too eager to try it out [my excuse!] I do not use windows here so for me ext3 would be more than good enough

No problem I will try the -F option [fat32] now that I know it works ;-)

Wondering if copying iso image to [normal linux system] then copying over to usb_drive would be much quicker [mount -o loop knoppix.iso /mnt/<point>] ?

Come to think of it I added dma but its not that much quicker so maybe the file system is slowing it done [cannot be sure!]

Would explain persistent home problem [largest I got was a couple of hundred mbs]

I will retry with fat32 [cd] if that feels or runs better than maybe I will try dvd version thats crazy lol

Thanks again for your help

MrG

KiwiDan
01-30-2007, 05:58 PM
Hi there,
I luv the idea of having a portable operating system.
Followed the instruction and have my 1Gb USB drive booting up.
My PC requires I physically remove and reinsert the card each time between boots for some reason but no problem.

I do have one question......
I can not seem to make the sda4 writable, I tried the instructions from the tutorial (mount -o remount,rw /cdrom : mount --bind /cdrom media/sda4)
and also tried the right click and change permissions.
It appears the drive needs to be unmounted and remounted......of course the OS will not unmount while its running from the USB key.

Any suggestions?? Did I miss something???

I would like to install programs ect and have them there next time I boot........

Thanks

MrGreen
01-30-2007, 06:33 PM
Assume you ran commands as root ... ?

KiwiDan
01-30-2007, 06:43 PM
Yes seems to be the case, I ran the Create a persistant disk image util but still seems to be using ram..........
everything is running well but I need to save changes ect

MrGreen
01-30-2007, 08:01 PM
Setting up persistant home did take quite a long time but it worked... I will check sda4 myself [just to be sure it works!]

KiwiDan
01-30-2007, 09:02 PM
ok went through the steps againthe mount -o remount,rw /cdrom ect andsetting up the persistant home. only (20M hope thats enough)
Everything appeared the same, when I boot now I get some options and I change the setting from Cancel to Ok and I now seem to have a constant home directory.
Maybe it loaded past this and I was not watching before???

Maybe a stupid question but what is the best option to select just the default?? any way to make this automatic??
Will try and save some favorites, install some apps and see what happens on a reboot............

MrGreen
01-30-2007, 09:44 PM
Just checked and commands worked ... persistent home is there and loaded [home=scan]

MrGreen
01-31-2007, 02:58 PM
Ok, I have got a 1gb pendrive loaded with Knoppix 5.1.1 usb booting persistent home [256mb] ;-)

upekshapriya
02-07-2007, 12:49 PM
I have been following your very clear instructions but I've got stuck at

syslinux -s /dev/sda4


I get the following response

/dev/sda4: No such file or directory

Even though when I look at it in fdisk I get the following:

Disk /dev/sda: 1023 MB, 1023672320 bytes
64 heads, 32 sectors/track, 976 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sda4 * 1 976 999408 6 FAT16


Any ideas where I could have gone wrong? I am using Knoppix 5.1.1 on an IBM T40 Thinkpad

MrGreen
02-07-2007, 02:39 PM
you checked in /dev that sda4 is there? although its odd that fdisk would pick it up

check the next steps to see if ldlinux.sys is there....

presume device is writeable

HTH

upekshapriya
02-08-2007, 12:40 AM
Thanks for the reply. That's interesting - I'm quite new to Linux and didn't think of checking there, and I found that there was an sda and an sda1 but no sda4! If I put /dev/sda4 I get the message that the folder doesn't exist.

How come fdisk and cfdisk come to that both list sda4 and fdisk labels it /dev/sda4 ? Seems a bit of a contradiction. Any idea how this could come about? Could there be a bug in Knoppix 5.1.1?

upekshapriya
02-08-2007, 03:50 AM
So I used the instructions in http://www.pendrivelinux.com/2006/08/29/boot-and-run-knoppix-from-a-usb-flash-memory-stick/ to put knoppix onto the partition previously created (using windows), however it would be helpful if you could include the procedure for running in root ie setting the knoppix root password and then opening a root shell in order to make the usb writeable - and be able to make the changes to the syslinux.cfg file you suggest.

upekshapriya
02-08-2007, 03:51 AM
So I used the instructions in http://www.pendrivelinux.com/2006/08/29/boot-and-run-knoppix-from-a-usb-flash-memory-stick/ to put knoppix onto the partition previously created (using windows), however it would be helpful if you could include the procedure for running in root ie setting the knoppix root password and then opening a root shell in order to make the usb writeable - and be able to make the changes to the syslinux.cfg file you suggest.

MrGreen
02-16-2007, 08:14 PM
Quick question I would like to update usb drive to 5.1.1 [Beryl!] do I just need the Knoppix dir ?

nestlerv
02-19-2007, 03:16 AM
Hello,

I am trying to get knoppix 5 on my mini-cruzer 1Gb Usb flash drive.

I followed the steps precisely. The drive now boots, it gets passed the boot screen, and the minirt loads. When the screen clears it then hangs on the line

Looking for CD in /dev/sda1

I believe all the files are in sda4. I tried a couple of the cheat codes like boot, bootfrom hd and hdfrom and had them all point to /dev/sda4/. Unfortunately none of these options worked.

Does anyone have any idea what I can do?

Thanks.

MrGreen
02-19-2007, 04:31 PM
Cannot be certain but I think you may have missed a step or used sda1 by mistake...

Please try it again see what happens ....


HTH

330toSRT8
02-19-2007, 11:42 PM
What is the advantage to doing all steps mentioned in previous posts compared to just running this command?
mkbootdev
I clicked through a couple screens and then I had a bootable thumb drive.

Broz42
02-20-2007, 08:46 PM
Hi, I got Kaella 3.1 beta1 (french translation of knoppix 5.1.1) booting on a usb key using the brilliant howto mentioned in this topic. I got the portable home directory as well. The only thing is, Kaella would'nt detect my hard drives correctly now. The symptoms are similar, if not identical, to this post (http://www.knoppix.net/forum/viewtopic.php?p=110792#110792) (cdrom mounted twice, in particular).

Any idea, somebody ?

Thanks

Philippe

330toSRT8
02-21-2007, 05:28 PM
FYI for large thumb drive users.

I used mkbootdev on a 16GB Corsair Voyager flash drive with FAT32. It booted fine on a Dell Latitude D620. I then tried it on a Dell Inspiron 9100, but it didn't work. The first screen came up where you can do boot options, but it would not take any keyboard input; appeared to be locked up.

Godfearer22004
02-24-2007, 11:58 PM
Hello Everyone,
I just thought I would update everyone on my findings just in case any others could benefit. I posted a few months ago trying to get my 1GB flash drive to boot Knoppix 5.0 on my computer, but to no avail. I recently bought a new laptop, and was going to see if I would get any different results with Knoppix USB booting, but didn't get the chance for quite sometime. I actually was using the USB stick in Windows for a while and had to reboot, and was SHOCKED when suddenly Knoppix popped up onto my screen. This new computer has a USB setting called "Usb HDD" or something like that, and it worked perfectly. The only hitch I've had in the "Usb Knoppix booting" scene is making the USB flash drive writeable. I've followed the directions, but they didn't seem to help. I'd be glad to hear some advice about this subject. Also, is it possible to Update to Knoppix 5.1 rather than re-installing? Thanks for the help everyone!

WyldOne
02-27-2007, 06:28 AM
Yes, you can use Knoppix 5.1. I just set uip a 1Gb drive with mkdiskimage -F -4 /dev/sdz and it worked fine.

Tested on a Dell Gx850 (sata only) no problems. :D

Krellan2
02-27-2007, 09:23 AM
Hi again. I have done some experimentation with large USB key, and found a sequence of commands that seems to work for USB devices bigger than 8GB (such as hard disks).

I updated the article with various mkdiskimage command lines to try, depending on the size of your USB key.


mkdiskimage -4 /dev/sdz 0 64 32
This is the "easy" one, fully USB-ZIP compliant, for 1GB.
FAT16, fourth partition, 64 heads, 32 sectors.


mkdiskimage -4 /dev/sdz 0 128 32
This is for between 1GB and 2GB. It's the same thing, except the number of heads has been bumped up to 128, to double it. Still nice even numbers, though. Not USB-ZIP compliant, but I'm hoping that this is still close enough to work.


mkdiskimage -F -4 /dev/sdz 0 255 63
This is for between 2GB and 8GB. FAT16 maxes out at 2GB, so we must now use FAT32. Also setting heads and sectors to the maximum allowed values, which seems to be good enough for USB-HDD. I could squeeze in a little bit more by using 256 heads, but it seems that 255 heads is better preferred (old DOS and BIOS versions had problems "rolling over" at 256 heads).


mkdiskimage -F -4 /dev/sdz 1 255 63
dd if=/dev/zero of=/dev/sdz bs=1 seek=446 count=64
echo -e ',0\n,0\n,0\n,,C,*' | sfdisk /dev/sdz
mkdosfs /dev/sdz4
Here's the fun one! This is for bigger than 8GB. The mkdiskimage script crashes out when the number of cylinders goes beyond what could possibly fit, but I still wanted to use mkdiskimage to lay down the MBR and partition table on the disk. So, mkdiskimage is used here to make a dummy small 1MB partition. Then, the partition table is manually blanked, so that sfdisk has a clean slate to work with. The sfdisk program can correctly see the entire disk and it sizes the partition correctly. It then needs to be formatted, which mkdiskimage automatically does but sfdisk doesn't, so finally, the mkdosfs program is used to do the FAT32 format.

I tested this and it worked on a 320GB USB hard disk, which was big enough for me. This technique should be good for all devices up to 2TB in size, at which point the partition table overflows yet again (the LBA sector count is only 32 bits). Anyone tried a disk (RAID array, for now) larger than 2TB?

MrGreen
02-27-2007, 09:47 AM
Which version of Knoppix did you put on 320gb drive ?..... thinking there is plenty of room for dvd version ;-) with a couple of gig to spare lol

Got an old 80gb drive here may be able to test your huge version out ....

MrG

Krellan2
02-27-2007, 11:08 AM
Which version of Knoppix did you put on 320gb drive ?..... thinking there is plenty of room for dvd version ;-) with a couple of gig to spare lol


I used the DVD of Knoppix 5.1.0. Had some kind of weird problem with 5.1.1 so downgraded to 5.1.0.

MrGreen
02-27-2007, 01:42 PM
D/l 5.1.1 now ... will test it out see what happens

Krellan2
03-01-2007, 08:22 AM
What is the advantage to doing all steps mentioned in previous posts compared to just running this command?
mkbootdev
I clicked through a couple screens and then I had a bootable thumb drive.

No advantage, really. Use whatever works best for you.

The instructions here work on a few more BIOS's than mkbootdev does, since here we use FAT16 instead of FAT32 for small drives, and FAT16 is better liked by some weird BIOS's.

Also, the instructions here predate mkbootdev, which didn't exist at the time they were first made.

MrGreen
03-01-2007, 08:32 AM
are you going to update your guide to include above for larger [huge!] usb drives ?

Krellan2
03-01-2007, 12:45 PM
are you going to update your guide to include above for larger [huge!] usb drives ?

Already been done.

Check the new code boxes near the mkdiskimage section.

There's now 4 boxes, each with the correct commands to use for the 4 "sizes" of drives that need to be dealt with differently:

<= 1GB (max of USB-ZIP "standard", easiest, uses FAT16)
<= 2GB (max of FAT16 filesystem, yes I know that certain versions of WinNT had a nonstandard FAT16 variation that could go up to 4GB but that is getting pedantic)
<= 8GB (max of old-style CHS addressing)
>8GB (LBA, should be good up to 2TB, uses FAT32, requires some manual fudging to get working)

I'm hoping the reader is quick enough to catch that they should use only one of the 4 boxes, based on the size of their drive, and not try all 4 commands at once :)

lilsirecho
03-04-2007, 05:17 AM
Please advise the USB mode usually encountered in mobos with USB boot capability.....is it USB1.1 or USB 2.0 ???

Harry Kuhman
03-04-2007, 05:34 AM
I would guess that it's 2, a lot of the bioses when 1.1 was still the default hardware couldn't properly boot from usb, even if they had an option that claimed they could. But that's purely a guess.

lilsirecho
03-04-2007, 05:43 AM
Kuhman; FWIW

Running an .iso of 700MB into a folder on desktop with USB 2.0 secure digital card interface provides 10MB/sec transfer rate on my computer.

Harry Kuhman
03-04-2007, 05:57 AM
Well, that's well under the 2.0 spec, but the supposed 480 number for usb 2 is pretty bogus. For example. almost everyone knows that a 400 frewire disk interface is much faster than a 480 usb2. UBS just wastes too much with overhead. So overall I would think your number is about where I would expect it to be. But this is getting away for the subject of the original post. I'm not sure why you asked it in the first place, my thinking would be use a 2.0 device if you hope to boot from UBS at all, and if you happen across an older system that can boot from usb and has a 1.1 interface it should degrade gracefully (but painfully slowly). But I tried a number of older systems that claimed they could boot from USB in the BIOSes without luck, the same device finally booted in a new notebook.

lilsirecho
03-04-2007, 06:13 AM
My experience with firewire is it is similar to USB in speed, no great difference. It is primarily the interface device performance first and overhead second.

I was hoping you might try your .iso from USB stick to desktop folder to see your transfer speed. That should determine the USB mode of your mobo for comparison.

Harry Kuhman
03-04-2007, 06:28 AM
I was hoping you might try your .iso from USB stick to desktop folder to see your transfer speed. That should determine the USB mode of your mobo for comparison.
Sorry, my largest flash usb device isn't large enough for Knoppix, the tests I did were with DSL. But as long as I couldn't get DSL to boot (on my HP with 1.1, an IBM (not sure but I think it had 2.0) and a Gateway with 2.0), I saw no reason to buy a larger one to see Knoppin not boot either. Now have a newer HP notebook that boots the same DSL configured flash device just fine. I have not bought a larger flash device yet, and honestly I don't really care about doing it any longer (can use the DSL one if I think booting from flash is a good idea, but it really doesn't seem to be, at least for me). So I really don't care about the transfer rate issues, but I'm sure it wasn't usb 2 on my old Hp, it only has 1.1, and the new HP notebook is usb 2, as is the flash drive, and it booted faster than I would expect from usb 1.1. Too many other projects at the moment to worry about actual transfer speeds.

MrGreen
03-04-2007, 08:05 PM
Got dvd version of knoppix on external usb hard drive [80gb] no problem had to change mkdiskimage to 0 255 63 would not work with 1 [32!]

boots fine .... ;-)

Krellan2
03-05-2007, 12:23 AM
Please advise the USB mode usually encountered in mobos with USB boot capability.....is it USB1.1 or USB 2.0 ???

I'm not sure. In most cases, you're lucky just to be able to boot USB at all, let alone get any good speed out of it.

On my motherboards I have tested, I've found that it is very slow trying to get past the first screen of Knoppix, the cheatcode screen. I'm guessing, but am not sure, that it's USB 1.1 or even 1.0. This is when Knoppix is trying to load the Linux kernel and initramfs from the BIOS.

However, after Linux gets started and Knoppix autodetects all of the USB devices, then it all-of-a-sudden gets much faster! I think this is because Linux can properly set up the USB ports in USB 2.0 mode, unlike the BIOS.

Krellan2
03-05-2007, 12:26 AM
Got dvd version of knoppix on external usb hard drive [80gb] no problem had to change mkdiskimage to 0 255 63 would not work with 1 [32!]

boots fine .... ;-)

Wow, that's interesting. Was mkdiskimage 0 255 63 able to see and format up your entire 80GB drive? I had failures when trying to go beyond just 8GB.

The idea behind doing mkdiskimage 1 255 63 first, was to give you a small throwaway partition, that you could then clear away and then make it again manually, in case mkdiskimage couldn't automatically deal with the full size of your drive. You wouldn't keep the small partition at all for any length of time, you'd be deleting it immediately, so it's laughably small size (8MB or so) wouldn't matter.

MrGreen
03-05-2007, 07:05 PM
Well I kept getting errors when using 1 ... so tried 0 and it worked had to reboot to make sure partition was seen [sda4!] but after that I created mkdosfs then went and ahead with syslinux -s

/dev/sdc4 vfat 77G 4.1G 73G 6% /mnt

Capricorny
06-30-2007, 01:34 AM
Thought I should bring up this thread rather than starting a new one..
After experimenting a little with different laptops and USB-sticks, it seems to me that running mkdiskimage is not a decisive factor with the hardware I use. In every case where I was able to get the stick to boot using mkdiskimage, it worked as well with just partitioning (after wiping out just the partition table) formatting and running syslinux/copying files.
Also, if a stick is prepared, it can ALWAYS be used when the computer is able to boot and run off the CD/DVD: Just type knoppix fromhd=/dev/sda1 (or whatever is the partition).... at the boot prompt, and remove the CD/DVD after booting is complete.
The same trick can be used with sticks, if two can be mounted at the same time, or a USB-harddisk and a stick. I set up a 512MB stick with the basic booting, but nothing else, and used it to start booting, reading and running the complete system from larger sticks. This is written running off a 1GB stick started by a 512 MB.

My results with three laptops:
Toshiba satellite: Only CD/DVD booting, running from USB is OK - until interface "dies".
ASUS A3HF: 512MB sticks boot, none bigger.
Dell Inspiron 510m: Up to 1GB sticks boot, none bigger.

Using a 4 or 8 GB stick this way, one may drop remastering - except for doing different configuration changes or adding software not on the DVD. And it is very nice to be able to free up the DVD drive!

Krellan2
06-30-2007, 09:55 PM
Thanks for the tip. I haven't tried with very large USB keys, so I haven't ran into the size limit yet. I do know that the 1GB limit is probably due to a cheap BIOS only recognizing USB-ZIP compatible drive geometry. I didn't know there was also a 512MB limit somewhere, I can't think of what would cause that.

I like the fromhd trick as well, to start booting from CD but later free up the CD drive for other use. Unfortunately you have to know what drive letter Linux will assign to your USB key first, on each PC. This will be sda1, sdb1, sdc1, and so on, depending on how many drives are installed in the PC and what kind they are (IDE, SCSI, SATA). This usually means booting up once fully from CD, just to see what it will be, then rebooting using fromhd. I once had a BIOS that would do the maddening thing of assigning completely different drive letters to the USB key, based on whether it booted from CD, local HD, or booted from USB! That was a pain to figure out.

8GB USB keys are great because you can drop the entire Knoppix DVD in there, and still have plenty of space left over for your own use, without having to remaster or delete anything.

It's still my hope that PC manufacturers will start to see USB booting as a sellable feature, and test it more thoroughly, working out all of these weird bugs and putting pressure on the BIOS programmers to please get it right this time :)

Capricorny
07-01-2007, 03:07 PM
I have experimented more, and found out that using a 512MB stick for the initial booting, and then use fromhd=/dev/sdb1 etc is the easist way for me to proceed. Only falling back on the CD/DVD when all else fails. BIOSes are clearly sensitive to the stick size, but I have not had problems identifying a second stick or a USB harddisk. It does not seem to help making smaller partitions on a large stick, therefore the only reason I see for partitioning sticks, is that the volume containing til Knoppix image gets mounted ro, and it is useful to have another partition to save config and home directories in, eventually to have ext2/3 file systems in addition to FAT16/32..

Running from a USB harddisk is very simple and versatile, I now try it out with 4 partitions: One with the knoppix images, one with config, /home etc, one which may be mounted as a Unix /store partition and one to be mounted as /usr/local. Except for the /home cloop image, everything could be placed on a USB stick. Because of the frequent updating, the /home partition (file) is not very well suited for present day USB-sticks, they will get worn out quickly. Therefore, a hard disk partition or ramdisk is probably the best, reading/writing the file(s) to persistent storage at intervals. Is there a script for something like that?

I plan to use /usr/local for additional software installs, like Java versions, Mono varieties/languages, VMware Player/Server may also go there.

ibgp3
07-19-2007, 03:56 PM
I service some machines that were purchased without CD's & USB's (probably paid extra.)
I built the USB key version on a key with removable media (a CF card) great! Thanks!
I put the CF card in a hard drive emulator .
When I start up it shows normal, including DMA support for hda [CF Card]
then:
Can't find KNOPPIX filesystem, sorry.
Dropping you to a (very limited) shell.
Press reset button to quit.
etc

I have tried a bunch of cheat code combinations, but if the right one exists I haven't found it.
Got it. Thanks to all.
GP

wilsonB
07-19-2007, 06:54 PM
I have successfully used Puppy 2.17 and Knoppix 5.1.1, Booting off a USB. ( FAT 32) 1GB Sand Disk Ultra USB SD.


I got a little discouraged with trying to get Beryl working on Puppy. (primary sys- Intel 945G video)

A.)
http://puppylinux.org
I like how puppy boots up fast and runs on older systems.
Puppy was originally build ground up with a small foot print in mind. (These days, size isn't as much of a concern though.)
I had problems installing removing applications in Puppy. Also had problems with packages being outdated/missing or video (Intel 845G) Dri not Active/Open Gl from Original CD. Takes a little work.
Seems to take a lot of tweaking to get Beryl working in Puppy.

B.)Knoppix 5.1.1 boot off USB.
http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510/
It does seem to boot slower. Beryl is native using cheat codes.
I like that Knoppix has a lot support in Package manager and hardware detection. It seems easier to install apps.
It seems Knoppix is more solid and supported. Is this assumption true?
If Knoppix booting off USB 'Emulates' a live boot from CD, how easy / hard is it to add remove apps? Do I have to recreate the "Live-CD"?
For example; I don't need Open office at the moment (400MB) or silly games and other apps that are packaged with 5.1.1.
How do I remove them? I tried through the package manager, but Office was still there and the updates didn't stick after restarting.
Do I have to stick with a 750MB partition for the "emulation of a Live CD" boot? I want to trim down the original package to what don't use, then build it up with what I do use.

Is Puppy linux ideal being that Knoppix seems to simulate a live CD distro using Persistence mode versus Puppy using one big personal file.
I ran out of space on the 1Gb memory with Knoppix. (Im getting a 2Gb tomorrow.)

Trying to way to cons/pros


Is there a way to configure a hardware profile at boot up? Meaning, It wont have to do a hardware detect again. I could just select, PC#2 or #4
At boot up and it would boot faster. It seems the Knoppix sits at boot up for a long time then continues then re-detects everything.

I do like the Eye Candy and transparencies (like Beryl) but also the portability. (Being able to boot on any of most of todays systems - good hardware detection.)

Trying to figure which Distro I want to stick with. (Knoppix or Puppy)

I want to decide, so that way I will spend my time to configure and customize...

Thanks for all you time / input/ Advice on this.

I am a novice to linux. , but learning.. :? [/b]

wilsonB
07-19-2007, 07:19 PM
B.T.W: A neat little trick is to keep a floppy disk image of Linux USB boot disk on the USB for older systems. If the bios is old and doesnt boot off the usb, find a floppy and create the floppy in windows. Then reboot into USB Linux with floppy and USB ;-)

marques
08-02-2007, 12:26 PM
Thanks to Krellan2 for his brilliant guide. I've just booted a 5.0.1 Knoppix from my 1GB USB pendrive.
It all works fine and, obviously, faster than CDrom. Fast and fine as your guidelines are.
Being me a 4ever-newbie had to repeat the mkdiskimage step, for root privileges are needed from this point on.

The BIOS, a Phoenix-Award did recognize the pendrive as an USB-HDD either before and after. It was enough to change the priority of the HDD list and restore the Boot devices' list to HDD first (instead of CDrom first as it used to be for Knoppix to run).

Well, thank you very much again :)

Krellan2
08-06-2007, 02:41 AM
Thanks to Krellan2 for his brilliant guide. I've just booted a 5.0.1 Knoppix from my 1GB USB pendrive.
It all works fine and, obviously, faster than CDrom. Fast and fine as your guidelines are.
Being me a 4ever-newbie had to repeat the mkdiskimage step, for root privileges are needed from this point on.


You're welcome! I'm glad it worked well for you. Yes, everything has to be done in the root shell, as root permissions are needed throughout.

Quixand
08-12-2007, 01:44 AM
I think I've posted this in reply to someone's post a long time ago, but not in the main thread here (and I've checked, nobody else did either)

Anyway: A nice setup that works for me:
1. I used an 8gig stick, formatted everything to one big FAT32 partition, made it primary and bootable using the syslinux method in winxp.

Now, at this point there's an issue, a normal windows machine can't see two partitions on a USB because of the way the windows USB drivers are written. Found a solution on the net: edit the drivers, have windows see the drive as a USB HDD instead of USB Flash Drive. Works.
Now you can partition and format the drive as if it was a normal HDD. You can also read and access all sections from windows.

2. Resized partition so that the SECOND partition is 4.1 GB (because I'm using the knoppix 5.1.1 DVD)
3. Copied contents of the Knoppix.iso image into the second partition (leaving about 300mb for persistent home image on the partition).
4. Moved contents of boot directory from second partition to the root of the first partition. Deleted boot directory from second partition.

Then I ran syslinux32 on the first directory again just in case.

Now, you basically have a USB flash drive with two partitions, both visible and accessible under linux, and only the first will be accessible on windows installs that don't have the tweaked USB Flash Drive driver.

Why? Because I wanted a separate data partition for school purposes that doesn't expose my Knoppix USB to corruption. This way I can avoid accidently (or intentionally) screwing up my persistent home file, or any other config files saved on the Knoppix partition, as they're not normally accessible under Windows.
Since the Knoppix bootloader actively searches the entire hardware for the Knoppix.img file, it doesn't really matter whether the bootloader is actually in the same partition as the image, so the whole setup works well. It will easily boot knoppix with the boot files in the first partition and everything else in the second, and this will also allow the first partition, containing whatever data you wish to store on it, be accessible under any windows machine.
I installed PortableApps on the first partition.

I used Paragon Partition Manager 8.5 Pro for all of the partitioning/formatting.
Link to the driver tweaking instructions: http://www.msfn.org/board/index.php?act=ST&f=82&t=69211&st=0#entry474505

flaky
11-17-2007, 07:00 PM
oh

i can not make my usb writable

how??

i run the code like yours

but do nothing

hvinelinux
11-22-2007, 08:03 PM
i was able to use these instructions to get my knoppix on a flash drive running:
http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510

and fine tune it using the information in this thread..

good stuff.....and thanks for the excellent information.

Bruinwar
12-03-2007, 02:15 PM
i was able to use these instructions to get my knoppix on a flash drive running:
http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510

and fine tune it using the information in this thread..

good stuff.....and thanks for the excellent information.

Last night I was able to follow those instructions (the instructions on www.pendrivelinux.com) to create a Knoppix bootable USB drive & it worked... much to my surprise, the 1st time! It made a 750m partition & a second partition, the rest of the 4gig USB drive I used. Once booted from the USB, it sees the 2nd USB partition & the 2 NTFS partitions on my WinXP hard drive.

The only issue is that WindowsXP does not see the 2nd partition. The command from #11 in the instructions:

mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2

Formats the partition. I've tried modifing the command from #9:

mkfs.vfat -F 16 -n usb /dev/sdx1
to
mkfs.vfat -F 32 -n usb /dev/sdx1

to make a FAT32 partition, but it doesn't appear to work.

I've searched this thread a bit but was unable to find what I'm looking for. All I want it to make the 2nd partition, about 3 gig, a FAT32 that Windows can read & write to. Is this possible?

TIA

Regards,
Joe S.

kirol
12-03-2007, 10:12 PM
The only issue is that WindowsXP does not see the 2nd partition. ...
I am not sure if this restriction is lifted for modern windows, but in the DOS days, only one primary partition per hard drive could be recognised. Try defining the rest of your disk as an extended partition, then allocate a logical vfat unit inside that (you'd thus be using sdx5 instead of sdx2).

xlancealotx
12-04-2007, 08:46 PM
On this same thread, I have a small ebox with no cdrom, but bootable via compact flash. I used the directions (http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510) on my 1gb compact flash and it worked perfect.

I'm now booted into knoppix, and want to setup the OS on the internal 2gb embed disk. I thought I could do the same, so setup 2 partitions (hda1/2, each 1gb) transfered the info over to b, but realized I can't use the windows commands to setup the boot partition on hda1 so now I am stuck.

Basically I am asking, how do I setup hda1 to boot and run the OS w/o the need for the flash card.

Thanks.

qlex
02-01-2008, 12:33 PM
Hi.
Very good tutorial, I finally managed to boot Knoppix from my USB stick.

I'm stuck however at the part where I'm to fool Knoppix that USB is not a cdrom and that we should be able to write to it.
I run root shell and typed in those commands:

mount -o remount,rw /cdrom
mount --bind /cdrom /media/sdz4

Then when i typed in:

vi /media/sdz4/syslinux.cfg

I was only able to see the file (it's read-only). Same if I edit syslinux.cfg using KWrite it won't let me save the changes as it says:
THe document could not be saved, as it was not possible to write to file:///cdrom/syslinux.cfg. Check that you have write access to this file or that enough disk space is available.

It seems to me that I coulnd't let Knoppix follow my 2 "mount" commands and it still regards this file as read-only.

Can anybody help me out? I've browsed through those 10 pages of forum replies, but haven't found an answer.

Any tips much appreciated.
Qlex

qlex
02-05-2008, 09:52 AM
Hi,
doesn't anybody have any solutions for the above described problem associated with "mount" commands? my usb is still recognized as cdrom and therefore i can't write to syslinux.cfg file.
Any tips would be greately appreciated.

Qlex

Quixand
02-07-2008, 07:26 AM
i was able to use these instructions to get my knoppix on a flash drive running:
http://www.pendrivelinux.com/2007/01/01/usb-knoppix-510

and fine tune it using the information in this thread..

good stuff.....and thanks for the excellent information.

Last night I was able to follow those instructions (the instructions on www.pendrivelinux.com) to create a Knoppix bootable USB drive & it worked... much to my surprise, the 1st time! It made a 750m partition & a second partition, the rest of the 4gig USB drive I used. Once booted from the USB, it sees the 2nd USB partition & the 2 NTFS partitions on my WinXP hard drive.

The only issue is that WindowsXP does not see the 2nd partition. The command from #11 in the instructions:

mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2

Formats the partition. I've tried modifing the command from #9:

mkfs.vfat -F 16 -n usb /dev/sdx1
to
mkfs.vfat -F 32 -n usb /dev/sdx1

to make a FAT32 partition, but it doesn't appear to work.

I've searched this thread a bit but was unable to find what I'm looking for. All I want it to make the 2nd partition, about 3 gig, a FAT32 that Windows can read & write to. Is this possible?

TIA

Regards,
Joe S.


I am not sure if this restriction is lifted for modern windows, but in the DOS days, only one primary partition per hard drive could be recognised. Try defining the rest of your disk as an extended partition, then allocate a logical vfat unit inside that (you'd thus be using sdx5 instead of sdx2).

Windows will only read the first partition on a usb flash drive. There's a solution that involves tweaking the windows driver for the specific drive to make it treat it like a hard drive, but you have to remember that you can only use that on machines where you have administrative access, which is not the case in schools etc.
I have no idea how Vista handles this, but it's probably safe to assume it will ignore the second partition too, just like all other windows...

The better solution is to create two partitions on the flash drive, make the first bootable, but only load it with the files from the boot directory from the knoppix cd/dvd (place them in the root of the partition), and put everything else in the 2nd partition. Your second partition only needs to be large enough for your knoppix image (and possbily the persistant image file, if you want to store it there).
This way, not only is your first partition (i..e the data partition) available on all machines, but the second one is effectively protected from unwanted changes on most machines running windows (except for the one where you tweaked the driver).
Lastly, you want to make all knoppix files on the first partition hidden and read only.

Bottom of page 9 has an older post with the instructions for doing this.


As for the mounting read/write issue:

if you use the dual partition system, only the knoppix image partition is locked to read only.
all other partitions and drives can be changed from any level.

For the knoppix image partition:
open root shell
you can't umount this partition, and you don't need to bind cdrom to it, as it's already bound.
just
mount -o remount,rw,users /cdrom

once you have this partition set up, and your persistent image set up, you really don't need to touch it and can simply leave it locked to read only mode (which isn't really true, as it does make changes to the persistent image).

KAWill70.
09-23-2008, 09:57 PM
I installed Knoppix 5.1.1 per the instructions at the start of this thread.

It works beautifully except for one thing: I have to hit Carriage Return after the window appears during boot allowing me to use the Persistent Image. There are four choices in the Window.

I only have 10 seconds to hit CR, and the odd thing is that "OK" is already specified yet it is not accepted unless I hit carriage return. If I don't type CR the persistent image is not used.

I did make the specified edits to Syslinux.cfg.

The USB drive is 2 GB and is formatted with 64 cylinders and 32 sectors per track for USB-ZIP compatibility. It is set up as Partition 4.

Any thoughts?

Thanks, Kent

aquamon
02-05-2010, 05:18 AM
I installed Knoppix 5.1.1 per the instructions at the start of this thread.

It works beautifully except for one thing: I have to hit Carriage Return after the window appears during boot allowing me to use the Persistent Image. There are four choices in the Window.

I only have 10 seconds to hit CR, and the odd thing is that "OK" is already specified yet it is not accepted unless I hit carriage return. If I don't type CR the persistent image is not used.

I did make the specified edits to Syslinux.cfg.

The USB drive is 2 GB and is formatted with 64 cylinders and 32 sectors per track for USB-ZIP compatibility. It is set up as Partition 4.

Any thoughts?

Thanks, Kent

Maybe you need to get off the typwriter?
:idea: