booting from a USB drive - Hardware

This is a discussion on booting from a USB drive - Hardware ; Hi folks. I'm trying to boot from a USB drive [1] (just the root filesystem is important, not the kernel) on a machine that doesn't support USB booting. The machine has no working floppy drive either, but one could probably ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: booting from a USB drive

  1. booting from a USB drive


    Hi folks.

    I'm trying to boot from a USB drive [1] (just the root filesystem is
    important, not the kernel) on a machine that doesn't support USB
    booting. The machine has no working floppy drive either, but one could
    probably be connected. I've tried:

    The Ubuntu 6.04 LTS opening page, hit F6, and change the kernel command
    line so "rw", "splash", and "quiet" are out, and "ro" is in, and change
    root= to to "root=/dev/sda2". It still booted from the CD.

    The "System Rescue CD" version 0.2.19 (I think).
    At the boot: prompt, I tried "fb1024 root=/dev/hda2" and "nofb
    root=/dev/hda2". The first time, it asked me for a root floppy. The
    second time, it hung on the keyboard layout question.

    LOADLIN.EXE , v. 1.6. It wouldn't do its thing as my CPU was in V86 mode
    because of XP, not straight 386/486 (I think). I tried running the .bat
    directly (after modifying it appropriately), and typing the commands into
    a COMMAND.COM (not CMD.EXE) window, with its "compatibility" set to
    "Windows 98/ME". Same response, both ways.

    So, how do I make it boot from the USB drive? Add LILO to hda? I was
    hoping to do this without modifying hda, but that's looking impossible.

    [1] System is a DVR (bog-standard PC + Nvidia Personal Cinema card). We
    got digital cable a few days ago. The existing card doesn't tune it,
    so I'm thinking I'll get http://pchdtv.com/hd_5500_right_down.html .
    Current software doesn't do QAM (digital TV modulation is QAM) and
    MythTV does, so it's time to switch. But I don't want to wipe XP
    until Linux works, and there's not enough room on hda for them both,
    so that's why the other drive.

    --
    -eben QebWenE01R@vTerYizUonI.nOetP http://royalty.no-ip.org:81

    "You're one of those condescending Unix computer users!"
    "Here's a nickel, kid. Get yourself a better computer" - Dilbert

  2. Re: booting from a USB drive

    Hactar wrote:

    >
    > Hi folks.
    >
    > I'm trying to boot from a USB drive [1] (just the root filesystem is
    > important, not the kernel) on a machine that doesn't support USB
    > booting.

    Think again about what booting means: You want to load the OS kernel into
    memory and start it. And you have to use the BIOS to do that.
    So the kernel and any other file, which is used during the boot process has
    to live on a media, which can be accessed by the BIOS.
    Fortunately all stuff used during the boot process on Linux is installed
    into the /boot directory. If the root partition is not accessable by the
    BIOS, you usually put that directory on its own small partition ( 20 MB).
    So the supported method would be: Resize the partition(s) on that DVR to
    make space for a /boot partition and then run the normal installation.

    As an alternative, it seems also be possible to run /boot from an existing
    FAT partition. But I didn't test that, the installer of your distrbution
    probably doesn't support that and I'am not sure, if the DVR uses FAT as
    filesystem. Using an NTFS partition instaed is problematic,because the the
    linux NTFS driver still lacks full wtite capability.





  3. Re: booting from a USB drive

    On Tue, 02 Jan 2007 09:54:46 +0100, Markus Kossmann wrote:

    > Fortunately all stuff
    > used during the boot process on Linux is installed into the /boot
    > directory.


    That many BIOSes can read ext2? I've always assumed that a part of GRUB
    gets installed into the MBR, and that this is what handles the reading of
    an ext2 /boot.

    No?

    - Andrew


  4. Re: booting from a USB drive

    On Tue, 02 Jan 2007 11:29:17 -0500, Andrew Gideon staggered into the
    Black Sun and said:
    > On Tue, 02 Jan 2007 09:54:46 +0100, Markus Kossmann wrote:
    >> Fortunately all stuff used during the boot process on Linux is
    >> installed into the /boot directory.

    > That many BIOSes can read ext2?


    BIOSes usually don't grok filesystems at all. They understand how to
    read sectors from a limited variety of devices.

    > I've always assumed that a part of GRUB gets installed into the MBR,
    > and that this is what handles the reading of an ext2 /boot. No?


    Stage 1 is 446 bytes and is usually installed into the MBR. Stage 1.5
    is about 9K and is usually installed in the slack space between the MBR
    and the start of the first partition. Stage 2 is on /boot. Stage 1
    loads stage 1.5. Stage 1.5 reads the filesystem on /boot --there are
    separate stage 1.5s for all the filesystems you can have /boot on (at
    least ext2, FAT, JFS, XFS, and ReiserFS.) Stage 2 displays the menu
    and/or provides the GRUB shell. That make sense?

    LILO does it differently, of course. LILO's stage 1 resides in the MBR
    (usually) and reads a loading map (usually /boot/map) which contains a
    list of sectors where the kernel images and boot parameters live. It's
    less flexible than GRUB, but it *might* survive stupid things like
    running mkdosfs on your /boot. Somebody did that a year or so back and
    reported on it to this froup....

    --
    "Unfortunately, men befriend women in futile attempts to get a 3D
    accelerated video card thingy..." -- MegaHAL (trained on ASR),
    1998-11-05
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  5. Re: booting from a USB drive

    On Tue, 02 Jan 2007 12:06:44 -0600, Dances With Crows wrote:

    > BIOSes usually don't grok filesystems at all.


    That makes more sense to me.

    [...]

    > Stage 1 is 446 bytes and is usually installed into the MBR. Stage 1.5 is
    > about 9K and is usually installed in the slack space between the MBR and
    > the start of the first partition.


    I thought that the disk's partition table was somewhere in there? I
    suppose stage 1.5 is placed such that the table is avoided.

    [If memory serves, the partition table is well before the 1K boundary. I
    seem to recall that a 'dd if=/dev/zero of=/dev/... bs=512 count=1' wipes
    the table as well as the MBR.]

    > Stage 2 is on /boot. Stage 1 loads
    > stage 1.5. Stage 1.5 reads the filesystem on /boot --there are separate
    > stage 1.5s for all the filesystems you can have /boot on (at least ext2,
    > FAT, JFS, XFS, and ReiserFS.) Stage 2 displays the menu and/or provides
    > the GRUB shell. That make sense?


    Perfectly, but it raises another one of those questions about which I've
    been wondering for a while.

    What is the difference between the kickstart directives:

    bootloader --location=partition
    bootloader --location=mbr

    (or the GUI install equivalent)? If the former writes nothing to the MBR,
    then I cannot see how booting works. Does the BIOS know how to look
    in "the first sector of the partition containing the kernel" for the boot
    loader? I suppose if that's the first partition, it should be easy to
    find.

    Or have I completely misunderstood?

    I'd a problem recently where I could not install CentOS on a machine that
    had previously had Fedora. Well, I could *install* but the new
    environment would never boot.

    After I zeroed the first 512 bytes on the drive, the problem disappeared.
    So now I'm wondering: if the BIOS can read either the MBR or the first
    sector of the zeroth partition, how does it decide which to do? The
    answer might explain that oddity I'd experienced.

    http://groups.google.com/group/comp....e0db439596c6e5

    Thanks...

    Andrew


  6. Re: booting from a USB drive

    On Fri, 05 Jan 2007 13:11:09 -0500, Andrew Gideon staggered into the
    Black Sun and said:
    > On Tue, 02 Jan 2007 12:06:44 -0600, Dances With Crows wrote:
    >> Stage 1 is 446 bytes and is usually installed into the MBR. Stage
    >> 1.5 is about 9K and is usually installed in the slack space between
    >> the MBR and the start of the first partition.

    > I thought that the disk's partition table was somewhere in there?


    446 bytes real-mode code, 64 bytes partition table, 2 bytes signature =
    512 bytes MBR.

    >> Stage 2 is on /boot. Stage 1 loads stage 1.5. Stage 1.5 reads the
    >> filesystem on /boot. Stage 2 displays the menu and/or provides the
    >> GRUB shell. That make sense?

    > Perfectly, but what is the difference between bootloader
    > --location=partition and bootloader --location=mbr


    kickstart? Bleah, distro-specific tools tend to obscure what's really
    going on. That's setup(hd0,0) and setup(hd0). partition=/dev/hda1 ,
    MBR=/dev/hda.

    > If the former writes nothing to the MBR, then I cannot see how booting
    > works.


    BIOS reads the MBR and does what it says in the 446 bytes of real-mode
    code, as was implied earlier.

    > Or have I completely misunderstood?


    Sorta. The x86 boot process is pretty simple and relatively well
    documented. If you're interested in it at a low level, there should be
    stuff on PickyWeedia and the sources for LILO and GRUB are available.

    > I could not install CentOS on a machine that had previously had
    > Fedora. Well, I could *install* but the new environment would never
    > boot.


    The installer screwed up. This is more typical than you'd like in
    Redhat-derived products.

    > if the BIOS can read either the MBR or the first sector of the zeroth
    > partition, how does it decide which to do?


    If a BIOS sees no boot signature in the MBR of a hard disk, it is
    supposed to refuse to boot from that disk. Some manufacturers may have
    made their BIOSes behave differently, though, thanks to the large number
    of partially-competent users out there. HTH,

    --
    I think, therefore I am.
    ...how the @#$%^ did *you* get here?
    --Joe Zeff
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

+ Reply to Thread