LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   boot from usb if not detected by bios (https://www.linuxquestions.org/questions/linux-general-1/boot-from-usb-if-not-detected-by-bios-650312/)

Izarf 06-19-2008 08:08 AM

boot from usb if not detected by bios
 
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?

Larry Webb 06-19-2008 09:10 AM

Doing a little search I found these tutorials that explains both ways

http://wiki.debian.org/BootUsb

http://www.simonf.com/usb/

Duck2006 06-19-2008 09:26 AM

To boot from FDD.

http://www.pendrivelinux.com/2007/11...endrive-linux/

Take from this site.

http://www.pendrivelinux.com/

Izarf 06-19-2008 04:31 PM

Will take a closer look at your tips. midsummer celebrations (sweden =) ) tomorrow, so computer geeking will have to wait ;).
anyhow -- thanks!

saikee 06-19-2008 06:24 PM

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.

Izarf 06-19-2008 06:44 PM

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?

saikee 06-19-2008 08:02 PM

I don't think you understand the implication.

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.

Izarf 06-19-2008 09:11 PM

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)

Larry Webb 06-19-2008 10:34 PM

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.

saikee 06-20-2008 01:59 AM

This is my menu.lst of my Debian booting from an internat hard disk partition sda11
Code:

title          Debian GNU/Linux, kernel 2.6.18-6-686
root            (hd0,10)
kernel          /boot/vmlinuz-2.6.18-6-686 root=/dev/sda11 ro
initrd          /boot/initrd.img-2.6.18-6-686

The content of Debian /boot is
Code:

debian:/home/saikee# ls /boot
config-2.6.18-4-686      initrd.img-2.6.18-4-686.bak  System.map-2.6.18-6-686
config-2.6.18-5-686      initrd.img-2.6.18-5-686      vmlinuz-2.6.18-4-686
config-2.6.18-6-686      initrd.img-2.6.18-6-686      vmlinuz-2.6.18-5-686
grub                    System.map-2.6.18-4-686      vmlinuz-2.6.18-6-686
initrd.img-2.6.18-4-686  System.map-2.6.18-5-686
debian:/home/saikee#

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.

If you put the /boot in a CD the root should be
Code:

root (cd)
That is all.

Izarf 07-01-2008 04:25 PM

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?

Izarf 07-02-2008 06:23 AM

Quote:

Originally Posted by saikee (Post 3190054)
This is my menu.lst of my Debian booting ...

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 contents of the usb-boot-floppy is:

Code:

' 3kb
boot.msg 1kb
f2 2kb
f3 2kb
german.kdb 1kb
ldlinux.sys 8kb
linux24 972kb
logo.16 33kb
minirt24.gz 243kb
syslinux.cfg 2kb


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?

angus77 07-06-2008 09:42 AM

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).

Izarf 07-07-2008 05:11 AM

yes, same here. I could pretty much do anything for a good solution of this.

mickwi 08-20-2008 10:05 AM

slackware
 
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.


All times are GMT -5. The time now is 07:53 AM.