Bugzilla – Bug 115137
HAL 'missdetect' main devices with broken file systems
Last modified: 2006-07-18 14:52:45 UTC
When I insert my USB flash disk, it detects it but very often can't automatcally mount it in KDE Konqueror, which results in errors. on average, that auto-mounting of USB flash disk fails 80% of the time.
please try to reproduce with beta4 and definde "USB flash disk"
USB flash disk - M-systems 256MB, USB2 interface. (as far as I know, not sure) linux:~ # lsusb Duplicate product spec at line 2453 product 0846:4240 WG111 WiFi Bus 004 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 002 Device 009: ID 08ec:0011 M-Systems Flash Disk Pioneers Bus 002 Device 002: ID 045e:0059 Microsoft Corp. Wireless IntelliMouse Explorer Bus 002 Device 001: ID 0000:0000 Bus 001 Device 003: ID 046d:c216 Logitech, Inc. Bus 001 Device 001: ID 0000:0000 Is there any way that the system defines me that USB disk better? (i.e. USB 1 or USB 2 interface?) My hardware: AMD Sempron CPU, 1GB RAM, VIA KM400 chipset. ========================= Currently downloading BETA4, once done, I will post it here.
OK, so now I have BETA4. Still USB flash doesn't work !
Coolo, could there be a race condition? When is kde being notified for a new device? Is it possible that KDE acknowledges the new device _before_ submount has handled it?
I would like to know what you're doing exactly. KDE gets the device unmounted first and then updates its status to mounted (signalled by a green triangle at the edge within media:/). As it works for me, I see no general problem. Please describe _exactly_ what you're seeing and what you're doing there. Also provide the output of lshal --monitor (only the end) when you attach the key.
Exactly? huh... OK: 1) Take my USB flash disk. 2) Remove the plastic part so that I can plug it inside. 3) Plug it inside 4) Green led on my USB flash disk activated. 5) Open KDE Konqueror 3.4.2 (from SuSE 10.0 , BETA 4) 6) Click on storage media 7) For a totally mysterious reason I see 2 (!!) USB flash disks, through I have only one. 8) Click on the first USB disk image - Konqueror goes to state "media:/sda" but neither files nor directories are shown. 9) Press back button 10) Click on the second USB disk image - Konqueror goes to state "media:/sda1" but neither files nor directories are shown. 11) trying to do that manually, failing again; linux:~ # mkdir -p /mnt/removable/ linux:~ # mount -t auto /dev/sda /mnt/removable/ linux:~ # cd /mnt/removable/ linux:/mnt/removable # ls /bin/ls: reading directory .: Input/output error ============================================================================ Mount command: ..... /dev/sda on /media/usbdisk type subfs (rw,nosuid,nodev,sync,fs=ext2) /dev/sda1 on /media/usbdisk_1 type subfs (rw,nosuid,nodev,sync,fs=floppyfss,procuid,utf8=true) /dev/sda on /mnt/removable type ext2 (rw) linux:~ # Also I have attached a log of "lshal --monitor"
Created attachment 48821 [details] "lshal --monitor" log file
Created attachment 48824 [details] KDE Konqueror showing 2 USB flash disks.
Tried the new RC1, same error !!!
please do this: - stop hal (with 'rchal stop') - hald --verbose=yes --daemon=no --retain-privileges > /tmp/hal_log 2>&1 - wait 10 seconds - plugin the USB stick - wait 20 seconds - stop hal with 'Ctrl + C' Attach the file /tmp/hal_log to this bug
@Kay: please take a look at this bug! HAL detects a partition/volume at /dev/sda this should IMO not happen. I have no time to do this.
@Kay: is this at /dev/sda/ maybe the extended partition? @Alexey: please attach also this: - 'fdisk -l' - if the device is mounted: 'ls -lha /media'
@Alexey: Sorry, but please also attach the output of 'cat /proc/mounts' if the device is mounted
Created attachment 49494 [details] My HAL log (it's huge, over 3MB!!) - so it's compressed
Created attachment 49496 [details] my "fdisk -l" log, when USB flash inserted
Created attachment 49497 [details] my "ls -lha /media > /tmp/media.log" when USB flash inserted
Created attachment 49498 [details] My "cat /proc/mounts" log, when USB flash inserted
Is this information sufficient to understand the problem better?
Hello again! So, is there any progress ?
I see: volume.fstype = 'ext2' in the logfile. Did you ever format this usb stick with Linux ext format? If yes: That may not work if you use one of the horrible unix FAT formatting tools. The disk needs to be invalidated with a smarter tool or at least the first 64kb need to be invalidated with zeros, before you switch the filesystem. If not: The ext filesystem signature is only 2 bytes long, so it may be just coincidence and we should add a check for that.
well, that Flash disk was actually formatted with FAT. After reformatting the problem disappeared. Now USB Flash disk hot plug-in works in both Windows & Linux. Bug rendered unreproduceable. Closing.
Thanks for testing it. You never formatted that volume with any ext format, right? Anyway, we should fix it some day, when we found out how to fix it. :) I've put it on my TODO list and posted it to the HAL list http://lists.freedesktop.org/archives/hal/2005-September/003297.html
*** Bug 115552 has been marked as a duplicate of this bug. ***
*** Bug 127511 has been marked as a duplicate of this bug. ***
Reopend the bug. We must fix this.
Do you have an idea how to fix it?
Is there ever a situation, where a harddisk or USB-Stick could contain a formated partion/volume on e.g. /dev/sdb or /dev/sda? I'm not complete sure, but I don't think so. Partitions should always be on e.g. /dev/sda{1,2,3...n}. In this case we could remove the complete device in HAL. Or any other ideas?
Sure, there are formatted main block devices. A FAT filesystem on /dev/sda is a common use.
I really do think everybody should be able to view this bug ...
I remarked that when I plug in the USB-stick, 2 devices (/dev/sdb and /dev/sdb1) will be marked as mounted in the command mount, while none of them could be read or written to. When manually I unmount the device /dev/sdb, all goes right. Perhaps is the mount /dev/sdb blocking the device to mount properly, showing the kernel messages: submountd: unable to mount media: device or ressource busy. How do I prevent the system to try to mount /dev/sdb?
Your device has a broken layout. You need to zero-out the first blocks of the device before you apply a new filesystem or apply a partitiontable. Your superblock contains a valid filesystem signature, but is actually a partitiontable. Sane formatting tools, like ones who use libparted do this. Most of the unix formatting tools are completely broken in that area and should be avoided or only used after at least the first and last 64 kilobytes of the device are written with zeros. I gave up convincing the maintainers of the filesystem formatters, they like to stick with the middle age. :( HAL may need a fix to invalidate a "main device" if a child arrives, but that is not an easy fix and we are not sure abou the right fix...
Indeed. I partitioned the USB stick with parted and now all went fine. Thanx for your help.
That's OK. My IP has changed, so the opened NX session shouldn't worry you. Please open this bug to the public. (I can't help with this bug because my flash disk currently works OK - but it didn't worked - it was ALWAYS formatted with FAT. Never with ext3/reiserfs/...)
As for your question: I have always mounted my USB flash disk with: mount -t vfat /dev/sda /mnt/removable you see: /dev/sda it's NOT /dev/sda1
Just an info for you. I have at home an usb stick (in fact an MP3 player) with a FAT filesystem in /dev/sda. Due to the fact this usb stick is also a MP3 player, I can't create partitions on it. I tried but the MP3 player didn't recognize at all the partition. It only works if the whole drive (/dev/sda) is formated as a FAT filesystem. So if I plug this usb stick on an old SUSE 9.3, all is working well and I can copy at over 1MB/s my files on it. On SUSE 10.0, the speed is about 40 kB/s (tested on two different hardware) !!!! Could I open a new bug report for this ?
Thats' thee same for me. Speed is about 30KB/s, and before I formatted thee USB-Stick,I ahd problems to mount it, but once resolved (mounted by hand), the speed was about 2-3MB/s. Now the automount works, but speed is very low. What can do now?
See bug #105871
Closing this bug now, cause the speed issue is on #105871.
Kay: I reopen the bug. We need to fix the bug with wrong detect raw device as partition. I work on a solution as discussed to prevent this problem. other: please don't discuss other things in the bug than in the summary.
Still valid?
ihno: yes, already valid ... we look already for a acceptable solution.
I change this to RESOLVED LATER, because we have currently no well working solution.
reopen to comment and close
This is now [1] fixed in HAL and the kernel. This should be part of openSUSE 10.2 release. I close the bug as WONTFIX for SL10.1 [1] http://lists.freedesktop.org/archives/hal/2006-July/005563.html