View Full Version : Confirmation of usb flashdrive mounting behaviour as usual?
lesliek
2005-03-27, 11:25 PM CST
I'm using Fedora Core 3.
I'll set out below the mounting behaviour of my usb flash drive. I'd be very grateful if anyone could tell me whether this is what I should expect? If not, how may I fix it (if at all)?
1. If I boot up with my usb flash drive already plugged in, it's automounted.
2. If I boot up without my usb flash drive plugged in and then plug it in, it's automounted.
3. If my usb flash drive is automounted and I then unmount it by right-clicking on either of its icons (the one on the desktop or the one in the "Computer" window) and selecting "unmount volume", BUT DO NOT UNPLUG IT, I can then remount it by right-clicking on its icon in the "Computer" window and selecting "mount volume". (I'm not suggesting I'd ever be likely to want to do this in the real world. I only did it as an experiment.)
4. However, if I unmount the drive as in #3 AND THEN UNPLUG IT, its icon in the "Computer" window disappears. When I plug it in again (not having rebooted), it does not automount. Nor does its icon reappear in the "Computer" window, so that I cannot even remount it by the method mentioned in #3.
mungoose
2005-03-28, 08:33 PM CST
Your problem is caused by the kernel - see http://blog.gmane.org/gmane.linux.kernel/day=20050325
Look for the entry made by James Bottomley on 25 Mar 01:45
lesliek
2005-03-28, 09:07 PM CST
Thanks very much for your reply, Mungoose. I looked at the entry to which you drew my attention and, as well, to the comments on that entry. I'll just have to take your word for it that what that entry shows is that my problem's caused by the kernel!
I should add that, after posting my original query, I kept googling for discussion of the topic and finally found "Bugzilla Bug 119140--plugging in usb flash device sometimes fails to update /etc/fstab". The ultimate suggestion there was that a problem like mine was caused by the then-current version of hotplug and had been fixed in a later version of it.
Armed with that idea, I downloaded the latest version of hotplug (which was a later one than the one said to have fixed the problem) and installed it, but it made no difference to my situation.
However, before that ultimate suggestion was made, someone provided a patch which seemed to solve the problem for some at least. I saved a copy of that patch, just to have a record of it. I now set it out between the asterisks.
****
--- hotplug-2004_04_01/etc/hotplug/scsi.agent.foo 2005-02-07 18:27:13.000000000 -0500
+++ hotplug-2004_04_01/etc/hotplug/scsi.agent 2005-02-07 18:27:31.000000000 -0500
@@ -59,8 +59,15 @@
else
debug_mesg "how to add device type=$TYPE at $DEVPATH ??"
fi
+ if [ -x /usr/sbin/updfstab ]; then
+ /usr/sbin/updfstab
+ fi
+ ;;
+remove)
+ if [ -x /usr/sbin/updfstab ]; then
+ /usr/sbin/updfstab
+ fi
;;
-
*)
debug_mesg SCSI $ACTION event not supported
exit 1
--- hotplug-2004_04_01/etc/hotplug/usb.agent.foo 2005-02-07 18:27:21.000000000 -0500
+++ hotplug-2004_04_01/etc/hotplug/usb.agent 2005-02-07 18:27:33.000000000 -0500
@@ -439,10 +439,6 @@
$REMOVER
fi
rm -f $REMOVER
-
- if [ -x /usr/sbin/updfstab ]; then
- /usr/sbin/updfstab
- fi
;;
*)
--- hotplug-2004_04_01/etc/hotplug/hotplug.functions.foo 2005-02-07 18:27:25.000000000 -0500
+++ hotplug-2004_04_01/etc/hotplug/hotplug.functions 2005-02-07 18:27:27.000000000 -0500
@@ -166,9 +166,6 @@
if [ "$LOADED" = "false" ]; then
mesg "missing kernel or user mode driver $MODULE "
fi
- if echo "$MODULE" | grep -q "usb-storage" > /dev/null 2>&1 ; then
- [ -x /usr/sbin/updfstab ] && /usr/sbin/updfstab
- fi
done
}
****
I simply have no idea whatever what one is to do with this patch to install it. I do have a file called /etc/hotplug/scsi.agent, which is mentioned in the patch. Is the patch to be added to that file, substituted for it, installed as a separate executable file or none of the above?
Any further information about the patch would be welcome.
mungoose
2005-03-29, 04:26 AM CST
I do not know were you got this patch from. So I can't say anything about it.
At least the program /usr/sbin/updfstab is not present on FDC systems. FDC uses the program fstab-sync to update /etc/fstab.
However, based on your patch listing above I looked into the /etc/hotplug/scsi.agent and usb.agent files.
While I looked into the /etc/hotplug/usb.agent file I recognized that the script is broken. Looking at other the .agent files the same error appears in firmware.agent (once) and in pci.agent twice.
Short:
When writing a mathematical formula someone has to take care to use for each opening sign - f.e. ( - a closing sign - f.e. ).
This is also true in scripting languages like bash.
What happened in the scripts is that someone forgot to include specific embedded macros in corresponding opening and closing signs. Therefore , the bash interpreter might resolve this line incorrect by choking parts of the script without giving any warning.
The offending files and lines are:
/etc/hotplug/firmware.agent - line 26 reads:
SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)
should read:
SYSFS="$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)"
/etc/hotplug/pci.agent - line 64 reads:
set $(echo $PCI_ID | sed -e 's/\([^:]*\):\(.*\)/\1 \2/')
should read:
set "$(echo $PCI_ID | sed -e 's/\([^:]*\):\(.*\)/\1 \2/')"
same file - line 68 reads:
set $(echo $PCI_SUBSYS_ID | sed -e 's/\([^:]*\):\(.*\)/\1 \2/')
should read:
set "$(echo $PCI_SUBSYS_ID | sed -e 's/\([^:]*\):\(.*\)/\1 \2/')"
/etc/hotplug/usb.agent - line 183 reads:
set $(echo $PRODUCT | sed -e 's+\([^/]*\)/\([^/]*\)/\(.*\)+\1 \2 \3+')
should read:
set "$(echo $PRODUCT | sed -e 's+\([^/]*\)/\([^/]*\)/\(.*\)+\1 \2 \3+')"
As administrator root fire up your editor and add the missing " signs to the files and lines mentioned before.
I haven't tested the result but parts of the problems with USB devices might get solved because /bin/bash can't choke on this lines anymore.
lesliek
2005-03-29, 03:46 PM CST
Thanks for your reply, Mungoose.
I now understand what you say about the patch (which was created by someone from Red Hat) being of no possible use to me, since FC3, unlike FC2, does not use updfstab.
As to the missing quotation marks in usb.agent, firmware.agent and pci.agent, I'll add them in and see if that makes any difference.
Thanks again.
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.