LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Refer to SD Drive Location (https://www.linuxquestions.org/questions/linux-newbie-8/refer-to-sd-drive-location-811475/)

twchambers 06-01-2010 08:44 AM

Refer to SD Drive Location
 
Hi,

I have written myself a small script to import my photos from my digital camera. The script copies all of the photos from my SD card into my pictures folder. At present the way I refer to the card is through its actual name ('16GB SD Media' or something similar). The problem arises if I use a different SD card, as it has a different device name.

Is there any way to reference the SD card slot as opposed to the specific SD card, so that it will work with any card inserted?


Thanks in advance,
Tom

amani 06-01-2010 09:21 AM

/media/disk can be the mount point

usually it is /dev/sdc1 if there are two hard disks

Better still use the info in /dev/disk

smoker 06-01-2010 11:46 AM

You could try using udev to run the script when a card is inserted.
http://reactivated.net/writing_udev_rules.html

Fedora now uses udevadm not udevinfo.

Open a terminal and run
Code:

udevadm monitor
and then stick the card in. This will give the base path of the card and you can then use that info to query the attributes and build a rule.


All times are GMT -5. The time now is 04:39 AM.