From owner-freebsd-questions Tue Mar 18 8: 8:31 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DDA237B405 for ; Tue, 18 Mar 2003 08:08:29 -0800 (PST) Received: from mired.org (ip68-97-54-220.ok.ok.cox.net [68.97.54.220]) by mx1.FreeBSD.org (Postfix) with SMTP id 9B0BB43F85 for ; Tue, 18 Mar 2003 08:08:27 -0800 (PST) (envelope-from mwm-dated-1048435707.b6dd16@mired.org) Received: (qmail 76933 invoked from network); 18 Mar 2003 16:08:27 -0000 Received: from localhost.mired.org (HELO guru.mired.org) (127.0.0.1) by localhost.mired.org with SMTP; 18 Mar 2003 16:08:27 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15991.17530.388853.470142@guru.mired.org> Date: Tue, 18 Mar 2003 10:08:26 -0600 To: Dan Pelleg Cc: FreeBSD Questions Subject: Re: getting device for umass? In-Reply-To: References: X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/0.71 (Hoop, Jr.) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In , Dan Pelleg 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: 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. 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