! 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 !
Unmount problem with removable media
Status:
RESOLVED: DUPLICATE
Product:
Thunar-vfs
Component:
General

Comments

Comment 1 Martin Kebert 2008-09-30 08:17:32 CEST
Created attachment 1844 
20GB Prestigio Pocket drive over USB
Comment 2 Martin Kebert 2008-09-30 08:18:31 CEST
Created attachment 1845 
SD card in non-USB (integrated) card reader
Comment 3 Martin Kebert 2008-09-30 08:19:07 CEST
Created attachment 1846 
Western Digital MyBook hard drive over Firewire
Comment 4 Martin Kebert 2008-09-30 08:19:28 CEST
Created attachment 1847 
Western Digital MyBook hard drive over USB
Comment 5 Martin Kebert 2008-09-30 08:20:13 CEST
Added output of lshal as attachments.
Comment 6 Yves-Alexis Perez editbugs 2008-10-01 05:34:50 CEST
I think it may be related to the is_ejectable function in thunar-vfs-volume-hal.c:

static gboolean
thunar_vfs_volume_hal_is_ejectable (ThunarVfsVolume *volume)
{
  /* check if HAL drive requires eject */
  if (THUNAR_VFS_VOLUME_HAL (volume)->requires_eject)
    return TRUE;

  /* otherwise we can only eject removable media, that are present (surprise,   surprise) */
  return (thunar_vfs_volume_is_present (volume) &&                              thunar_vfs_volume_is_removable (volume));
}

With volume_hal->requires_eject = libhal_drive_requires_eject (hd);

If requires_eject is present and is true, the volume is marked as ejectable.

If it's present and false, or not present, it depends. But in the case the device is present and removable, it's assumed to be ejectable, which seems wrong in some cases.

Maybe in the general case it's ok, but when requires_eject is present and false, I guess thunar should consider it as ejectable.

