I have had the same problem, and after several experiments I found the reason.
The problem is that the hotplug system is invoking the 51-subfs script until
the inserted media gets mounted. However the 51-subfs will not mount
cards inserted via PCMCIA
The Problem is in the 51-subfs will *not* mount media inserted via PCMCIA
since Linux handles it as IDE drive and 51-subfs is designed only to mount
media attached via USB that are handled by Linux as SCSI devices.
You can find more details (in German) in my posting in the SuSE
laptop mailing list.
http://lists.suse.com/archive/suse-l...-Feb/0031.html
What's the solution ?
I have changed the 51-subfs.dev script so it can also mount IDE media,
with other words cards attached via PCMCIA adapter.
Below the changed script.
1) Backup your old 52-subfs script
cp /etc/dev.d/block/51-subfs.dev /etc/dev.d/block/51-subfs.dev.bak
2) Then copy/paste teh listing below in a new file and save it
as /etc/dev.d/block/51-subfs.dev
This should fix the problem. I also have changed the script a little bit,
so that if you have a mountpoint entry in the /etc/fstab for your device
it will use it instead of a automatically generated one.
Hope this helps! For me it worked!
#!/bin/bash
# $Id: 51-subfs.dev 262 2004-08-09 12:22:13Z hare $
# set -x
#
# block hotplug policy agent for Linux kernels
#
# Kernel BLOCK hotplug params include:
# # ACTION=%s [add or remove]
# DEVPATH=%s
#
# bash required due to echo | while read line ; do : ; done
#
# Logic is like this:
# - call hwscanqueue --block for all full disks
# - call hwscanqueue --scan only for usb-storage disks
# - mount devices (either full disks or partitions) if
# HOTPLUG_DO_MOUNT is not 'no' and if an matching entry
# from /etc/fstab or /proc/mounts is found.
#
cd /etc/hotplug
. ./hotplug.functions
. ./hotplug.subfs.functions
# DEBUG=yes export DEBUG
lockfile=/var/lock/block.agent.lock
if [ "$DEVPATH" = "" ]; then
mesg Bad BLOCK invocation: \$DEVPATH is not set
exit 1
fi
# Check whether we need to execute anything at all
if [ "$HOTPLUG_DO_MOUNT" == "no" ]; then
exit 0
fi
waitforlock()
{
local pid=""
local i=""
# fail redir if file exists
set -o noclobber
while ! { echo $$ > $lockfile; } 2>/dev/null; do
read i < $lockfile
if [ -z "$i" -o ! -d "/proc/$i" ] ; then
rm -f $lockfile
else
if [ "$i" != "$pid" ] ; then
mesg "waiting for $lockfile, process $i holds it"
pid=$i
fi
## sleep between .4 and 1 second
#usleep $((RANDOM%6000*100+400000))
usleep 400000
fi
done
trap "rm -f $lockfile" EXIT;
set +C
}
check_mount_entry ()
{
ncookie=$(udevinfo -p $DEVPATH -q name)
scookie=$(udevinfo -p $DEVPATH -q symlink)
debug_mesg ncookie $ncookie
debug_mesg scookie $scookie
if [ -n "$scookie" -o -n "$ncookie" ] ; then
for entry in $scookie $ncookie ; do
i="`echo ${i} | sed -e 's@/@\\/@g'`"
i=`sed -e "/\/dev\/$i[[:blank:]]/q;d" /etc/fstab`
if [ ! -z "$i" ] ; then
debug_mesg found $entry in fstab
entry=""
break
fi
i=`sed -e "/\/dev\/$i[[:blank:]]/q;d" /proc/mounts`
if [ ! -z "$i" ] ; then
debug_mesg found $entry in /proc/mounts
entry=""
break
fi
done
fi
if [ -z "$scookie" ] ; then
entry=$ncookie
else
entry="${scookie%% *}"
fi
echo $entry
}
#
# generic section
#
if [ ! -w /media ]; then
# Can't write to /media, nothing to do here
exit 0;
fi
# we need locking to avoid races when modifying fstab
if [ "$HOTPLUG_MOUNT_TYPE" = fstab ] ; then
waitforlock
fi
do_mount=
if [ "$DEVNAME" ] ; then
real_device="$DEVNAME"
else
real_device=/dev/${DEVPATH##*/}
fi
# do only mount devices connected via USB or Firewire
# check whether the devpath has a 'device' link
pname=""
if [ -e /sys$DEVPATH/device ]; then
dname=`cd -P /sys$DEVPATH/device; echo $PWD`
else
if [ -e /sys$DEVPATH/../device ]; then
dname=`cd -P /sys$DEVPATH/../device; echo $PWD`
fi
fi
# Get the type of disk
if [ -n "$dname" -a -f ${dname}/scsi_level ]; then
pname=${dname%/*}
pname=/sys/class/scsi_host/${pname##*/}/proc_name
if [ -f "$pname" ]; then
read dtype < "$pname"
if [ "$dtype" = "usb-storage" -o "$dtype" = "sbp2" ]; then
# We only need to mount USB and FireWire devices
do_mount=maybe
fi
fi
fi
############ Change by V.A #########################
##### Now we check also for PCMICIA Discs ##########
if [ -n "$dname" -a -z "$do_mount" ]; then
pt_name=${DEVNAME##*/}
path_name=$dname/block/$pt_name
if [ -d $path_name ]; then
do_mount=whynot
fi
fi
########### Change End ############################
#
# do the real action
#
case $ACTION in
add)
mesg "mount block device $DEVPATH"
# entry=`check_mount_entry` #This line disabled by V.A.
############ Change by V.A ########################
####### Check if there is already an entry ########
####### in /etc/fstab for the device ########
####### if there use it as mountpoint ########
###################################################
entry=$(grep $real_device /etc/fstab|awk '{print $2'})
if [ -z "$entry" ]; then
entry=`check_mount_entry`
fi
############# Change End ##########################
if [ -n "$entry" -a -n "$do_mount" ] ; then
mount_media "$entry" "$real_device"
fi
rm -f $lockfile
;;
remove)
mesg "umount block device $DEVPATH"
# entry=`check_mount_entry` #This line disabled by V.A.
############ Change by V.A ########################
entry=$(grep $real_device /etc/fstab|awk '{print $2'})
if [ -z "$entry" ]; then
entry=`check_mount_entry`
fi
############# Change End ##########################
if [ -n "$entry" ] ; then
unmount_media "$entry" "$real_device"
fi
rm -f $lockfile
;;
*)
debug_mesg BLOCK $ACTION event not supported
exit 1 ;;
esac