LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2005, 02:20 PM   #1
TacitCracker
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
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
 
Old 10-08-2005, 08:29 PM   #2
TexasDevilDog
Member
 
Registered: Nov 2003
Posts: 54

Rep: Reputation: 15
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.

Code:
[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.

Code:
[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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting to thumb drive with Grub without BIOS support, possible? Baix Linux - Software 1 06-24-2005 12:12 PM
booting knoppix via external usb cd drive Kirmonkey Linux - Laptop and Netbook 0 04-24-2005 06:07 AM
Having problems booting USB Thumb Slax Javahulk Linux - Software 0 03-06-2005 09:02 PM
Accessing USB Thumb Drive in Knoppix 3.7 jessjackson Linux - Newbie 0 02-14-2005 02:29 PM
Booting Linux From a USB Thumb Drive Ehuwiko Linux - General 3 01-09-2004 09:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration