You are not logged in.

#26 2012-04-25 21:30:10

Yurlungur
Member
From: USA
Registered: 2012-01-06
Posts: 116

Re: udisksvm GUI UDisks wrapper without writing udev rules

Thanks for this. It works great! big_smile

It seems to work fine in conjunction with HAL on my system, so if you want to leave HAL in your daemons for work without a windows manager, there doesn't seem to be an iussue with that other than an unnecessary drain on resources.


Lenovo Thinkpad T420; Intel sandy bridge i7 2.7GHz; integrated graphics card; 4GB RAM; wifi; Arch; Xmonad WM

Offline

#27 2012-05-20 10:43:04

Lockheed
Member
Registered: 2010-03-16
Posts: 1,427

Re: udisksvm GUI UDisks wrapper without writing udev rules

berbae wrote:

Of course the mount options can be changed and adapted to other choices of the user,

Where can I change them?

Edit: No matter, found it.

Last edited by Lockheed (2012-05-20 11:11:22)


Laptop: ThinkPad W500, C2D P9500, 8GB, Radeon RV635 (HD3650), Arch | Server/fw: Zotac AQ01, A4-5000 Kabini, 4GB, Arch/pfSense VM

Offline

#28 2012-06-05 15:44:07

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

I rewrote the script in Python2 using the dbus interface to UDisks, instead of the 'udisks' command.

I intend to migrate to UDisks2 and the rewriting of the script is a first stage towards that end.

I read from http://udisks.freedesktop.org/docs/latest/udisks.8.html 'API STABILITY' part:

udisks guarantees a stable D-Bus API within the same major version
...
The udisks developers do not anticipate breaking API but does reserve the right to do so
...
Therefore, applications can not rely on tools like e.g. udisksctl(1) to be available. Additionally, there is no guarantee that the options, command-line switches etc. of command-line tools or similar will remain stable.

Instead, applications should only use the D-Bus API, the libudisks2 library or tools such as dbus-send(1) or gdbus(1) to interact with udisksd(8).

So I chose to follow that advice and decided to use Python2 and the dbus-python package, instead of using the dbus-send command in bash.

I wanted to use a full scripting langage instead of a bash script.

Presently the 'traydevice' utility uses only UDisks, not UDisks2;
I posted a question/request at https://savannah.nongnu.org/projects/traydevice.
But I am not sure if traydevice is still maintained.
So I intend to either upgrade it to UDisks2 myself, or develop a new utility entirely from scratch.

I also would like to use Python3 if all the needed modules could be found.
But probably I will begin working with Python2 before.

Last edited by berbae (2012-06-05 15:45:11)

Offline

#29 2012-06-05 16:56:04

Lockheed
Member
Registered: 2010-03-16
Posts: 1,427

Re: udisksvm GUI UDisks wrapper without writing udev rules

I might be wrong, but I seem to remember that in one of the recent Arch update, udev has been removed and replaced with something else.


Laptop: ThinkPad W500, C2D P9500, 8GB, Radeon RV635 (HD3650), Arch | Server/fw: Zotac AQ01, A4-5000 Kabini, 4GB, Arch/pfSense VM

Offline

#30 2012-06-11 15:23:28

CPUnltd
Member
From: Milwaukee, WI
Registered: 2009-12-05
Posts: 470
Website

Re: udisksvm GUI UDisks wrapper without writing udev rules


Help grow the dev population... have your tech trained and certified!

Offline

#31 2012-07-01 12:48:48

Lockheed
Member
Registered: 2010-03-16
Posts: 1,427

Re: udisksvm GUI UDisks wrapper without writing udev rules

Since the last kernel update, I no longer get any USB disks automounted. Is this  udisksvm related?


Laptop: ThinkPad W500, C2D P9500, 8GB, Radeon RV635 (HD3650), Arch | Server/fw: Zotac AQ01, A4-5000 Kabini, 4GB, Arch/pfSense VM

Offline

#32 2012-07-02 21:07:29

CPUnltd
Member
From: Milwaukee, WI
Registered: 2009-12-05
Posts: 470
Website

Re: udisksvm GUI UDisks wrapper without writing udev rules

