You are not logged in.

#1 2010-07-17 13:05:59

fiinix
Member
Registered: 2009-12-07
Posts: 75

[Solved] automount with udev - secure removal?

Hi,

my question in short: How do I make sure, that files really finished copying, before i can securely remove the device, after it was automounted by udev. I don't want to use hal.

The whole story:
For mounting devices I just switched from hal to udev only and I like the faster bootup. Using die first rule in arch's udev-wiki works quite well for me. Since mounting manually isn't needed anymore, I'm able to and want to use a file manager that doesn't depend on hal. I also have a very lightweight system and my netbook thanks me for it. So file managers for daily use that are ruled out are at least nautilus, dolphin, thunar and pcmanfm. What I now need is a way to securely remove my usb devices, after I copied to them, to make sure the files are all save. How do I do that? Does udev support this?

I see two ways: either I find a file manager that allows unmounting without depending on hal, or I find a tool (maybe for the tray) that lets me unmount removable devices. Does anyone here have any idea how to solve this? Or is there any mistake from my side? Worst case is that I would always have to start a console and unmount the device manually. Is that really necessary?

This is my first posting of a new topic, so please be nice wink I hope this is the right place for this subject...

Last edited by fiinix (2010-07-18 03:09:56)

Offline

#2 2010-07-17 13:47:00

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [Solved] automount with udev - secure removal?

According to the mentioned wiki article, users cannot unmount devices which were mounted by udev, except with using 'pmount', see the section [...] support user un-mounting.

Your issues concerning a file manager: I don't use them myself nor am I aware of any application suiting your needs, but maybe you could set some user-defined actions and utilize 'pmount' to unmount.

Offline

#3 2010-07-17 17:48:05

fiinix
Member
Registered: 2009-12-07
Posts: 75

Re: [Solved] automount with udev - secure removal?

Well, if I have to go to the terminal anyway, I think I would just use sudo with "fiinix mynetbook=NOPASSWD: /bin/mount,/bin/umount" in /etc/sudoers. Also, the mentioned pmount rule doesn't mount the partitions of my HDD immediately, like the first rule does. Didn't investigate it further, cause, like I said, it doesn't really matter in my case...

But you suggest that the file manager could be the place to look for it, offering a custom action. For my hal free system I found qtFM which has no dependencies except Qt (which I need anyway). I think that means I will ask there for such a feature. It really is a brilliant file manager big_smile

Still: I would really like to know, if there already is a program that would offer such a graphical unmount / custom action. Seems like this is more of a question for known software than a real issue... Anyone knows anything?

Offline

#4 2010-07-17 18:12:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: [Solved] automount with udev - secure removal?

> graphical unmount
A script should do - you execute it by doubleclicking, some standard yes / no shows up ...

Edit: typo.

Last edited by karol (2010-07-18 07:23:14)

Offline

#5 2010-07-18 03:09:19

fiinix
Member
Registered: 2009-12-07
Posts: 75

Re: [Solved] automount with udev - secure removal?

karol, thanks for the idea, but I don't have my desktop managed, hence no icons always at hand that I could execute. Also, what would they unmount? One icon for each possible /dev/sdXY?

Well, I noticed that qtFM, my file manager of choice, actually has a "Custom action" feature, so I can right click a mounted folder (which is also shown in the bookmarks section of the file manager) and click "Unmount" (that's what I called that action - for obvious reasons smile). The confirmation of a successful unmount can be seen by opening that folder. If it is empty, it is either unmounted or there is nothing to lose anyway.

It's not a nice icon where I directly see if a device is mounted and can toggle the status like it was with hal and various file managers, but it's leightweight, graphical and safe. If anyone has any other way to do this and wants to share, please do so, but I will mark this as solved now. Thanks for the input!

Offline

#6 2010-07-18 07:22:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: [Solved] automount with udev - secure removal?

Actually, that's what I meant :-) Scripts are small programs for performing custom actions .
Your input (picking the mounted folder) tells the script which folder to unmount, the script may show some graphical confirmation message; "/mnt/usb successfully unmounted".

Offline

#7 2010-07-18 12:40:38

fiinix
Member
Registered: 2009-12-07
Posts: 75

Re: [Solved] automount with udev - secure removal?

Awesome! I could insert a few lines of code "myself" and make it show me a message about the result. I already have "sudo umount %f", where %f is the folder I chose. Now for the "I could insert ... myself" part: What would a code look like, that does about the following:

unmount. (got it so far, see above)
if unmount == success: xmessage "successfully unmounted"
if unmount == fail: xmessage "something went wrong"

?

More specifically: what is the code for arch to react on the result of an umount?
And: is there a less ugly version of xmessage? =)

Offline

#8 2010-07-18 12:47:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: [Solved] automount with udev - secure removal?

> And: is there a less ugly version of xmessage? smile
There are many http://en.wikipedia.org/wiki/Zenity

Offline

Board footer

Powered by FluxBB