[NBLUG/talk] Testing for the presence of a disk

Kyle Rankin kyle at nblug.org
Wed Aug 30 09:25:03 PDT 2006


On Wed, Aug 30, 2006 at 09:14:13AM -0700, Lincoln Peters wrote:
> I'm trying to rig an old Pentium I system to work as a photo kiosk,  
> so that I can insert a memory card from any digital camera and  
> quickly copy the contents of the card to the hard disk.   
> Consequently, I need a shell script to be able to determine when a  
> disk has been inserted into a drive, and when it has been removed-- 
> all without any prior knowledge of the nature of the disk (since not  
> all cameras use flash memory).
> 
[snip]
> Lincoln Peters
> <petersl at sonoma.edu>
> 
> It is the quality rather than the quantity that matters.
>                 -- Lucius Annaeus Seneca
> 

I've set up something similar for my usb-storage-capable cameras but the
same method should work for just about any usb-storage device or other
device that works with hotplug. If your system uses hotplug, check out the
following two pages where I document some of the procedure:

http://greenfly.org/tips/usb_drive.html

http://greenfly.org/tips/autofs.html

-- 
Kyle Rankin
NBLUG President
The North Bay Linux Users Group
http://nblug.org
IRC: greenfly at irc.freenode.net #nblug 
kyle at nblug.org



More information about the talk mailing list