Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I've run into some problems..
I have an old machine that has usb support, but does not identify any devices at BIOS level. Thus, I need something that will boot my USB-stick running Debian linux 2.6.
How do I do this?
I assume that I need to boot up something (on floppy or cd) that loads usb modules and then boot the usb stick from there. Is this right? exactly how is this done?
This may be a dead end if the Bios does not support booting from USB. You should check it first to see if "USB legacy support" has been switched on too because older mobo require it to do the booting.
The reason for the dead end is Linux boot loader has no USB driver and cannot find your USB device. It can only do so if the Bios has arranged it as the first bootable disk. Thus if you plug 6 USB devices into a PC and have one nominated as the 1st boot disk then Grub can see only one and not the other 5 even they are all present.
Don't take my word for it. Put Grub on a floppy. Boot it up and try the command
Code:
geometry (hd0)
geometry (hd1)
geometry (hd2)
etc
to see if the USB devices are visible to Grub.
All the USB devices are visible to Linux after it has been booted because the kernel has the necessary drivers. At boot time it is a different matter for the boot loaders.
If the USB device can be seen by Grub then it will self boot without external aid. In such case just install the Linux in the memory device as though it is a hard disk. Not all Linux installers are written to boot from a USB device as it needs the USB driver included in the initrd.
well, you are right in that grub cannot see the device, and that I need the usb components to be able to see the device.
But how to I create a boot disc that has all this so I can boot my USb device up?
If Grub can't see it (so does Lilo) as your USb device is not available from the Bios then putting Grub somewhere is not going to help.
Technically you can put Grub into a bootable medium containing the kernel(2 Mb large) and inird file (4.2 Mb large) and specify the Linux root partition to be from the USB device. This will work but the bootable medium has to be a CD because a floppy can't store 6.2Mb data. By such time the effort of putting Grub in a CD or a hard disk partition and Linux in the USB just to boot the distro is too much effort in my opinion. Technically I am fairly confident it will work out but it is a pig's job.
The steps are (using a hard disk partition)
(1) Install the Linux from a bootable CD into the USB disk, as though it is a hard disk. The Linux once booted up will recognise the USB device.
(2) Create a partition in the hard disk, format it in ext2 (think fat partition also works too) and copy the entire /boot directory from the installed Linux in the USB onto the hard disk partition.
(3) Setup Grub in the hard disk partition.
(4) Amend the menu.lst and to tell Grub the bootable partition is in the hard disk but the "root" of the Linux is in the USB device.
The hard disk will boot up Grub. Grub can then load the kernel and initrd available from the hard disk partition. By such time kernel will recognise the USB and goes inside to complete the booting process. It is a lot of effort to to make the USB to do a small amount of work.
okay, I see what you mean. And that means that if I want to recompile my kernel I have to make a new boot cd?
how could it look like when I make USB as root?
#root (sda1,0) ?
The effort to put in this is definitely not a waste -- it will give me much back(indirectly get an extra week holiday, since I then will be able to work from my old notebook while making a roadtrip to dennmark =) ) (which has do hard disk drive)
The best way in this case would be to carry a copy of puppy on a cd and mount the usb port and store your data on it or if you have enough room store it in your windows.
Last edited by Larry Webb; 06-19-2008 at 10:35 PM.
I have just inserted a 4Gb USB pen drive and it shows up as sdb1 (device marked in red) as indicated by
Code:
debian:/home/saikee# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12158 97659103+ 7 HPFS/NTFS
/dev/sda2 12159 24316 97659135 17 Hidden HPFS/NTFS
/dev/sda3 24317 36598 98655165 5 Extended
/dev/sda4 36599 60801 194410597+ 83 Linux
/dev/sda5 24317 24438 979933+ 82 Linux swap / Solaris
/dev/sda6 24439 25654 9767488+ 83 Linux
/dev/sda7 25655 26870 9767488+ 83 Linux
/dev/sda8 26871 28086 9767488+ 83 Linux
/dev/sda9 28087 29302 9767488+ 83 Linux
/dev/sda10 29303 30518 9767488+ 83 Linux
/dev/sda11 30519 31734 9767488+ 83 Linux
/dev/sda12 31735 32950 9767488+ 83 Linux
/dev/sda13 32951 34166 9767488+ 83 Linux
/dev/sda14 34167 35382 9767488+ 83 Linux
/dev/sda15 35383 36598 9767488+ 83 Linux
Disk /dev/sdb: 4026 MB, 4026531840 bytes
220 heads, 32 sectors/track, 1117 cylinders
Units = cylinders of 7040 * 512 = 3604480 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1118 3932144 c W95 FAT32 (LBA)
debian:/home/saikee#
Therefore if I have installed my Debian in sdb1 and put Grub in say in a partition sda2 then I would have to change my menu.lst to look like this (changes in color)
Code:
title Debian GNU/Linux in pen drive sdb1 (hd1,0) and kernel in sda2 (hd0,1)
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/sdb1 ro
initrd /boot/initrd.img-2.6.18-6-686
In the above I instruct Grub to obtain the kernel and initrd files by the partition indicated by the "root" statement. When the kernel is loaded I specify its root filing system location by the parameter "root=/dev/sda2".
Since /boot directory has Grub inside and so after activating any Grub shell or Grub prompt followed by these two commands my system will become bootable
Code:
root (hd0,1)
setup (hd0)
The above instruct Grub to "source" the system file from 2nd partition of the 1st disk (hd0,1) which is sda2 and set itself up in the whole disk (hd0) which is the MBR of disk sda.
okay, I start to see what you mean now. However - my intention was to put grub on a cd. so I then just need to copy the /boot dir to the cd and make the partition bootable to make it run?
Tried all of that. Still the system cannot find the usb device. I also tried to install DSL (Damn Small Linux) on the usb-stick and, created a usb-boot-floppy.
This floppy seem to boot up a small linux kernel that has a usb-module with it so it can find the usb-device and then boot from it. That works.
BUT - I don't want DSL, I want my own system. The problem is that I cannot use the USB-boot-floppy to boot my own debian installation up.
The only solution to this, as I see it, is to create my own usb-boot-floppy/cd.
But I have no idea of how this could be done. Is there any one out there that does?
I've been asking around about the same thing---using a CD (or floppy if necessary) to boot a USB key. There are actually two computers I'd like to do this with, so I'm hoping there's a solution that doesn't involve hard-wiring the partitions into my menu.lst (although I'll settle for that if I have to).
If you could settle for slackware I've found a guide to make a bootcd. Slackware "USB Boot CD" HOWTO
I had to modify it somewhat to get it to work with 12.1, but that wasn't so hard. Initramfs instead of initrd, basically.
I tried to make something similar for ubuntu or debian, but with no success. Since slackware doesn't work well with my old laptop I'm gonna try Gentoo next.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.