Bug 144537 - devlabel not automounting when run by hotplug
Summary: devlabel not automounting when run by hotplug
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: devlabel (Show other bugs)
(Show other bugs)
Version: 3.0
Hardware: i686 Linux
Target Milestone: ---
Assignee: Karel Zak
QA Contact:
: 102056 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-01-07 22:35 UTC by Tom Parris
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-11 12:09:59 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Tom Parris 2005-01-07 22:35:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)

Description of problem:
devlabel does not automount a usb memory stick when from from hotplug.
 However, it does when run by hand (/sbin/devlabel restart).

# relevent messages from /var/log/messages
Jan  7 17:09:46 magnolia /etc/hotplug/usb.agent: Setup usb-storage for
USB product d7d/100/100
Jan  7 17:09:46 magnolia devlabel: devlabel's temporary ignore list
/etc/sysconfig/devlabel.d/ignore_list has been emptied due to a change
in device configuration.
Jan  7 17:09:46 magnolia kernel: SCSI device sda: 256000 512-byte hdwr
sectors (131 MB)
Jan  7 17:09:46 magnolia kernel: sda: Write Protect is off
Jan  7 17:09:46 magnolia kernel:  sda: sda1
Jan  7 17:09:48 magnolia devlabel: devlabel service started/restarted
Jan  7 17:09:49 magnolia devlabel: The symlink /dev/memstick ->
/dev/sda1 is being ignored in /etc/sysconfig/devlabel because the
correct device cannot be found.

# relevant messages when run by hand
[root@magnolia sysconfig]# /sbin/devlabel restart
SYMLINK: /dev/memstick -> /dev/sda1
[root@magnolia sysconfig]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
[stuff deleted]
/dev/memstick           126566    116732      9834  93% /mnt/memstick

# fstab entry
/dev/memstick           /mnt/memstick           auto    noauto,owner 0 0

# /etc/sysconfig/devlabel
/dev/memstick /dev/sda1 S:IMCKanguruMicrosector32 automount

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. umount /mnt/memstick
2. remove memory stick from usb port
3. insert memory stik into usb port
4. get error in /var/log/messages 
"The symlink /dev/memstick -> /dev/sda1 is being ignored in
/etc/sysconfig/devlabel because the correct device cannot be found."
5. /sbin/devlabel restart
"SYMLINK: /dev/memstick -> /dev/sda1"
6. verify device mounted (e.g., ls /mnt/memstick)

Additional info:

This may be a timing issue.  Is it possible that hotplug is running
devlabel before the new usb device is recognized and bound to /dev/sda1?

This may also be related to bug id#102056 (devlabel needs to be run twice)

Comment 1 Bill Nottingham 2005-01-07 22:40:35 UTC
Do the fixes in bug 144241 work for you?

Comment 2 Tom Parris 2005-01-10 13:34:34 UTC
Thanks for the quick response.  I tried the patch.  Unfortunately, it
did not appear to change the behavior reported above.

Comment 3 Bill Nottingham 2005-01-21 23:14:42 UTC
*** Bug 102056 has been marked as a duplicate of this bug. ***

Comment 4 Karel Zak 2005-07-21 09:25:49 UTC
Yes, it seems like timing problem, but I have no idea how we can decide when we
should wait for device and when it's correct that the device doesn't exist.

Any idea?

Comment 5 Tom Parris 2005-07-21 14:21:01 UTC
I'm far from an expert on the internals of hotplug and devlabel.  But it seems
that when hotplug detects the new device, it should wait until the device
(/dev/sda1 in the example above) is ready before calling devlabel to mount it.  

Isn't this as simple as a loop waiting for the device to show up in the file
system?  The delay between checks could be fairly long (1 second) since this is
not a time sensitive task.

This could also be done in usb.agent, but I think it better done in hotplug
since this would be a common issue across all buses.

My two bits.

Comment 6 Karel Zak 2005-07-21 15:26:29 UTC
I think hotplug doesn't detect any device. It calls modprobe and all depends on
kernel modules. I'm really not sure that kernel must always create
/dev/something. It depends on type of USB/PCMCIA/etc.

Add CC: to hotplug maintainer. 

Comment 7 Bill Nottingham 2005-07-21 15:39:28 UTC
Realistically, it should probably be running from the SCSI hotplug event, not
the USB one.

However, the 2.4 kernel doesn't generate SCSI hotplug events. That makes this
awfully hard to fix.

Comment 8 Karel Zak 2005-10-11 12:09:59 UTC
Sorry, it seems like WONTFIX. Closing.

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