-   Linux - Newbie (
-   -   Booting Knoppix from a thumb drive (

TacitCracker 10-08-2005 03:20 PM

Booting Knoppix from a thumb drive
I know there was a question about this already in the forums but the link to was broken to this process in windows. So can someone tell me how to do this in windows. i have a 1 gb drive

TexasDevilDog 10-08-2005 09:29 PM

I am not sure from Windows and I haven't done it in Linux, but if you have a distro of Knoppix live or any installed distro, this is what I would try. This should give basic functionality of linux from a usb stick.

Bootup with CD or installed
Use fdisk to setup the parition, example /sbin/fdisk /dev/uba
Then use dd to copy your master boot record from your hard drive. example dd if=/dev/hdc of=/dev/uba bs=512 count=1
Then mount /dev/uba1 and make directories of /, /boot, /bin
cp the contents of /boot, /bin from your HD
modify the boot loader config file so that it will find your uba device on the appropriate block device, modify the kernel line to be like: kernel /vmlinux ro root=LABEL=/ init=/bin/bash

When you boot init=/bin/bash will load the kernel and then run a bash shell. You are in linux.

Here is an example of making the partition but I will do it in a file. Remember Linux treats everything as files, even devices. So, I use a file and make linux think it is a drive and partition.


[root@localhost tests]# ls -l
total 0
[root@localhost tests]# dd if=/dev/zero of=mini-partition bs=1024 count=1024
1024+0 records in
1024+0 records out
[root@localhost tests]# ls -lh
total 1.1M
-rw-r--r--  1 root root 1.0M Oct  8 20:23 mini-partition
[root@localhost tests]# file mini-partition
mini-partition: data
[root@localhost tests]#

Here I create a 1024 by 1024 byte file named partition, filled with zeros. The file command asks what is the file, the answer is data.


[root@localhost tests]# dd if=/dev/hdc of=mini-partition bs=512 count=1 conv=notrunc
1+0 records in
1+0 records out
[root@localhost tests]# ls -lh
total 1.1M
-rw-r--r--  1 root root 1.0M Oct  8 20:25 mini-partition
[root@localhost tests]# file mini-partition
mini-partition: x86 boot sector, GRand Unified Bootloader (0.94), code offset 0x48
[root@localhost tests]#

here I copy my master boot record in to the file, without truncating it. The file command now says that min-partition is a bootable partition.

All times are GMT -5. The time now is 02:13 AM.