PDA

View Full Version : Booting a USB drive when the BIOS doesn't support it



jacksonon
11-05-2005, 01:26 PM
Hi,

I'm going to be moving to a new city soon, which means I'll be without my computer for a few weeks. To get around that, I had the bright idea of ripping out my hard drive and putting it in a USB enclosure. Then I'd be able to use any computer anywhere - I'd just stick a boot CD in the CD drive and my USB enclosure in a USB socket, and tell the kernel to mount the USB drive with something like kernel root=/dev/sda1. It'd boot up my system with my Gnome layout and my home directory and so on, just as if it was my real desktop. Sounds good in theory.

I thought I'd try this with Knoppix as the boot CD, but it doesn't work. That is, there doesn't seem to be any boot option you can pass to Knoppix to tell it that after it's autodetected all the USB hardware, it should then mount a particular device as root and carry on from there, rather than mounting the compressed image on the CD. I remember that this used to be a really handy feature on the old Debian installation floppies, that I used it all the time to boot my system when I accidentally deleted the kernel, so I'm surprised it isn't available in Knoppix.

I should also mention that my desktop computer is fairly old and the BIOS can't boot directly from USB. I expect many other computers I may want to try this with will be in the same position, so I want to avoid any solution that requires BIOS USB booting.

Am I right that this isn't possible with Knoppix? If I'm wrong, I'd appreciate it if someone told me how it's done. Alternatively, if anyone knows of another live CD that allows this kind of thing, that'd be good too.

Thanks,
Matthew Exon

OErjan
11-05-2005, 04:48 PM
you just create a persistent home for knoppix then you can have that on your USB drive, and as most things are saved in /home/username ...
read some about persistent home, klik and unionFs on the documentation link at top of page.

jacksonon
11-05-2005, 08:39 PM
But I don't want persistent Knoppix. I want my own system, the one I'm using now, the one on my hard drive. I just want to plug that hard drive into the USB port and use a Knoppix CD only to boot it. Let me know if I've misunderstood your point...

Matthew Exon

Dave_Bechtel
11-05-2005, 11:31 PM
Actually, you don't really need Knoppix for that. Compile a new kernel with the USB stuff, make a syslinux boot floppy with that kernel, and burn the floppy image to a CDR. (Don't forget to chmod +x the scripts if you use them.)

' mkdosfs /dev/fd0 ' == format floppy
' syslinux /dev/fd0 ' == Add bootsector

( Also, mount floppy and cp kernel to it as destination filename=="krnl"; edit syslinux.cfg )

Sample: BEGIN syslinux.cfg


default knoppix
#prompt 1
#timeout 50
# kernel krnl269 - changed for mvkernel
label knoppix
kernel krnl
append root=/dev/sda1 ro vga=ext apm=power-off nomce lang=us


' umount /dev/fd0 '
' dd if=/dev/fd0 of=eltorito.img '

BEGIN mkbootcdrom


#!/bin/sh

# Make a bootable Linux utility cdrom

/bin/ls -al boot
echo Making bootable CDROM from ELTORITO.IMG ... PK:
#read

#mkisofs -r -f -U -v -o - * \
# -c is an OUTPUT file
time \
mkisofs -b eltorito.img -c boot/boot.catalog \
-d -D -f -l -J -N -r -T -v \
-log-file ~/bootcd.errlog \
eltorito.img \
| cdrecord -v fs=5120k -eject -tao speed=$CDR_SPEED -data -


ALSO - Don't forget to edit your /etc/fstab, since everything will be on sda now. :)


But I don't want persistent Knoppix. I want my own system, the one I'm using now, the one on my hard drive. I just want to plug that hard drive into the USB port and use a Knoppix CD only to boot it. Let me know if I've misunderstood your point...

Matthew Exon

jacksonon
11-06-2005, 09:01 AM
Yeesh, if it's gonna be that complicated, I won't bother. It'd be simpler just to install my hard drive in any computer I find - I'll take a screwdriver instead. Compiling my own kernel? That's a little 90s isn't it?

By the way I found that RIP (http://www.tux.org/pub/people/kent-robotti/looplinux/rip/) does what I used to do with my Debian recovery disks - when it gets to GRUB, delete the initrd line and change the linux line to root=<whatever>, and it'll boot whichever partition you want with RIP's kernel. Unfortunately, that doesn't seem to work with USB devices. It'd be handy if something similar was possible with Knoppix.

Dave_Bechtel
11-06-2005, 11:58 PM
> Compiling my own kernel? That's a little 90s isn't it?

--Not if you want an optimized system, it isn't. I routinely compile kernels for almost every box I install. It cuts down on wasted modules that you'll never use, as well.


Yeesh, if it's gonna be that complicated, I won't bother. It'd be simpler just to install my hard drive in any computer I find - I'll take a screwdriver instead. Compiling my own kernel? That's a little 90s isn't it?

By the way I found that RIP (http://www.tux.org/pub/people/kent-robotti/looplinux/rip/) does what I used to do with my Debian recovery disks - when it gets to GRUB, delete the initrd line and change the linux line to root=<whatever>, and it'll boot whichever partition you want with RIP's kernel. Unfortunately, that doesn't seem to work with USB devices. It'd be handy if something similar was possible with Knoppix.

irlandes
12-10-2005, 11:24 PM
I don't know if there is any benefit for other distros, but puppy linux, on its www.goosee...... url claims they have a floppy iso which includes USB drivers, which will boot and boot off non-bootable USB including flash drives.

I am not sure if sys or autoexec.bat files can be modified for other distros or not. I wish to look into it, but do not have a floppy right now. It would sure be worth looking into.