There have been more than a few things broken with the latest kernel update.  I am unable to build a few things in aur.  And until things are stablized revolving around this, I am using spacfm as a workaround with udevil-git to automount and unmount my devices.  spacefm has to be open, but it gets the job done for now.


Help grow the dev population... have your tech trained and certified!

Offline

#33 2012-07-07 21:03:47

Lockheed
Member
Registered: 2010-03-16
Posts: 1,427

Re: udisksvm GUI UDisks wrapper without writing udev rules

CPUnltd wrote:

I am using spacfm as a workaround with udevil-git to automount and unmount my devices.  spacefm has to be open, but it gets the job done for now.

I tried that but it doesn't work, neither. How did you make it work?


Laptop: ThinkPad W500, C2D P9500, 8GB, Radeon RV635 (HD3650), Arch | Server/fw: Zotac AQ01, A4-5000 Kabini, 4GB, Arch/pfSense VM

Offline

#34 2012-07-08 21:06:18

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

Sorry for not replying before, I was working on porting udisksvm to UDisks2, which is now done with the udisksvm 2.0 release.

Here udisksvm works well after the latest updates, just as before:

linux 3.4.4-2
systemd-tools 185-4
libsystemd 185-4
dbus-core 1.6.2-2
dbus 1.6.2-1
consolekit 0.4.6-4
udisks2 1.94.0-2

I use it in openbox launched by startx with that line in .xinitrc:

exec ck-launch-session dbus-launch --exit-with-session openbox-session

From the README file:

"To see output and errors from the script, run it in a console without the
redirection to /dev/null;
to have more verbosity, run it with the '-d' or '--debug' option."

Give details, if there are problems.
Again the script works well here on my computer.

Offline

#35 2012-07-08 21:20:16

Lockheed
Member
Registered: 2010-03-16
Posts: 1,427

Re: udisksvm GUI UDisks wrapper without writing udev rules

Strangely enough, the automount works on stock linux kernel, but not on linux-pf.

Last edited by Lockheed (2012-07-08 21:24:53)


Laptop: ThinkPad W500, C2D P9500, 8GB, Radeon RV635 (HD3650), Arch | Server/fw: Zotac AQ01, A4-5000 Kabini, 4GB, Arch/pfSense VM

Offline

#36 2012-07-18 22:40:04

demizer
Member
From: Santa Clara
Registered: 2010-03-03
Posts: 108
Website

Re: udisksvm GUI UDisks wrapper without writing udev rules

Is there any possibility of adding a "Safe to remove device" notification? I have to sync manually before clicking the icon.

Offline

#37 2012-07-20 21:27:14

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

Can you precise what file system type it is;
and confirm that you need to run the 'sync' command, before clicking to unmount the device, and you would like that to be done automatically.
It is not very clear to me in your post.

Doesn't unmounting force a sync already?

Offline

#38 2012-07-21 16:00:29

demizer
Member
From: Santa Clara
Registered: 2010-03-03
Posts: 108
Website

Re: udisksvm GUI UDisks wrapper without writing udev rules

Hello,

So after further inspection it seems udisksvm does indeed sync before unmounting. I have an NTFS formatted 8GB external USB drive with a 250mb projects directory that I copy to the drive everyday. The program appears to freeze while the sync is occurring and doesn't respond to commands. After the sync is finished, the usb unmounts and udisksvm responds to my clicks again. Perhaps there should be an indicator notifying the user that a sync is occurring? Like a tool-tip or a menu change?

Great utility by the way! It has worked great so far and is very solid. Thanks a lot!

demizer

Offline

#39 2012-07-22 15:20:15

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

Thanks for your feedback, demizer.

demizer wrote:

The program appears to freeze while the sync is occurring and doesn't respond to commands. After the sync is finished, the usb unmounts and udisksvm responds to my clicks again.

This is because the synchronous communication mode is used to communicate with the UDisks DBus API:
when a method is called using 'call_sync', the script waits until it gets a reponse from DBus.

The 'ntfs-3g' driver is slow to sync your 250 MB directory (this is a known limitation with it), and the script waits until the 'ntfs-3g' driver finishes to sync, after a click on 'Unmount'.

I don't want to use an asynchronous mode, but I will see to add an option to show notifications in a future release.

Offline

#40 2012-10-07 19:34:12

Hwiparam
Member
From: Poland
Registered: 2011-09-26
Posts: 65

