Bug 162799

Summary: hotplug does not recognize that the usb-storage device /dev/sda1 exists
Product: [Fedora] Fedora Reporter: Luis A. Florit <cacho96>
Component: halAssignee: John (J5) Palmieri <johnp>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: jkeck
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-12 04:24:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
lshal output
none
/etc/fstab none

Description Luis A. Florit 2005-07-08 18:40:52 UTC
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 18:46:40 UTC
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 23:27:36 UTC
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-30 00:18:10 UTC
Are Fedora bugs being processed? 
I mean: is Fedora alive? 
L. 

Comment 4 John (J5) Palmieri 2005-11-30 02:57:30 UTC
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-12 01:26:16 UTC
Created attachment 122115 [details]
lshal output

Comment 6 Luis A. Florit 2005-12-12 01:29:54 UTC
Created attachment 122116 [details]
/etc/fstab

Comment 7 Luis A. Florit 2005-12-12 01:32:09 UTC
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-12 04:24:07 UTC
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