Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2009 08:10:46 -0700 (PDT)
From:      Peter Steele <psteele@maxiscale.com>
To:        questions@freebsd.org
Subject:   Re: How to auto-detect a USB drive?
Message-ID:  <20138265.681236784246466.JavaMail.HALO$@halo>
In-Reply-To: <21664605.661236783895798.JavaMail.HALO$@halo>

next in thread | previous in thread | raw e-mail | index | archive | help
>My question to you would be: What exactly do you mean by 
>"automatically detect"? The drive *is* automatically detected. 
>Should it be mounted afterwards? 

Yeah, I guess my wording was a little vague. I know that the system automatically detects when a USB drive is inserted, and creates the appropriate entries under /dev. I want to follow this up with having the drive automatically mounted, and I'll then examine the USB drive for specific files I expect to be present, and possible run something that's installed on the disk, then unmount the disk. We want to use this approach to deploy our software on large clusters of machines that may not have an IP identity. 

>You can use automounters to automatically mount devices when 
>they appear. In order how to determine file systems, slices 
>and partitions on such an USB device, you could, for example, 
>have a look at how FreeSBIE does it. 

If I can hook into an event that signals when a USB disk is inserted, I can take care of verifying the disk is in the format we expect it to be. 

>Additionally, there are already tools integrated in KDE and 
>Gnome that automount USB devices. 

Our boxes have no GUI so these may not work for us. We have a more specific application though and do not need a general purpose automounter. 

-- 
Polytropon 
>From Magdeburg, Germany 
Happy FreeBSD user since 4.0 
Andra moi ennepe, Mousa, ... 



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