D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Removable devices help

 

Simon Waters wrote:
> Neil Williams wrote:
>> Windows handles this by writing an autoplay file to the device storage
>> containing an identifier.

> I've seen some stuff on how to persuade devices to mount with the same
> mount point after the first time, if that is useful I'll try and find it
> again. Although more complex stuff might be done with a script as
> hotplug can trigger a script when something is plugged in, and one could
> just remove the standard automounting and do one's own thing
> (filesystems - who need em ;-).
> 

Hi Neil and Simon,

Thanks for the advice, i think i have cracked it late last night and was
going to post back my solution but you beat me to it.

udev seems to do this kind of stuff for you

for my card reader I now have the following udev rules

BUS=="scsi", SYSFS{model}=="USB SM Reader   ",
NAME{all_partitions}="card_sm"
BUS=="scsi", SYSFS{model}=="USB CF Reader   ",
NAME{all_partitions}="card_cf"
BUS=="scsi", SYSFS{model}=="USB SD Reader   ",
NAME{all_partitions}="card_sd"
BUS=="scsi", SYSFS{model}=="USB MS Reader   ",
NAME{all_partitions}="card_ms"

this now creates /dev/card_sm1 /dev/card_sm2 etc (infact 15 partitions
for each sm/cf/sd/ms device)

so the /dev side is sorted then a simple fstab entry can mount
/dev/card_cf1 to /media/cf_card etc.

by poking around in /sys you can find all sorts of parameters that can
be used in the udev rules to identify a single device and choose its
device node based on name/id/serial etc.

I still have a problem with kde media manager, it shows no media. I can
manually create a device icon on my desktop which i can mount/unmount
manually but can't get kde's auto detection to work. In konqueror
media:/ shows nothing. I think its a kde bug haven't tried gnome yet but
as basic /etc/fstab is ok i suspect its a higher level thing.



-- 
Robin Cornelius
http://www.byteme.org.uk

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html