0.4.7 - hald/kernel race in checking for USB stick partition table

David Zeuthen david at fubar.dk
Mon May 2 10:37:16 PDT 2005


Hi,

On Sun, 2005-05-01 at 22:10 +0400, Andrey Borzenkov wrote:
> See Mandrake bug <http://qa.mandriva.com/show_bug.cgi?id=15224>
> 
> What apparently happens to original poster - his USB stick has both partition 
> 1 and something that looks very much like VFAT signature in block 0 together 
> with valid partition table (I do not know, may be this VFAT superblock even 
> points to the same physical location as that in partition 1). And it is a bit 
> slow before it can be accessed.
> 
> So when hald does initial detect_media(), no partition has yet been detected 
> by kernel (at least, hald did not yet get any hotplug event for it), so it 
> assumes non-partitioned device and goes ahead with detecting filesystem. And 
> it really finds one. Next comes partition hotplug event from kernel and it 
> creates second mount point for partition.
> 
> Why none of them gets mounted I am not sure, may be HAL gets confused at this 
> point.
> 
> What would be the proper fix? The most simple one seems to add MSDOS partition 
> detection to volume_id_probe(..., VOLUME_ID_ALL, ...); what side effects may 
> it have?
> 
> Apparently the same problem exists in 0.5.1 too for all I can tell.

It looks to me like the USB memory stick is formatted in a way that
confuses hal. To solve this, it would be useful to have the contents of
'hald --daemon=no --verbose=yes' cf. 
 
 http://freedesktop.org/wiki/Software_2fHalTraces

Also, it is not clear to me how the user formatted his USB memory stick
- is the file system supposed to be on /dev/sda or /dev/sda1? It looks
from the dd dump of the first two sectors here

 http://qa.mandriva.com/attachment.cgi?id=2964

that it's supposed to be on /dev/sda; maybe the kernel gets it wrong
since it sends /dev/sda1? Or maybe hal gets it wrong. Kay, do you know?

One way to work around this would be to write zeros all over the stick
and repartition and reformat it. It would be better though to fix hal as
far as that is possible.

HTH,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list