Re: udisksvm GUI UDisks wrapper without writing udev rules

Udisksvm appears not to mount some devices, e.g mobile phones or SD cards (or maybe I am doing something wrong). When executed from the command line, it shows something like that:

$ udisksvm
--------------------------------------------------
Automounting for non optical devices enabled
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/drives/Intenso_Basic_10011100031138
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/block_devices/sdb
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/block_devices/sdb1
--------------------------------------------------
Automounting /dev/sdb1...
Mounting done at mountpath: /run/media/noname/PENDRAK
--------------------------------------------------
traydvm for /org/freedesktop/UDisks2/block_devices/sdb1 now running with pid : 18907
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/jobs/9
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/jobs/9
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/block_devices/sdc
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/block_devices/sdc
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/block_devices/sdb1
--------------------------------------------------
traydvm for /org/freedesktop/UDisks2/block_devices/sdb1 now killed
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/block_devices/sdb
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/drives/Intenso_Basic_10011100031138
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/jobs/10
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/jobs/10
--------------------------------------------------

Here I've plugged two devices: A pendrive and a mobile phone (E75) with an SD card. The pendrive is mounted correctly and I am able to unmount it via the tray icon, however my Nokia phone is detected but I cannot get it mounted via udisksvm (it is not shown in /run/media/user and no tray icon appears). The same with some other devices like SD cards or my mp3 player (they are not mounted)
What is funny, udiskie mounts everything well... But it does not display tray icons.

Offline

#41 2012-10-08 22:02:24

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

Can you please mount your Nokia phone using udiskie, and show me the output of the 'mount' command for it, in a console.
udisks2 detects:

--------------------------------------------------
Added :  /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/block_devices/sdc
--------------------------------------------------

but there is not a sdc1 partition added for the automounting to be triggered; that's why there is no icon.
So I want to see how it is mounted by udiskie.

Offline

#42 2012-10-09 14:54:57

Hwiparam
Member
From: Poland
Registered: 2011-09-26
Posts: 65

Re: udisksvm GUI UDisks wrapper without writing udev rules

/dev/sdb on /media/6A42-E81D type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)

Here is the line for my phone mounted by udiskie.

Offline

#43 2012-10-09 21:54:53

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

Can I ask you to post the output of:

udisksctl info --block-device /dev/sdx

after plugin of the Nokia phone and udisksvm running (of course use the right dev path).

I need to see infos about partition and file system directly for /dev/sdx, rather than /dev/sdx1.
I have not integrate this case in the script, but with these infos I possibly should be able to add that.

I will not be able to try it here without the phone, though.
Thanks for helping.

Offline

#44 2012-10-10 11:35:45

Hwiparam
Member
From: Poland
Registered: 2011-09-26
Posts: 65

Re: udisksvm GUI UDisks wrapper without writing udev rules

$ udisksctl info --block-device /dev/sdb
/org/freedesktop/UDisks2/block_devices/sdb:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdb
    DeviceNumber:               2064
    Drive:                      '/org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSystem:                 false
    IdLabel:                    
    IdType:                     vfat
    IdUUID:                     6A42-E81D
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    PreferredDevice:            /dev/sdb
    ReadOnly:                   false
    Size:                       4003463168
    Symlinks:                   /dev/disk/by-id/usb-Nokia_S60_359557013658840-0:0
                                /dev/disk/by-path/pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0
                                /dev/disk/by-uuid/6A42-E81D
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        

Offline

#45 2012-10-10 16:05:30

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

So the output shows that there is not a 'org.freedesktop.UDisks2.Partition' interface, which I use for the automounting feature.

But as there is a 'org.freedesktop.UDisks2.Filesystem' interface, it should have printed the "Automounting /dev/sdb..." message;
but it doesn't appear in the udisksvm output you posted previously.

So to have a confirmation about the output, I need another action on your part, because I have not the phone here (sorry to ask you again).

Running in a console:
udisksvm --debug

plugging in the Nokia phone
plugging out it

posting the complete output on the screen or redirecting into a file.

Thanks for your contribution.

Offline

#46 2012-10-10 17:14:34

Hwiparam
Member
From: Poland
Registered: 2011-09-26
Posts: 65

Re: udisksvm GUI UDisks wrapper without writing udev rules

