From owner-freebsd-questions@FreeBSD.ORG Thu Mar 12 17:43:59 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B413106566B for ; Thu, 12 Mar 2009 17:43:59 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by mx1.freebsd.org (Postfix) with SMTP id B9D5F8FC18 for ; Thu, 12 Mar 2009 17:43:58 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from source ([209.85.221.123]) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKSblJ3SkBTCg+8H1ib7JdOUa+Db5Qbwi2@postini.com; Thu, 12 Mar 2009 10:43:58 PDT Received: by qyk29 with SMTP id 29so2266071qyk.5 for ; Thu, 12 Mar 2009 10:43:56 -0700 (PDT) Received: by 10.142.12.14 with SMTP id 14mr97994wfl.120.1236879836381; Thu, 12 Mar 2009 10:43:56 -0700 (PDT) Received: from localhost ([76.231.178.131]) by mx.google.com with ESMTPS id 22sm1963296wfi.1.2009.03.12.10.43.55 (version=SSLv3 cipher=RC4-MD5); Thu, 12 Mar 2009 10:43:55 -0700 (PDT) Date: Thu, 12 Mar 2009 10:43:24 -0700 (PDT) From: Peter Steele To: Mike Clarke Message-ID: <15189811.81236879800537.JavaMail.HALO$@halo> In-Reply-To: <14148156.61236879772782.JavaMail.HALO$@halo> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: How to auto-detect a USB drive? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2009 17:43:59 -0000 >I do something like this. Here's the rules I have >in /usr/local/etc/devd.conf >... > attach 10 { > match "device-name" "umass0"; > action "sleep 2; /root/bin/usbstick_attach > /dev/console"; >}; I've tried something similar and I'm having good success. I should be able accomplish what I need with this approach. One question: Is there a way to check the label of a device before mounting it? I assume so, since when I insert a FAT32 formatted USB stick I see the messages: Mar 12 10:29:05 r02s17 kernel: GEOM_LABEL: Label for provider da0s1 is msdosfs/MAXIFS. Mar 12 10:29:06 r02s17 kernel: GEOM_LABEL: Label msdosfs/MAXIFS removed. Can I easily get this same information?