Bug 220305 - Safely remove option should run also "eject" on mass storage devices
Summary: Safely remove option should run also "eject" on mass storage devices
Status: RESOLVED UPSTREAM
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: libsolid-hal (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-27 19:21 UTC by Kristjan Ugrin
Modified: 2010-10-05 11:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristjan Ugrin 2009-12-27 19:21:23 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

When removing certain USB mass storage devices like Nokia N95 and Philips USB mass storage players, it will always result in a warning being displayed on device
about possible data corruption due to unsafe removal.

Those devices expect more than unmounting, running e.g. "eject /dev/sde" after unmounting will cure the problem, which I have to do manually everytime after unmounting via dolphin or device notifier.

This option was implemented back in kde 3.x, kde 4.x should behave in same way.
Comment 1 FiNeX 2010-02-05 16:45:00 UTC
I've the same problem with all usb memory. I need to manually "eject /dev/sdX". The eject/umount command integrated in dolphin only umount the partition.

For example some of my usb pendrive have a flashing light until I manually eject the device.
Comment 2 Kevin Ottens 2010-10-02 15:46:21 UTC
Please check the output of "solid-hardware list nonportableinfo", if you don't have a "storage.requires_eject = true" for the corresponding drive then the bug you're experiencing is in HAL not informing us reliably that the eject command must be issued.
Comment 3 Kristjan Ugrin 2010-10-05 11:05:22 UTC
Thanks:
storage.requires_eject = false  (bool)

So it's hal issue. I've heard future kde will not use hal anymore, should we leave this as is (unfixed) and see if it is an issue again in 4.6?

Does hal have some rules how to handle removable storage, so I could quickly fix it by writing a rule?
The device is recognized as removable:
storage.removable = true
Comment 4 Kevin Ottens 2010-10-05 11:16:41 UTC
Well the point is that we (KDE) can't do anything about it that's a bug in HAL itself (so upstream). You could try to fill a bug for it at http://bugs.freedesktop.org but there's a chance for it to be ignored as it's more or less unmaintained.

Know hal allows you to write fdi file to make rules like the one you need, but I'm not clear on all the details (it's been a long while since I wrote one). You should find out all the info you need in HAL's documentation I guess.
Comment 5 Kristjan Ugrin 2010-10-05 11:34:33 UTC
Addon: I've figured how to force eject on my removable devices by adding a hal policy. The match might be too vague, but probably safe, since quite some range of portable player will complain about not ejecting them:

---
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
  <device>

    <match key="storage.removable" bool="true">
        <merge key="storage.requires_eject" type="bool">true</merge>
    </match>

  </device>
</deviceinfo>
---