berbae wrote:

sorry to ask you again

No problem smile Here is what I've got:

--------------------------------------------------
Automounting for non optical devices enabled
--------------------------------------------------
optical drive = /org/freedesktop/UDisks2/drives/Optiarc_DVD_RW_AD_7581S_30654810_1654655Q111
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840
--------------------------------------------------
Added :  /org/freedesktop/UDisks2/block_devices/sdb
--------------------------------------------------
devicefile = /dev/sdb
idtype = 
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/block_devices/sdb
--------------------------------------------------
traydvm for /org/freedesktop/UDisks2/block_devices/sdb is not running...
--------------------------------------------------
Removed :  /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840
--------------------------------------------------
traydvm for /org/freedesktop/UDisks2/drives/Nokia_S60_359557013658840 is not running...
--------------------------------------------------
***** signal 2 received *****
---------------------- Bye! ----------------------

Offline

#47 2012-10-10 21:49:48

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

From the outputs you provided, I think it will be difficult for me to solve that issue, because I would need to make many tests with the phone, which I don't have at hand.
The last output you posted show that, when the '/org/freedesktop/UDisks2/block_devices/sdb' is added, just after the plugging in, there is no value to the idtype property (ie 'vfat' doesn't appear) and there is no 'org.freedesktop.UDisks2.Filesystem' interface either yet.
But something changes after that, which is not detected through the signals I use in the script, because from your post #44 a value is present in the idtype property and the 'org.freedesktop.UDisks2.Filesystem' interface has also appeared after the 'added' signal.
To solve that I think I would have to use the "interface-proxy-properties-changed" signal which unhappily causes a memory problem with python.
When that problem with the signal in python will be fixed, I would be able to use it to detect the changes in properties after the block device is added.
I will continue to think about that and post again.

Offline

#48 2012-10-12 12:07:20

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

From further tests and research, I think I could use the "interface-added" signal of the object manager to detect the appearance of the 'org.freedesktop.UDisks2.Filesystem' interface and so trigger the automounting from there.
But my Samsung player phone works perfectly with the present udisksvm: a /dev/sdb1 is added with a Filesystem interface and a Partition interface.
And so I cannot use it to test the new signal.

I need a contribution from someone with a phone which doesn't act as mine: ie doesn't add a /dev/sdb1 block device, but add a Filesystem interface to /dev/sdb without a Partition one.

So Hwiparam would you agree to try a testing version of udisksvm, before I can release it in AUR?

Or if someone with a mobile phone acting the same wants to contribute s/he is welcome.

Without such tests I could not be sure everything is ok with the new "interface-added" signal, and could not solve the problem and enhance the udisksvm script with automounting and systray icons for such mobile phones.

Thanks in advance.

Offline

#49 2012-10-14 22:11:52

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

I released the 2.2 version to-day with the detection of Filesystem interface added to an already existent object.
It also permits the absence of a Partition interface in the object.
These changes are intended to solve the problem met by Hwiparam with the Nokia phone, as well as with possible devices acting in the same way.

I could not test this release with such a phone, which I don't have at hand.
But I release it nevertheless because I didn't see any problem with it, after testing it here with memory sticks, CD drives or my Samsung phone.
So there is no regression I could see.

But I would greatly appreciate if I could receive feedbacks from users with devices acting as Hwiparam's phone. Thanks for contributions.

Offline

#50 2012-10-18 14:41:56

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,080

Re: udisksvm GUI UDisks wrapper without writing udev rules

I am constrained to use python2 since the 3.3.0 python upgrade, because the gobject introspection scheme is broken with it.
I got errors:

Oct 17 17:11:30 arch64 kernel: udisksvm[2418]: segfault at 20 ip 00007f7ef3670e18 sp 00007fff10a22fd0 error 6 in _gobject.so[7f7ef3662000+1f000]

from the python-gobject 3.2.2-2 package with python 3.3.0.

But everything works with python2 and python2-gobject 3.2.2-2.

Happily the same scripts run under python2 without any changes in the writing and the syntax!

I just added:

from __future__ import print_function

at the beginning, for the 'print()' commands,
and of course replace 'python' with 'python2'.

So the scripts are still usable in python2.

Offline

Board footer

Powered by FluxBB