public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: James Miller <jamtat@mailsnare.net>
To: linux-newbie@vger.kernel.org
Subject: booting from USB drive (without BIOS support)
Date: Tue, 6 Jul 2004 08:37:51 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0407060808130.1337@debian-emach> (raw)

I've been recently investigating booting Linux from USB drives.  From past
experience, this list is not the ideal place to pose USB related
questions, but I think at this stage my questions concern such fundamental
issues that I can pose some here just asking that others more
knowledgeable about Linux and computer operation offer corrections or
clarification of my understanding of what's involved.  Let me start by
pasting here an item on booting Linux from USB from the FAQ at
http://www.linux-usb.org/ :

"Q: Is it possible to boot off a USB Device?

A:There are (at least) three things you need for this to be able to
happen.

   1. BIOS Support to boot from USB
   2. Kernel support for USB Storage (including SCSI)
   3. A patch to delay boot process

The first of these is something outside your control, either your BIOS
supports it or not. However, you could put your kernel and initrd on a
floppy and then use a USB root file system to get around this.

In your boot kernel or initial RAM disk you need to include support for
all the needed items to support using a USB disk. These are documented in
the Linux USB User Guide.

You also need to patch this kernel to delay when it tries to open the root
file system, as the USB subsystem takes longer than is allowed to
initialise and make the device available to the kernel. You'll find a
patch suitable for 2.2 and 2.4 here (although the 2.4 patch could be put
in init/do_mounts.c:mount_block_root() instead of fs/super.c which would
be cleaner). A patch may be added to kernels later than 2.4.20 (latest
current released version as I type this) to remove the need for this
patch, but this hasn't happened yet." (hyperlinks removed in pasting)

First, the "three things . . . need(ed)" are not really all needed.  From
the explanation following the list, I understand that if you don't have
number 1, you might still be able to boot from USB with the aid of 2 and
3.  Am I correct in that understanding?  Doesn't the explanation seem to
imply this?

If so, then some further questions on that.  I can't understand from the
description whether the initrd is really necessary.  I think I understand
about the kernel patch: the kernel is written to give some error or
failure message if the root filesystem cannot be found within a certain
timeframe.  The time it takes for USB handling components to load or
initialize and for scsi emulation to start exceeds that built-in time
limit.  The patch causes the kernel to wait some longer period of time
before giving the error or failure message regarding the root filesystem.
Do I understand that part correctly?  If so, then the one remaining
unclarity concerns the initrd.  I know vaguely what an initrd is, and why
it could be helpful in booting from USB: it is some initial filesystem and
files that can be loaded into a ramdisk on bootup and that contains things
like loadable kernel modules that the kernel could use to get USB going.
Is that right?  In other words, there would be some USB module like
usb-storage there, so when the kernel began loading and found a USB mass
storage device, it could load the module in order to be able to use it.
Does this sound correct?  Assuming it is, I would just further like to ask
whether, given the right circumstances, the initrd is really necessary?
By "right circumstances" I mean the following: suppose I were to compile a
kernel for a particular system that I wanted to boot from USB, and that I
compiled it with all the necessary USB components (e.g., ohci,
usb-storage, usbcore - and whatever else might be relevant) *not* as
loadable modules, but as part of the kernel (i.e., select "y" instead of
"m" for those items in the kernel config).  Suppose I did that, as well as
applying the time-delay patch to the kernel.  Were I to do that, would I
really still need to have an initrd?  Feedback appreciated.

James
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

             reply	other threads:[~2004-07-06 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-06 13:37 James Miller [this message]
2004-07-07  5:23 ` booting from USB drive (without BIOS support) Eric Bambach
2004-07-07 14:37   ` James Miller
2004-07-08  3:34     ` Eric Bambach
2004-07-18  1:57       ` James Miller
2004-07-18  4:13         ` Eric Bambach
2004-07-18 15:18           ` James Miller
2004-07-18 19:14             ` Ken Moffat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0407060808130.1337@debian-emach \
    --to=jamtat@mailsnare.net \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox