! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
some removable devices show up as two devices instead of one
Status:
CLOSED: FIXED
Product:
Thunar-vfs
Component:
General

Comments

Description Brian J. Tarricone (not reading bugmail) 2007-01-22 12:03:55 CET
This is annoying, because we get an extra unusable icon for another volume, and thunar-volman tries to mount it, fails, and pops up an error.

Partition layout looks like this:

brian@kepler ~ $ sudo mac-fdisk -l /dev/sda
/dev/sda
        #                    type name                length   base    ( size )  system

/dev/sda1     Apple_partition_map Apple                   63 @ 1       ( 31.5k)  Partition map

/dev/sda2               Apple_HFS hfsplus_journal_test  516544 @ 64      (252.2M)  HFS

Block size=512, Number of Blocks=516608
DeviceType=0x0, DeviceId=0x0


hal-device says:

0: udi = '/org/freedesktop/Hal/devices/volume_uuid_161E77AE1622C6C0'
  volume.unmount.valid_options = { 'lazy' } (string list)
  volume.mount.valid_options = { 'ro', 'sync', 'dirsync', 'noatime', 'nodiratime
', 'noexec', 'quiet' } (string list)
  org.freedesktop.Hal.Device.Volume.method_execpaths = { 'hal-system-storage-mou
nt', 'hal-system-storage-unmount', 'hal-system-storage-eject' } (string list)
  org.freedesktop.Hal.Device.Volume.method_signatures = { 'ssas', 'as', 'as' } (
string list)
  org.freedesktop.Hal.Device.Volume.method_names = { 'Mount', 'Unmount', 'Eject'
 } (string list)
  info.interfaces = { 'org.freedesktop.Hal.Device.Volume' } (string list)
  volume.ignore = false  (bool)
  info.udi = '/org/freedesktop/Hal/devices/volume_uuid_161E77AE1622C6C0'  (strin
g)
  info.product = 'hfsplus journal test'  (string)
  volume.size = 264470528  (0xfc38000)  (uint64)
  volume.num_blocks = 516544  (0x7e1c0)  (int)
  volume.block_size = 512  (0x200)  (int)
  volume.partition.number = 2  (0x2)  (int)
  info.capabilities = { 'volume', 'block' } (string list)
  info.category = 'volume'  (string)
  volume.is_partition = true  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  volume.mount_point = ''  (string)
  volume.label = 'hfsplus journal test'  (string)
  volume.uuid = '161E77AE1622C6C0'  (string)
  volume.fsversion = ''  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fstype = 'hfsplusj'  (string)
  storage.model = ''  (string)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_CBM2080_Fl
ash_Disk'  (string)
  block.is_volume = true  (bool)
  block.minor = 2  (0x2)  (int)
  block.major = 8  (0x8)  (int)
  block.device = '/dev/sda2'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_CBM2080_Flash_Disk'
  (string)
  linux.sysfs_path_device = '/sys/block/sda/sda2'  (string)
  linux.sysfs_path = '/sys/block/sda/sda2'  (string)

1: udi = '/org/freedesktop/Hal/devices/volume_part1_size_32256_0'
  info.udi = '/org/freedesktop/Hal/devices/volume_part1_size_32256_0'  (string)
  info.product = 'Volume'  (string)
  volume.size = 32256  (0x7e00)  (uint64)
  volume.num_blocks = 63  (0x3f)  (int)
  volume.block_size = 512  (0x200)  (int)
  volume.partition.number = 1  (0x1)  (int)
  info.capabilities = { 'volume', 'block' } (string list)
  info.category = 'volume'  (string)
  volume.is_partition = true  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  volume.mount_point = ''  (string)
  volume.label = ''  (string)
  volume.uuid = ''  (string)
  volume.fsversion = ''  (string)
  volume.fsusage = ''  (string)
  volume.fstype = ''  (string)
  storage.model = ''  (string)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_CBM2080_Fl
ash_Disk'  (string)
  block.is_volume = true  (bool)
  block.minor = 1  (0x1)  (int)
  block.major = 8  (0x8)  (int)
  block.device = '/dev/sda1'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_CBM2080_Flash_Disk'
  (string)
  linux.sysfs_path_device = '/sys/block/sda/sda1'  (string)
  linux.sysfs_path = '/sys/block/sda/sda1'  (string)


The second volume there is the partition map.
Comment 1 Benedikt Meurer editbugs 2007-01-22 12:07:04 CET
So we're back at filtering the fsusage. I'll cook a patch.

BTW: Does thunar-volman really try to mount that?
Comment 2 Ben Ford 2007-01-22 22:55:11 CET
What is mac-fsdisk?  I don't know if I'm seeing the same problem or not.

# fdisk -l /dev/ipod

Disk /dev/ipod: 20.0 GB, 20000267776 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/ipod1               1           5       40131    0  Empty
/dev/ipod2               6        2431    19486845    b  W95 FAT32
Comment 3 Ben Ford 2007-01-22 22:56:54 CET
Created attachment 953 
hal-device output

This is a 20gb color iPod with "enable disk usage" and VFAT formatted.
Comment 4 Ben Ford 2007-01-22 23:01:30 CET
n/m about mac-fdisk.  I found, installed, ran it.  It says "No partition map exists."

Either I'm seeing another bug, or this one is mislabeled.
Comment 5 Gregoire Gentil 2007-01-23 20:13:53 CET
I think that I hit this bug too. I have an ipod nano 4GB and I have the same problem. The device is partitioned into two disks. And I have two icons on the desktop, one of them is not working. Note that this problem didn't exist two or three weeks ago.
Comment 6 Brian J. Tarricone (not reading bugmail) 2007-01-24 00:28:55 CET
Right, you shouldn't see anything.  mac-fdisk is for drives using the Mac partition format, not for normal DOS partition tables.  Not sure if it's the same problem that you're seeing; we can let Benny decide ^_^
Comment 7 Brian J. Tarricone (not reading bugmail) 2007-01-28 02:37:58 CET
Ok, I just plugged my iPod into my desktop machine (the iPod is FAT-formatted and has a DOS partition table), and I'm seeing 2 devices now: "Apple iPod Music Player" and "Brian's iPod", the latter of which is the actual mountable partition.  (I think the volume label is actually "BRIAN TARRI" because FAT volume label limits suck, but I override the display name via a HAL .fdi file).

Anyway, this didn't always happen; I think the last time I had the iPod plugged in here and it worked properly was around 18 December.  The current revision of thunar I have installed is r24519, dated 16 January, so it seems to have crept in sometime in that 1-month period.  (I also just updated to current rev 24772 of both exo and thunar, and the problem remains.)
Comment 8 Gregoire Gentil 2007-01-28 18:51:57 CET
Benny,

May I ask you if you can look at this problem. I would like to do a release and I wish to include a fix for this problem. Many thanks by advance.
Comment 9 Centinul 2007-02-11 03:13:18 CET
(In reply to comment #8)
> Benny,
> 
> May I ask you if you can look at this problem. I would like to do a release and
> I wish to include a fix for this problem. Many thanks by advance.
> 

I found this portion of code in exo-mount-hal.c:

/* check if we should ignore this device */
if (libhal_device_get_property_bool (hal_context, udis[n], "info.ignore", NULL))
continue;

I then took a look at the HAL specification and looked at the "info" namespace. info.ignore is not specified in this namespace. The only place that ignore is specified is in the "volume" namespace. That begs the question, should the above code be changed to this:


/* check if we should ignore this device */
if (libhal_device_get_property_bool (hal_context, udis[n], "volume.ignore", NULL))
continue;

I apologize if I'm way off. Thanks.
Comment 10 Gregoire Gentil 2007-02-11 08:53:32 CET
This is very interesting and we are on our way to fix this bug but unfortunately, your suggestion doesn't fix the problem.

- First, if you take a look at the hal report for this iPod, we have volume.ignore = false  (bool) for /dev/sda2 and NOTHING for /dev/sda1.

- Remember that we want to hide anything about /dev/sda1.

- The code you touched is to mount the volume, not about the icons that are shown.

Bottom-line, there is some code somewhere else that needs to be modified with a similar suggestion as yours.

But I wonder whether you are not right about info.ignore that should be replaced by volume.ignore as info.ignore doesn't exist in the report, it's volume.ignore.

There are definitely two bugs here.

Note that when I plugged my iPod with your modification, I got an error of /dev/sda1 cannot be mounted. I have ivman that calls exo-mount and with your modif, it's /dev/sda1 is tried to be automatically mounted.

In the code, you should NOT "continue;" only if volume.ignore==false. But that will not fix the fact that two icons appears on the desktop.
Comment 11 Centinul 2007-02-12 17:10:53 CET
(In reply to comment #10)
> This is very interesting and we are on our way to fix this bug but
> unfortunately, your suggestion doesn't fix the problem.
> - First, if you take a look at the hal report for this iPod, we have
> volume.ignore = false  (bool) for /dev/sda2 and NOTHING for /dev/sda1.
> - Remember that we want to hide anything about /dev/sda1.
> - The code you touched is to mount the volume, not about the icons that are
> shown.
> Bottom-line, there is some code somewhere else that needs to be modified with a
> similar suggestion as yours.
> But I wonder whether you are not right about info.ignore that should be
> replaced by volume.ignore as info.ignore doesn't exist in the report, it's
> volume.ignore.
> There are definitely two bugs here.
> Note that when I plugged my iPod with your modification, I got an error of
> /dev/sda1 cannot be mounted. I have ivman that calls exo-mount and with your
> modif, it's /dev/sda1 is tried to be automatically mounted.
> In the code, you should NOT "continue;" only if volume.ignore==false. But that
> will not fix the fact that two icons appears on the desktop.

I don't think it's Thunar-Volman's fault that it is trying to mount the first partition on the iPod. To avoid thunar-volman from automounting that partition I wrote a *.fdi file that ignored the first partition. That so far has appeared to work from a mounting standpoint.

Like you said though, there is an icons problem. Even though I'm ignoring the first partition the icons are still showing up on my deskop.

If I get a chance later I'll take a look at the code some more. Although I'll freely admit, that I don't know much about the XFCE code and I don't know how to test changes.

Thanks.
Comment 12 Gregoire Gentil 2007-02-12 17:53:12 CET
I don't use thunar-volman which is too recent.

It was working before, meaning only one icon was on the desktop and it was mounting fine. Unfortunately, I can't revert to a previous version of exo as it will break so many other stuff.

Your suggested modification change what is automounted (remember that I use ivman). So exo has obviously an impact on what is mounted.

So, I still think that all the problems are in exo and there are two problems:

- the error you pointed out. But your fix was not correct. I suggest more something like:

if (libhal_device_get_property_bool (hal_context, udis[n], "volume.ignore",
NULL)!=FALSE)
continue;

- the two icons that appear in Thunar and xfdesktop. As you suggested, a dirty fix would be to add a rule in preferences.fdi.

If only Benny could jump into the discussion...


Comment 13 Gregoire Gentil 2007-02-12 18:10:29 CET
My understand is that both xfdesktop and thunar uses thunar-vfs which uses exo. I still think that there are two bugs as I mentioned earlier. For the second bug (icon for sda1) I can't find where exo checks if the disk is valid (perhaps it doesn't and a rule should be added to hal) but it was working before...
Comment 14 Benedikt Meurer editbugs 2007-02-12 19:26:23 CET
Created attachment 994 
Suggested fix

This patch should fix the issue. Please verify.
Comment 15 Gregoire Gentil 2007-02-13 05:25:44 CET
Yes, it fixes the problem of the two icons on the desktop.

Benny, you are the man!!! Thanks for your help on this one.

Comment 16 Centinul 2007-02-18 19:36:14 CET
(In reply to comment #15)
> Yes, it fixes the problem of the two icons on the desktop.
> 
> Benny, you are the man!!! Thanks for your help on this one.
> 

It didn't completely work for me. I applied the patch, restarted and when I plugged my iPod in, only one icon showed up on the desktop but it still tried to mount the partition that isn't mountable. 

Do I have a configuration error?

Thanks.
Comment 17 Gregoire Gentil 2007-02-18 19:43:38 CET
I have the same error. I didn't want to ask too much so I didn't mention it in my previous enthusiastic posting.

The problem is that exo-mount reports a message error when it can't mount a disk while pmount didn't report any problem.

So, I patched exo-mount to avoid the error message. Not very clean but it's enough for me in my case.

Obviously a fix in exo-mount similar to what Benny did for Thunar would be great, but it's minor for me.


--- exo/exo-mount/exo-mount-hal.c    2007-02-10 22:21:14.000000000 -0500
+++ exo/exo-mount/exo-mount-hal.c     2007-02-10 22:32:48.000000000 -0500
@@ -338,7 +338,7 @@
   else
     {
       /* tell the caller that no matching device was found */
-      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, _("Device \"%s\" not found in file system device table"), file);
+      //g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, _("Device \"%s\" not found in file system device table"), file);
     }
 
   /* cleanup */

Comment 18 Brian J. Tarricone (not reading bugmail) 2007-02-20 18:51:58 CET
Hmm, I don't have the problematic flash drive (or my iPod) with me right now, but now I see a different problem: my CD-ROM drive shows up twice, once as 'CD-ROM Disc', and once as the volume label (there's a data disc in the drive).  Not sure if this was present before the patch as well.  If I remove the disc, the icon with the volume label disappears, but 'CD-ROM Disc' is still there.
Comment 19 Gregoire Gentil 2007-02-20 19:01:30 CET
No. I don't have this problem. Sorry for you...
Comment 20 Brian J. Tarricone (not reading bugmail) 2007-02-21 16:48:41 CET
Ok, nevermind, the double CD problem is gone.  I *know* I ran 'Thunar --quit' before checking it, but I guess it didn't get restarted properly or something.  Still not sure about the other drive issues.
Comment 21 Jani Monoses 2007-03-21 14:31:19 CET
Created attachment 1048 
check fsusage

I've used this patch to also show hard disk partitions in the left pane. I had to check fsusage so it would not show bogus partitions like the swap or the extended partition header. It's somewhat related to this bug hence I am posting it here.

The last hunk is not very clean as it adds HARDDISK as removable so it appears in the left pane.
Comment 22 Brian J. Tarricone (not reading bugmail) 2007-05-05 08:04:02 CEST
I was looking at this a bit, and 'solved' the thunar-vfs half of this by checking volume.fsusage after categorising the volume kind, and then not setting THUNAR_VFS_VOLUME_PRESENT if it's not mountable.  This appears to work, but then this will make Audio CDs and whatnot not show up on the desktop, which I don't think we want.

My next thought was to add a thunar_vfs_volume_is_mountable() function that will check volume.fsusage so the app can know if the volume can be successfully mounted.  This will make thunar-volman behave properly, but doesn't fix xfdesktop showing the extra volume that we don't care able.

For that, to avoid adding possible complex and error-prone heuristics to thunar-vfs, I think we should just use libhal_volume_should_ignore().  This won't work out of the box, at least not for my iPod, as volume.ignore isn't set on the volume I want to ignore, but perhaps we can get additions to .fdi files added upstream to fix this.
Comment 23 Brian J. Tarricone (not reading bugmail) 2007-05-05 08:36:08 CEST
... except that it appears that thunar-volman doesn't actually use ThunarVfsVolume at all, so I can't make thunar-volman check if a volume is mountable before trying to mount it.  Working on something else now...
Comment 24 Brian J. Tarricone (not reading bugmail) 2007-05-05 08:39:02 CEST
Created attachment 1122 
thunar-volman-mount-only-mountable.diff

Ok, this patches thunar-volman to check volume.fsusage before trying to mount a volume.  If it's not 'filesystem', then it fails silently.
Comment 25 Brian J. Tarricone (not reading bugmail) 2007-05-05 08:41:52 CEST
Created attachment 1123 
thunar-vfs-add-is-mountable.diff

And this patch adds thunar_vfs_is_mountable().  It also checks libhal_volume_should_ignore(), and ignores the volume if it's TRUE.
Comment 26 Brian J. Tarricone (not reading bugmail) 2007-05-05 08:50:20 CEST
Created attachment 1124 
90-ipod-ignore-fw-part.diff

For reference, here's a .fdi file that will cause non-filesystem partitions on iPods to be ignored.
Comment 27 Benedikt Meurer editbugs 2007-05-20 13:06:35 CEST
Committed with revision 25731.

2007-05-20	Benedikt Meurer <benny@xfce.org>

	* thunar-vfs/thunar-vfs-volume-freebsd.c,
	  thunar-vfs/thunar-vfs-volume-hal.c,
	  thunar-vfs/thunar-vfs-volume.{c,h}, thunar-vfs/thunar-vfs.symbols:
	  Apply patch from Brian Tarricone <bjt23@cornell.edu> to fix
	  invalid invocation of thunar-volman for devices that should be
	  ignored, and add a MOUNTABLE flag for volumes. Bug #2789.
	* configure.in.in: Bump library interface version.

2007-05-20	Benedikt Meurer <benny@xfce.org>

	* thunar-volman/tvm-block-device.c(tvm_block_device_added): Try
	  automount only if the volume actually contains a filesystem.
	  Patch from Brian Tarricone <bjt23@cornell.edu>. Bug #2789.

Bug #2789

Reported by:
Brian J. Tarricone (not reading bugmail)
Reported on: 2007-01-22
Last modified on: 2010-11-07

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Version:
unspecified

Attachments

hal-device output (11.68 KB, application/octet-stream)
2007-01-22 22:56 CET , Ben Ford
no flags
Suggested fix (3.45 KB, patch)
2007-02-12 19:26 CET , Benedikt Meurer
no flags
check fsusage (1.98 KB, patch)
2007-03-21 14:31 CET , Jani Monoses
no flags
thunar-volman-mount-only-mountable.diff (1.13 KB, patch)
2007-05-05 08:39 CEST , Brian J. Tarricone (not reading bugmail)
no flags
thunar-vfs-add-is-mountable.diff (5.02 KB, patch)
2007-05-05 08:41 CEST , Brian J. Tarricone (not reading bugmail)
no flags
90-ipod-ignore-fw-part.diff (331 bytes, text/plain)
2007-05-05 08:50 CEST , Brian J. Tarricone (not reading bugmail)
no flags

Additional information