Cheers,
--
Yves-Alexis
Comment 7 Yves-Alexis Perez editbugs 2008-10-01 06:05:14 CEST
(In reply to comment #6)
> If requires_eject is present and is true, the volume is marked as ejectable.
> 
> If it's present and false, or not present, it depends. But in the case the
> device is present and removable, it's assumed to be ejectable, which seems
> wrong in some cases.
> 
> Maybe in the general case it's ok, but when requires_eject is present and
> false, I guess thunar should consider it as ejectable.

I just checked with an usb token I have, and:

  storage.requires_eject = false  (bool)
  storage.serial = 'Kingston_DataTraveler_2.0_5B7B0DB10058-0:0'  (string)

which means if we use something like:

return (THUNAR_VFS_VOLUME_HAL (volume)->requires_eject);

it won't be marked as ejectable, while it should be ejected. Maybe in that case it's a bug in hal, which doesn't correctly set the requires_eject properties.

But anyway, “requires_eject” means that, if present, it should be ejected, but if not it doesn't say anything, so maybe letting the user choose would be a good idea.

What do you think?

Cheers,
--
Yves-Alexis
Comment 8 Brian J. Tarricone (not reading bugmail) 2008-10-29 04:03:01 CET
No, I think this is a bug in HAL, or at least some weird issue with the reporter's hardware.  Not sure it can be worked around in thunar-vfs.
Comment 9 Yves-Alexis Perez editbugs 2008-10-29 06:34:36 CET
(In reply to comment #8)
> No, I think this is a bug in HAL, or at least some weird issue with the
> reporter's hardware.  Not sure it can be worked around in thunar-vfs.

I'm not sure. In the reporter's case we have requires_eject=false. I agree this is not equivalent to never_eject, but I would find it more consistent do only propose eject when requires_eject=true, and not in other cases.
Comment 10 Yves-Alexis Perez editbugs 2008-11-23 22:09:31 CET
Hmhm, I guess this may be related/duplicate to/of bug #3978
Comment 11 Jannis Pohlmann editbugs 2008-11-23 23:31:47 CET
(In reply to comment #7)
> (In reply to comment #6)
> > If requires_eject is present and is true, the volume is marked as ejectable.
> > 
> > If it's present and false, or not present, it depends. But in the case the
> > device is present and removable, it's assumed to be ejectable, which seems
> > wrong in some cases.
> > 
> > Maybe in the general case it's ok, but when requires_eject is present and
> > false, I guess thunar should consider it as ejectable.
> 
> I just checked with an usb token I have, and:
> 
>   storage.requires_eject = false  (bool)
>   storage.serial = 'Kingston_DataTraveler_2.0_5B7B0DB10058-0:0'  (string)
> 
> which means if we use something like:
> 
> return (THUNAR_VFS_VOLUME_HAL (volume)->requires_eject);
> 
> it won't be marked as ejectable, while it should be ejected. Maybe in that case
> it's a bug in hal, which doesn't correctly set the requires_eject properties.

Why would your Kingston device need to be ejected? If it's just an ordinary USB stick sort of thing it should just be unmounted, not ejected.

BTW, without knowing about this bug, I committed the exact same thing you suggested before to Thunar today (bug #3978): thunar_vfs_volume_hal_is_ejectable() now returns TRUE if and only if requires_eject is TRUE.
Comment 12 Yves-Alexis Perez editbugs 2008-11-24 06:21:01 CET
(In reply to comment #11)
> Why would your Kingston device need to be ejected? If it's just an ordinary USB
> stick sort of thing it should just be unmounted, not ejected.

Hmhm, right, not sure. I don't really know how the powering stuff works with usb flash tokens. When “ejecting” a partition currently, all the other partitions on my usb tokens are umounted and disappear (which can be convenient when you don't want to umount all of them manually, but can't be painfull when you just want one to be unmounted).

What would be nice, I guess, would be a way to separate an hardware device (even a pseudo device, like a crypto layer) and the partition on it. Somethine like a treeview:

+ USB Token 1
  USB Token 1, partition 1
  + USB Token 1, partition 2, crypto layer
    USB Token 1, partition 2, crypto layer, partition 1
  USB Token 1, partition 3
+ USB Token 2
  USB Token 2, partition 1

In that case the lines prefixed by + would be the “nodes” of a treeview and could be “ejected” using a right click (if they are marked ejectable, eject them, if not, umount all partitions on it, something like that). The partition themselves would only be umountable, I guess. (or maybe ejectable if partitions can have an is_ejectable=true HAL property)

Not sure if I'm really clear with that, nor if it's doable and easy. That's something for later Thunar I guess.
> 
> BTW, without knowing about this bug, I committed the exact same thing you
> suggested before to Thunar today (bug #3978):
> thunar_vfs_volume_hal_is_ejectable() now returns TRUE if and only if
> requires_eject is TRUE.

Yeah, thanks. I wont be able to test that now (except if the patch applies to beta 2) but will report back at rc1.

Cheers,
--
Yves-Alexis
Comment 13 Jannis Pohlmann editbugs 2008-11-24 09:09:14 CET
(In reply to comment #12)
> (In reply to comment #11)
> > Why would your Kingston device need to be ejected? If it's just an ordinary USB
> > stick sort of thing it should just be unmounted, not ejected.
> 
> Hmhm, right, not sure. I don't really know how the powering stuff works with
> usb flash tokens. When “ejecting” a partition currently, all the other
> partitions on my usb tokens are umounted and disappear (which can be convenient
> when you don't want to umount all of them manually, but can't be painfull when
> you just want one to be unmounted).

Yeah, that's clearly not the desired behaviour. It should show unmount for all devices and you should be able to mount/unmount them independently.

> What would be nice, I guess, would be a way to separate an hardware device
> (even a pseudo device, like a crypto layer) and the partition on it. Somethine
> like a treeview:
> 
> + USB Token 1
>   USB Token 1, partition 1
>   + USB Token 1, partition 2, crypto layer
>     USB Token 1, partition 2, crypto layer, partition 1
>   USB Token 1, partition 3
> + USB Token 2
>   USB Token 2, partition 1
> 
> In that case the lines prefixed by + would be the “nodes” of a treeview and
> could be “ejected” using a right click (if they are marked ejectable, eject
> them, if not, umount all partitions on it, something like that). The partition
> themselves would only be umountable, I guess. (or maybe ejectable if partitions
> can have an is_ejectable=true HAL property)
> 
> Not sure if I'm really clear with that, nor if it's doable and easy. That's
> something for later Thunar I guess.

Yes. We'll see how volume stuff works in GIO/GVfs. But what you suggested sounds confusing from the user's point of view. We need something straight forward and easy to use, so in this case I'd probably stick to the independent unmounting of partitions rather than going for a weird hybrid solution ;)

> > BTW, without knowing about this bug, I committed the exact same thing you
> > suggested before to Thunar today (bug #3978):
> > thunar_vfs_volume_hal_is_ejectable() now returns TRUE if and only if
> > requires_eject is TRUE.
> 
> Yeah, thanks. I wont be able to test that now (except if the patch applies to
> beta 2) but will report back at rc1.

It should apply against beta 2, I think.
Comment 14 Yves-Alexis Perez editbugs 2008-11-24 09:57:35 CET
(In reply to comment #13)
> Yeah, that's clearly not the desired behaviour. It should show unmount for all
> devices and you should be able to mount/unmount them independently.

Yeah but an “unmount all” can be really useful :)
> 
[…]

> Yes. We'll see how volume stuff works in GIO/GVfs. But what you suggested
> sounds confusing from the user's point of view. We need something straight
> forward and easy to use, so in this case I'd probably stick to the independent
> unmounting of partitions rather than going for a weird hybrid solution ;)

Yeah but that's more or less what is done on OSX finder iirc (I'll check that tonight)
> 
> > > BTW, without knowing about this bug, I committed the exact same thing you
> > > suggested before to Thunar today (bug #3978):
> > > thunar_vfs_volume_hal_is_ejectable() now returns TRUE if and only if
> > > requires_eject is TRUE.
> > 
> > Yeah, thanks. I wont be able to test that now (except if the patch applies to
> > beta 2) but will report back at rc1.
> 
> It should apply against beta 2, I think.

Nice, i'll try. Thanks.
Comment 15 Jannis Pohlmann editbugs 2008-11-25 11:31:45 CET

*** This bug has been marked as a duplicate of bug 3978 ***

Bug #4424

Reported by:
Martin Kebert
Reported on: 2008-09-30
Last modified on: 2010-11-07

People

Assignee:
Jannis Pohlmann
CC List:
3 users

Version

Version:
unspecified

Attachments

20GB Prestigio Pocket drive over USB (10.91 KB, text/plain)
2008-09-30 08:17 CEST , Martin Kebert
no flags
SD card in non-USB (integrated) card reader (6.28 KB, text/plain)
2008-09-30 08:18 CEST , Martin Kebert
no flags
Western Digital MyBook hard drive over Firewire (13.03 KB, text/plain)
2008-09-30 08:19 CEST , Martin Kebert
no flags
Western Digital MyBook hard drive over USB (17.13 KB, text/plain)
2008-09-30 08:19 CEST , Martin Kebert
no flags

Additional information