Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 2009 10:43:24 -0700 (PDT)
From:      Peter Steele <psteele@maxiscale.com>
To:        Mike Clarke <jmc-freebsd2@milibyte.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to auto-detect a USB drive?
Message-ID:  <15189811.81236879800537.JavaMail.HALO$@halo>
In-Reply-To: <14148156.61236879772782.JavaMail.HALO$@halo>

next in thread | previous in thread | raw e-mail | index | archive | help
>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? 




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