From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Auto-handling arbitrary USB mass storage devices
Date: Thu, 23 Sep 2004 18:04:25 +0000 [thread overview]
Message-ID: <20040923180425.GB9028@kroah.com> (raw)
In-Reply-To: <200409211843.23943.jason@jasonlebrun.info>
On Tue, Sep 21, 2004 at 06:43:23PM -0700, Jason LeBrun wrote:
> I'd like to use udev/hotplug to automate the addition/removal of USB storage
> devices. I'm not sure of the best way to go about this, since these tools
> certainly provide more than one way to do it!
>
> Basically, I'd like to set things up once, and then have this to happen for
> any plugged usb-storage device:
>
> 1. When I plug in a device, a device node with a some friendly name, like the
> results of SYSFS{vendor} should get created in /dev.
udev can do this for you.
> 2. Mount points should get automatically created somewhere, like in /mnt
> or /media. They should also have a similarly nice name.
>
> 3. A line should be added to fstab that corresponds to the new drive.
>
> 4. Optionally, the drive should be mounted right away.
HAL does these steps for you. Not udev.
> It *seems* like hotplug/udev should allow this to be easy, but here are the
> problems I'm having in each step:
>
> 1. I can't seem to use all of the SYSFS attributes. For example,
> SYSFS{product} won't return anything.
What is the full rule you are trying to match on?
> Furthermore, the %s format specifier is not working quite properly. For
> example, I have an external USB HD with two partitions. If I use
> SYMLINK="%s{vendor}%n" in my rules file, I get in my /dev directory the
> following:
> lrwxrwxrwx 1 root root 4 Sep 21 18:34 1 -> sda1
> lrwxrwxrwx 1 root root 4 Sep 21 18:34 2 -> sda2
> lrwxrwxrwx 1 root root 4 Sep 21 18:34 WDC -> sda1
Please realize that depending on the level in sysfs where your rule
matches, there might not be a vendor file there. That's what is
probably happening here.
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
prev parent reply other threads:[~2004-09-23 18:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-22 1:43 Auto-handling arbitrary USB mass storage devices Jason LeBrun
2004-09-23 18:04 ` Greg KH [this message]
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=20040923180425.GB9028@kroah.com \
--to=greg@kroah.com \
--cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).