Bug 126868 - updfstab only works the first time a flash drive is installed
updfstab only works the first time a flash drive is installed
Status: CLOSED DUPLICATE of bug 119140
Product: Fedora
Classification: Fedora
Component: kudzu (Show other bugs)
2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-28 12:07 EDT by Roderick Johnstone
Modified: 2014-03-16 22:46 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:04:15 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)
kernel message log (2.21 KB, text/plain)
2004-06-30 04:55 EDT, Roderick Johnstone
no flags Details

  None (edit)
Description Roderick Johnstone 2004-06-28 12:07:43 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

Description of problem: updfstab only seems to make an /etc/fstab
entry the first time a USB flash drive is plugged in.


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

How reproducible:
Always

Steps to Reproduce:
1.Plug in flash drive
2.Unplug flash drive
3.Plug in flash drive
    

Actual Results:  /etc/fstab entry for flash drive is made after step
1. After step 2 /etc/fstab entry is gone.

No entry for fash drive is made in /etc/fstab after step 3.

Expected Results:  Entry in /etc/fstab for flash drive after step 3.

Additional info:  If I remove the usb_storage kernel module by hand
then /etc/fstab will be updated as expected next time the flash drive
is installed.
Comment 1 Bill Nottingham 2004-06-29 01:14:44 EDT
Any kernel messages at all related to the device?
Comment 2 Roderick Johnstone 2004-06-30 04:55:20 EDT
Created attachment 101533 [details]
kernel message log

Relevant section of /var/log/messages.

Note that second time the flash device is plugged in there is no corresponding
updfstab entry.
Comment 3 Bill Nottingham 2004-06-30 15:29:16 EDT
This is FC2 with 1.1.62-1? It shouldn't be generating SG warnings
(this is more of a side point, though.)
Comment 4 Roderick Johnstone 2004-07-01 03:51:16 EDT
Yes, I can confirm this is Fedora Core 2 and kudzu-1.1.62-1.
Comment 5 Toralf 2004-07-02 08:30:28 EDT
I get similar behaviour with a "universal USB card reader", and it
seems to me that the problem is simply that updfstab isn't executed at
all. Furthermore, I suspect that the explanation of it all is that
load_drivers() in /etc/hotplug/hotplug.functions, which in turn calls
updfstab, gets executed if, and only if, the module isn't there
already (which it is after inserting, then removing device.) On other
words, the fstab entries are correctly re-inserted after:

1.Plug in drive
2.Unplug drive
3.Plug in drive
4.# updfstab

and, perhaps more intrestingly, also if I do:
1.Plug in drive
2.Unplug drive
3. # rmmod usb-storage 
4.Plug in drive

Comment 6 Toralf 2004-07-02 08:48:49 EDT
I stand corrected: Additional tests show that updfstab does get
executed  - it just somehow fails to identify the unit. I'm still
quite sure that the symptoms I described are genuine, though; the
device entries get added if you execute updfstab a 2nd time, or if the
module wasn't loaded already. Also, I tried changing
/etc/hotplug/hotplug.functions so that updfstab gets executed twice,
and with that setup, I can no longer reproduce the problem.
Comment 7 JLapham 2004-08-01 13:40:08 EDT
I can confirm this bug for another USB device, a 256MB thumbdrive. 
Stock updated FC2 system.  

Below is the dmesg output that follows the device being attached for
the first time (updfstab correctly adds /mnt/flash), being removed
(updfstab correctly removes /mnt/flash) and attached again (updfstab
does not create /mnt/flash).

usb 1-1.1.2: new full speed USB device using address 6
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: OTi       Model: Flash Disk        Rev: 1.11
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 6
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
SCSI device sda: 516096 512-byte hdwr sectors (264 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
updfstab: Using deprecated /dev/sg mechanism instead of SG_IO on the
actual device
usb 1-1.1.2: USB disconnect, address 6
usb 1-1.1.2: new full speed USB device using address 7
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: OTi       Model: Flash Disk        Rev: 1.11
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 516096 512-byte hdwr sectors (264 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 7
Comment 8 HaJo Schatz 2004-08-03 09:34:36 EDT
This appears timing-related to me. If I change line 170 of
/etc/hotplug/hotplug.functions from:

[ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab

to:

if [ -x /usr/sbin/updfstab ]; then
   # HJS
   sleep 5
   /usr/sbin/updfstab
   play /usr/share/sounds/pop.wav
fi

then it appears to work reliably, no matter how often you plug/unplug.
It seems hotplug gets executed by the kernel before the SCSI subsystem
 has fully registered the new devices, so updfstab can't see them yet
(or can't see them all yet as in my case. Out of 4 devices, only the
first usually gets detected.). This would also explain the "first time
OK" behaviour: First time, the usb-storage module has to be loaded
first, whichw would change the timeing somehow. But all this is a
rather wild guess...

BTW: This was not an issue with FC1, neither with RH9. Seems it is
related to kernel 2.6
Comment 9 HaJo Schatz 2004-08-31 09:06:59 EDT
Bill, I guess this is the same bug as 119140, you may want to close
one of the two.
Comment 10 Bill Nottingham 2004-08-31 10:41:07 EDT

*** This bug has been marked as a duplicate of 119140 ***
Comment 11 Red Hat Bugzilla 2006-02-21 14:04:15 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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