Create a Linux (Knoppix) bootable USB (with multiple partitions) with Linux or Mac OS X

10,223

Solution 1

After googling a bit more, I found a procedure here that works great. It takes a little time, but it works.

I put here this knowledge, so it is available to anyone that faces this particular issue.

Note: I managed to make this work using Debian Linux. I still have to find out how to make it work on OS X.

Step 0. (The obvious one) Download (or somehow get) the Knoppix CD (or DVD) .iso image you want to copy in your flash drive. I'm using KNOPPIX_V7.2.0CD-2013-06-16-EN.iso.

Step 1. Install syslinux:

$ sudo apt-get install syslinux

Step 2. (Clean your USB flash drive) Plug the USB flash drive to your computer. To find out how does the system "recognizes" it, type the following command:

$ fdisk -l

(you may need to switch to the root user, or use sudo). The result will be something like this:

Disk /dev/sda: 1500.3 GB
...
Disk /dev/sdb: 7803 MB
241 heads, 62 sectors/track 182401 cylinders
...

Notice that the first entry refers to the local hard drive and the second refers to the USB flash drive. Your results may be different. If you have any doubt, unplug your USB, run fdisk -l again and check which drive is gone.

Once you are sure you know which device is your USB flash drive (in my case /dev/sdb), take note of the heads and sectors/track values (in my case, 241 heads and 62 sectors / track).

Now, shred the flashdrive:

$ shred -n 0 -z /dev/sdb

This command will overwrite your USB flash drive with zeros, including the partition table (check the shred man page for more info). If you want to view the progress, add the -v switch. This will take quite a long time (30 or 45 minutes in my case), so maybe it's time to go for a snack ;) ).

Step 3. (Prepare the .iso file) Navigate to the folder where the Knoppix .iso image is, and convert it to "hybrid mode". Use the values of heads and cylinders/track you got in step 1 (if you don't remember them, use fdisk -l /dev/sdb):

$ isohybrid -o 1 -h 241 -s 62 -e 1 KNOPPIX_V7.2.0CD-2013-06-16-EN.iso

Step 4. Write the image to your USB flash drive:

$ cat KNOPPIX_V7.2.0CD-2013-06-16-EN.iso > /dev/sdb

This will take about 20 minutes (so maybe you should get a cup of coffee right now).

After this command executes, check the USB partition table:

$ fdisk -l /dev/sdb

Disk /dev/sdb: 7803 MB
241 heads, 62 sectors/track 182401 cylinders
...
Device     Boot  Start End   Blocks Id System
/dev/sdb1    *     1    97  724686+ 17 HPFS/NTFS hidden

This tells you that the /dev/sdb1 partition is a bootable HPFS/NTFS partition. Here is where your Knoppix boot drive is.

Step 5. (Make the rest of your USB flash drive available for use). If you don't mind that the remaining space in your flash drive is wasted, then skip this. But if you (like me) are greedy about these precious extra MB, you'll need to add a second partition to your drive. So, let's edit the partition table:

$ fdisk /dev/sdb

command (m for help): p
Disk /dev/sdb: 7803 MB
241 heads, 62 sectors/track 182401 cylinders
...
Device     Boot  Start End   Blocks Id System
/dev/sdb1    *     1    97  724686+ 17 HPFS/NTFS hidden

command (m for help): n
Partition type:
    p primary
    e extended
Select: p
Partition number (1-4, default 2): 2
First sector (98-1019, default 98): 
Using default value 98
Last sector, +sectors or +size{K,M,G} (8032256-31266815, default 31266815): 
Using default value 31266815

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): c
Changed system type of partition 2 to c (W95 FAT32 (LBA))

command (m for help): w

Notice that there are now two devices: /dev/sdb1, which holds the Knoppix bootable image, and /dev/sdb2 which is free space (almost) ready to use. All that remains now is to make the file system ready:

$ mkfs.vfat /dev/sdb2

And that's it! The next time you plug this USB flash drive to your computer, you'll be able to use the free space as a regular USB flash drive, but there will be a Knoppix Live partition hidden, ready to help you. To use it, just shut down your computer, plug the flash drive to it, and turn it on. Be sure your computer can boot from USB, and wait for the system to start.

I really hope this helps.

Solution 2

go to

https://archive.org/details/BootableKnoppix16GUSBImg.7z

click on the Torrent link, to begin downloading the file

Bootable_Knoppix_16G_USB_img.7z

which is a 16 Gigabyte bootable USB image with 9 versions of Knoppix on it, all of which you can boot from.

Solution 3

First you have to partition the pendrive (lets assume it's mouted as /dev/sdc) into two seperate partitions. you can achieve this with the gparted utility in debian.You can type in terminal

gparted

to open this utility.There are a plethora of manual on using gparted on internet (also on creating a usb bootable linux distro).

create two partitions out of your device according to your choice , using gparted.In this case it would be something like sdc1 and sdc2.

There is a utility called yumi in linux to create bootable pendrive.To install this utility just type

apt get install yumi

in terminal. use yumi to install knoppix in sdc1 assuming sdc1 is the volume in which you have to install knoppix. the second partition will be accesible from linux distros and modern windows operating systems.

Share:
10,223

Related videos on Youtube

Barranka
Author by

Barranka

Actuary, finance and risk oriented; musician, amateur programmer... I love mathematics, probability, statistics, numerical methods, music... and whatever challenges the creativity of human mind. Some links I think it's worth to read: "What have you tried?" by Matt Gemmel Need an Answer? Actually, No ... You Need a Question And some useful links for online code editing: SQL fiddle (a good tool to create SQL reproducible examples) Coding ground (online coding tool in various languages) Actuario, orientado a finanzas y riesgos; músico, programador aficionado. Me encantan las matemáticas, probabilidad y estadística, métodos numéricos, música... y cualquier cosa que rete la creatividad de la mente humana.

Updated on September 18, 2022

Comments

  • Barranka
    Barranka over 1 year

    I want to create a Knoppix bootable USB flash drive. I've found instructions about how to do this, but I would like to do it fulfilling the following conditions:

    The USB I am planning to use has 8 GB capacity, and Knoppix only needs 700 MB (I'll use the little CD version, not the humongous DVD one). I would like to use as little of the capacity of the USB flash drive (I was planning to use 1 GB for the Knoppix bootable disk and the rest as free space). The remaining free space would be a FAT32 partition, so I can use it as a "regular" USB drive.

    I am currently using a Debian PC; I would appreciate instructions on how to do this using Linux, and (optionally) OS X.

  • Scott - Слава Україні
    Scott - Слава Україні almost 6 years
    Did you notice that the question says “The USB I am planning to use has 8 GB capacity”?