Bug 162799 - hotplug does not recognize that the usb-storage device /dev/sda1 exists
hotplug does not recognize that the usb-storage device /dev/sda1 exists
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: hal (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: John (J5) Palmieri
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-08 14:40 EDT by Luis A. Florit
Modified: 2013-03-13 00:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-12-11 23:24:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
lshal output (100.16 KB, text/plain)
2005-12-11 20:26 EST, Luis A. Florit
no flags Details
/etc/fstab (2.23 KB, text/plain)
2005-12-11 20:29 EST, Luis A. Florit
no flags Details

  None (edit)
Description Luis A. Florit 2005-07-08 14:40:52 EDT
Description of problem:
I used hotplug with FC2 to automagically mount my pen drive.
Although it is executed, the hotplug script /etc/hotplug/usb/usb-storage doesn't
work anymore, and the console shows:

mount: you must specify the filesystem type

I tried  to replace the command

mount /media/key >& /dev/console

in the script /etc/hotplug/usb/usb-storage by the command

mount -t ext3 /dev/sda1 /media/key >& /dev/console

but then the console says:

mount: special device /dev/sda1 does not exist

Of course it does, and the same both commands at the console mount the pen drive
without any error. Interestingly, unmounting when the pen drive is unplugged
while mounted works.

Version-Release number of selected component (if applicable):
FC4 fully updated, 2.6.12-1.1387_FC4, hotplug-2004_09_23-7.
Same result with the original FC4 kernel 2.6.11-1.1369.

How reproducible:
Always. Just plugging the pen drive.

Actual results:
Pen drive not mounted.

Expected results:
Pen drive mounted.
Comment 1 Bill Nottingham 2005-07-08 14:46:40 EDT
I suspect it's racing with udev which is creating the device nodes.

HAL already exists and has hooks for mounting removable storage; assigning there.
Comment 2 Luis A. Florit 2005-07-08 19:27:36 EDT
I think it is not because a 'race'.
The mount error appears after the device was created.
In addition, just in case, I added a "sleep 30 seconds" 
right before the mount command to be sure the device was
created. Same results.
L.
Comment 3 Luis A. Florit 2005-11-29 19:18:10 EST
Are Fedora bugs being processed? 
I mean: is Fedora alive? 
L. 
Comment 4 John (J5) Palmieri 2005-11-29 21:57:30 EST
Hotplug doesn't handle key mounting anymore.  That is done with HAL in FC4 (and
in FC5 hotplug will be removed).  Did you upgrade or do a fresh install?  Please
attach the output of the lshal command and the contents of /etc/fstab with the
key plugged in.  Thanks.
Comment 5 Luis A. Florit 2005-12-11 20:26:16 EST
Created attachment 122115 [details]
lshal output
Comment 6 Luis A. Florit 2005-12-11 20:29:54 EST
Created attachment 122116 [details]
/etc/fstab
Comment 7 Luis A. Florit 2005-12-11 20:32:09 EST
I never do upgrades to versions of Fedora, only to packages. 
So, FC4 was a fresh install. 
I have had tons of problems with HAL. 
Comment 8 John (J5) Palmieri 2005-12-11 23:24:07 EST
So hotplug doesn't work here most likely because the script is being run before
the node is created by udev.  Not really a bug since hotplug shouldn't be used
for this.  Your solutions are to let HAL and gnome-volume-manager to handle it
(gnome-volume-manager is what does the mounting) or you can write a HAL callout
to do it or just run the autofs or automounter daemon (amd) which will mount
drives in fstab when you try to access them.  BTW hardcoding /dev/sda1 /dev/sdb1
etc. could run you into some problems as you never know which device will get
which node name from kernel to kernel.

To see how HAL does things check out the fdi files in /usr/share/hal/fdi.  You
should see a storage-policy fdi file in there that adds the fstab-sync callout.
 Beyond that go to the hal website at  http://freedesktop.org/wiki/Software/hal

Note You need to log in before you can comment on or make changes to this bug.