You are not logged in.

#1 2012-07-03 10:19:46

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Mounting all USB storage devices with the "flush" option (Nautilus)

Hey everyone,

I would like that Nautilus mounts my USB keys, walkmans etc. using the "flush" (or "sync") option.

I'm not sure who's responsible for mounting in this case (udev? gvfs?), but I don't want to add UUID entries in my /etc/fstab for every possible device. It would also be nice to not have to use the terminal to specify mount options when remounting.

I have tried adding each of these rules to /etc/udev/rules.d/ separately (to try them)

ACTION=="add", SUBSYSTEMS=="usb", ENV{mount_options}="sync"
ACTION=="add", DRIVER=="usb-storage", ENV{mount_options}="sync"
DRIVER=="usb-storage", ENV{mount_options}="sync"

but none of them worked. Am I settings this up incorrectly, or is udev not even responsible for mounting in this case?

What do you suggest?

Thanks for your attention,
Nanthiel.


P.S. My "flush" option doesn't show up when I call "mount" with no arguments, after a "mount -o remount,flush". That's why I used "sync" in testing. *confused*

P.S. Also somewhat related: I tried copying data over to a Sony NWZ-S615F Walkman and any way I try, it either corrupts the filesystem or cancels after a few (3--5) files get copied. Shell says "I/O error". For some ridiculous reason, the walkman wants to update its library every time a file makes it over. Does anyone have any experience in the matter? hmm

Last edited by Nanthiel (2012-07-03 10:35:25)

Offline

#2 2012-07-03 13:59:15

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

You can try mounting your devices with devmon (it has a --sync flag).

Offline

#3 2012-07-03 15:58:19

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

Thanks for the suggestion, I just tried it and it works: but it's not what I've been looking for.

Now devices are automounted, but I can't unmount them using Nautilus. Can devmon be made aware of this somehow? I can always use normal mount+umount if I have to open the terminal anyway (to type devmon --unmount-all).

Offline

#4 2012-07-03 16:10:56

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

Try devmon from the udevil-git package. It should work with udisks2 and allow Nautilus to unmount it.

Offline

#5 2012-07-03 17:50:13

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

I tried that now. I don't know what I'm doing wrong, but I run "devmon --sync" and let it run. Then plug a device in there, I get loads of output and the device shows up as mounted in Nautilus. However, pressing the unmount button says I don't have proper privileges ("Unauthorized to perform operation")**. The device is listed in Nautilus twice, the one that's there by default and the new, mounted one. Clicking on the older one says it's already mounted and doesn't do anything else.

Note: I did have to edit /etc/udevil/udevil.conf to add "flush" to "allowed_options".

** This does spurt out information on the command used, the mount options include helper=udisks2 and no flush option. Are you sure this can't be simply edited somewhere?

EDIT: "udevadm monitor --property" shows that my options make it into UDEV, but they're not used. hmm

EDIT2: Nautilus calls gvfs-mount apparently. I don't know how to mess with its settings. I've read somewhere on the Ubuntu forums that udisks doesn't support editing mount options (wat?!), but I don't know about udisks2.

Last edited by Nanthiel (2012-07-03 19:09:42)

Offline

#6 2012-07-06 23:00:36

manouchk
Member
Registered: 2008-07-29
Posts: 314

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

Nanthiel, looks like, I'm facing a similar problem here.

A bunch a time ago, I configured nautilus to automount mass storage devices using the mass storage manual (don't remember which option I used). It used to be working fine. After few years without any problem or unsolved problem, unmounting recently stopped to work and I also get the "unauthorized to unmount".

I have to dig again into the manual for mass storage devices. Maybe this can help you? If I get some improvement, I will return here! I did not yet start serious investigation on this though very annoying problem (have to use sudo to unmmount: sudo umount /dev/sdb1


manual: https://wiki.archlinux.org/index.php/US … ge_Devices

Offline

#7 2012-07-06 23:12:29

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: Mounting all USB storage devices with the "flush" option (Nautilus)

I've checked the wiki pages quite a few times, but I couldn't find a solution.

One of your /etc/polkit-1/localauthority/... files are probably wrong. Maybe you just have to rename a "udisks" into a "udisks2"?

In my case, the file responsible for this is /etc/polkit-1/localauthority/50-local.d/10-storage.pkla, with contents:

[Storage group permissions]
Identity=unix-group:storage
Action=org.freedesktop.udisks2.filesystem-mount-system
ResultActive=yes
ResultInactive=no
ResultAny=yes

This requires your user to be in the storage group.

Have you tried to change default mounting options too?

Offline

Board footer

Powered by FluxBB