The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Tomasz Chmielewski <mangoo@wpkg.org>, shawnxjin@gmail.com
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Force a usb drive to be /dev/sda?
Date: Thu, 12 Jun 2008 13:11:42 +0200	[thread overview]
Message-ID: <4851046E.907@s5r6.in-berlin.de> (raw)
In-Reply-To: <4850DFB4.5020205@wpkg.org>

Tomasz Chmielewski wrote:
>> Is it possible to force a usb drive to be /dev/sda? I put an entire
>> linux system to a usb drive and want it boot a system with variable
>> sata disks. However the usb drive is always scanned as a last scsi
>> drive.
> 
> Is there a reason why you can't use filesystem labels or UUIDs?

Indeed.  Shawn, I see these options:

 1. Mount filesystems by UUID or by label.
    Doesn't work with some filesystems.

 2. Refer to devices by device ID or by device path.
    Requires a minimal udev environment which gives you
    /dev/disk/by-id or /dev/disk/by-path, or something
    similar to udev.  People had things like this already
    working under Linux 2.4, using programs like devlabel
    IIRC.  Requires you to set up an initrd with respective
    scripts in it.
    By-path only works if you never alter the USB topology
    and PCI topology.  I.e. prefer by-id.

 3. Influence the order of disk probing so that your USB
    disk is the first one.  Works only if there is at most
    one disk on the USB bus and requires you to wait with
    insertion or probing of the SATA controller driver (PCI
    driver) until after the USB disk was probed by sd_mod.

    There may or may not be very simple ways to do this.
    Simplest would be to configure the SATA controller driver
    as module and load that module in an rc script after the
    root filesystem was mounted.  That would actually be much
    simpler than option 2, so maybe you want to try this
    before 2.

 4. Last resort:  Hack sd_mod to defer any probes until after
    the first probe of an USB attached disk.  Requires some
    experience in kernel driver programming.
-- 
Stefan Richter
-=====-==--- -==- -==--
http://arcgraph.de/sr/

  reply	other threads:[~2008-06-12 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  8:35 Force a usb drive to be /dev/sda? Tomasz Chmielewski
2008-06-12 11:11 ` Stefan Richter [this message]
2008-06-13  5:32   ` Shawn Jin
2008-06-13  6:35     ` Stefan Richter
2008-06-13 20:29       ` Shawn Jin
2008-06-13 21:54         ` Stefan Richter
  -- strict thread matches above, loose matches on Subject: below --
2008-06-12  6:05 Shawn Jin

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=4851046E.907@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mangoo@wpkg.org \
    --cc=shawnxjin@gmail.com \
    /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