Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2003 10:08:26 -0600
From:      Mike Meyer <mwm-dated-1048435707.b6dd16@mired.org>
To:        Dan Pelleg <daniel+fbsdq@pelleg.org>
Cc:        FreeBSD Questions <questions@FreeBSD.org>
Subject:   Re: getting device for umass?
Message-ID:  <15991.17530.388853.470142@guru.mired.org>
In-Reply-To: <u2svfyg4s16.fsf@gs166.sp.cs.cmu.edu>
References:  <u2svfyg4s16.fsf@gs166.sp.cs.cmu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
In <u2svfyg4s16.fsf@gs166.sp.cs.cmu.edu>, Dan Pelleg <daniel+fbsdq@pelleg.org> typed:
> 
> I'm using a USB compact-flash card reader. When attached it is recognized,
> and umass(4) creates a device for it. On a SCSI-less system it is da0 but
> this is obviously not always true.

It's not always true on a SCSI-less system, either. You can wire the
device down to whatever point you want. On SCSI systems, umass devices
are found and numbered before the real SCSI drives, so it tends to
come up as da0 there. Some people - me, for instance - wire down
things so that their SCSI devices show up first.

> How can I systematically identify the disk it is attached as? As you might
> guess, the point is to fire up a script from /etc/usbd.conf. However all I
> get from usbd is umass0 for DEVNAME. I poked around camcontrol but it didn't
> seem to give me enough information to come up with a robust script. Any
> ideas?

If you're trying for a really general solution, you may be
SOL.

camcontrol devlist gives you the name of the device. I.e., mine is:

<HAGIWARA SmartMedia R/W 2.00>     at scbus1 target 0 lun 0 (pass4,da3)

Knowing that it's a HAGIWARA reader, I can look for that and pull the
da3 out of the last bit of the card.

The other alternative is to check dmesg for the umass-sim
device. I.e., mine shows up as:

da3 at umass-sim0 bus 0 target 0 lun 0

If you've got more than one attached, you'll have to figure out which
one you're looking for. If the goal is to mount them, then you can
check the output of mount and look for the one that's not there.

One simple solution is to note that the device numbers for the umass
devices seldom change, so you can fix them in usbd.conf for each
system.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15991.17530.388853.470142>