You are not logged in.

#51 2012-06-15 19:35:31

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

udevil 0.2.8 is available.  Please see the release notes.

sshfs is working in udevil, but I'm having trouble with it in spacefm-git.  It immediately unmounts after the terminal window closes.  I don't know if this is a bug or whether it thinks the fs is no longer in use because the terminal closed, but thus far I haven't found a way to avoid it.  If anyone know the cause of this, or if you don't have this problem, I'd be interested to know.  You can work around the problem by leaving the terminal window open.

Offline

#52 2012-06-15 21:11:20

Doomcide
Member
Registered: 2011-08-22
Posts: 221

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I just wanted to say thank you, for this wonderful tool (and the PPA). I finally got rid of consolekit smile

Offline

#53 2012-06-29 13:21:44

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

@Doomcide:  Thanks for the feedback!

udevil 0.2.9 is available, which adds the ability for users to mount and unmount tmpfs and ramfs, treating them like removable drives (if allowed in udevil.conf) - see release notes

Offline

#54 2012-07-08 09:21:10

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

How do I make this work with SpaceFM (0.7.8)? It is supposed to be automatic, but when I plug in a USB device, nothing happens.

Offline

#55 2012-07-08 13:33:43

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

Lockheed wrote:

How do I make this work with SpaceFM (0.7.8)? It is supposed to be automatic, but when I plug in a USB device, nothing happens.

Is the device listed in spacefm's devices list?  (Try right-clicking on the devices list and checking options Settings|Show|Empty Drives and/or Settings|Show|Internal Drives).  For the device to appear in the devices list does NOT require udevil (or udisks, pmount).

If the device does NOT appear in spacefm, try unplugging it, and run this in a terminal:

udevil monitor

Then plug in the device and see if it is detected by udev.  You can also try:

udevil info /dev/sdX

and substitute the correct device file for 'sdX'.

You can also try mounting the device in a terminal to see any error (if it works in a terminal it should work in spacefm):

udevil mount /dev/sdX

If the device does appear in spacefm's devices list, right-click on the device and select Mount or Open to see any error from udevil.  If you want the device to auto-open in spacefm when you insert it, you may need to check option Settings|Auto-Mount|Mount Removable.

Offline

#56 2012-07-13 16:43:14

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

udevil 0.3.0 (and SpaceFM 0.7.9) have been released.

udevil has been promoted to 'beta'.

Offline

#57 2012-07-13 20:04:23

Wilco
Member
Registered: 2008-11-09
Posts: 440

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

Thanks for this program, reinstalled the system and I can finally run without consolekit, you're my hero :

Offline

#58 2012-07-13 20:32:02

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

@Wilco:  Thanks for your feedback!  I'm jealous - I want to uninstall udisks/ck/etc but I have a few compatibility features to work on, so I keep them in a cage for now.


Announcement: udevil is now available in Arch's [community] repository (i686 and x86_64).  Much thanks to Bartłomiej Piotrowski (Barthalion) for working on this and spacefm!  I will also leave AUR udevil-git available for those who want to help test the next release as a work in progress.

Offline

#59 2012-07-14 09:03:03

xamaco
Member
From: Corsica, France
Registered: 2010-04-05
Posts: 87

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I've been using devmon and later udevil : It works great. Congratulations for the arrival of udevil in community.

Offline

#60 2012-07-18 05:06:49

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I am using udevil 0.3.0 from community and I notice that devmon mounts my USB hard drive (NTFS) with uid=0 and gid=0. Should I modify "default_options" in udevil.conf or should I create new settings just for NTFS?

Offline

#61 2012-07-18 12:49:04

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

anonymous_user wrote:

I am using udevil 0.3.0 from community and I notice that devmon mounts my USB hard drive (NTFS) with uid=0 and gid=0. Should I modify "default_options" in udevil.conf or should I create new settings just for NTFS?

You can add this line to udevil.conf:
    default_options_ntfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID

And I'll make that the default as well.  You could also use "default_options" but since not all filesystems support uid and gid options, it's best added to default_options_ntfs.

Offline

#62 2012-07-18 13:46:49

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

Thank you that seems to have worked. BTW do you know why "mount" would still show user_id=0,group_id=0 even though my disk IS mounted with the correct uid/gid?

Offline

#63 2012-07-18 13:55:56

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

anonymous_user wrote:

Thank you that seems to have worked. BTW do you know why "mount" would still show user_id=0,group_id=0 even though my disk IS mounted with the correct uid/gid?

No.  smile  I'm not a regular user of ntfs.  Maybe user_id=0 is recording who mounted the device?  (if udevil mounts it, root is the mount user)  If a device is mounted 'user' from fstab, then only the user who mounted it can unmount it, so that may be the purpose of this.  Just guessing.

Offline

#64 2012-07-19 02:18:23

berz_
Member
Registered: 2011-06-12
Posts: 26

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I really like udevil and automounting through devmon. However, in an attempt to have as few daemons running as possible I replaced devmon with two udev rules:

$ cat /etc/udev/rules.d/99-automount.rules
ACTION=="add", KERNEL=="sd[b-z][1-9]", RUN+="/usr/bin/sudo -u berz_ /usr/bin/udevil mount /dev/%k -o sync"
ACTION=="remove", KERNEL=="sd[b-z][1-9]", RUN+="/usr/bin/sudo -u berz_ /usr/bin/udevil umount /dev/%k"

It seems to work.

Offline

#65 2012-07-20 18:56:03

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

The next branch of udevil (udevil-git) now includes a remove command to safely remove devices.  I borrowed and modified some code from pmount-jjk for this.  I would appreciate some testing on various kinds of devices.  For example:

udevil remove /dev/sdd

should unmount all mounted partitions on /dev/sdd, and will then sync, stop, unbind the driver, and power off the device.  (You can also specify any partition on the device such as /dev/sdd1)

Note that udevil will refuse to stop the device if it is internal or the connection interface is not one of usb, firewire, sdio, esata (ata_serial_esata), but will still perform the unmounting and sync.  (You can see the interface type at the bottom of 'udevil info DEVICE'.)  If this limitation causes anyone problems I'd like to hear the details.

Unmounting permissions go through the same checks as always, and if unmount is denied the device is not stopped.  udevil will also deny a device which is forbidden or not allowed, even if unmounted.

Last edited by IgnorantGuru (2012-07-20 19:02:48)

Offline

#66 2012-07-20 22:22:45

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

On my external disk, doing "udevil remove /dev/sdb" has no effect on the power/activity light. It stays lit. Could it be because it is USB powered or that its a third-party enclosure? Its a Vantec Nexstar CX 2.5" FWIW.

BTW why is sync run AFTER unmounting?

Last edited by anonymous_user (2012-07-20 22:23:22)

Offline

#67 2012-07-21 12:51:45

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

anonymous_user wrote:

On my external disk, doing "udevil remove /dev/sdb" has no effect on the power/activity light. It stays lit. Could it be because it is USB powered or that its a third-party enclosure? Its a Vantec Nexstar CX 2.5" FWIW.

I have added some debug info, so please reinstall udevil-git and run this:

udevil --verbose remove /dev/sdX

That will show exactly what files are being modified to unbind and power down, and will give a warning if they're missing.  On my external usb drive (the kind that spins), the light also stays on.  But the light also stays on with  'udisks --detach'.

BTW why is sync run AFTER unmounting?

Primarily because that's where it was in the code I adapted this from.  There is value to syncing after unmount - seems to be something to do based on drive activity.  I wonder why they didn't sync before unmounting, but that may be redundant.  I just added an additional sync before unmounting.

Offline

#68 2012-07-21 12:57:16

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

~ > udevil --verbose remove /dev/sdb
udevil: examining partition /dev/sdb1
udevil: unmount partition /dev/sdb1
udevil: trying umount as current user
USER: /bin/umount -v /dev/sdb1
      umount exit status = 1
ROOT: /bin/umount -v /media/My_Disk
udevil: cleaned '/media/My_Disk'
udevil: unbind driver: echo '1-6' > /sys/devices/pci0000:00/0000:00:02.1/usb1/1-6/driver/unbind
udevil: suspend device: echo '0' > /sys/devices/pci0000:00/0000:00:02.1/usb1/1-6/power/autosuspend
udevil: auto power control: echo 'auto' > /sys/devices/pci0000:00/0000:00:02.1/usb1/1-6/power/control
Stopped device /sys/devices/pci0000:00/0000:00:02.1/usb1/1-6

Offline

#69 2012-07-21 13:53:04

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

@anonymous_user:  Thanks, that is all normal - no warnings.  So it was able to write to the relevant files.  (You can issue the same commands yourself as root, though udevil doesn't actually use echo - it opens the file and writes to it.)

I guess the question is how to verify spin down and power down.  sdparm perhaps, but I don't see an option that gives this info.  Based on feeling vibration in the drive, udevil doesn't seem to spin it down, but udisks --detach does (although the light stays on).  So the method from pmount-jjk doesn't seem to be effective.  I had trouble finding the code in the udisks source that handles this, but I'll take another look.

So at present the remove function isn't working completely.  It does sync and unbind the driver, so the device should be safe to remove, but it doesn't seem to cause a spin down.

Last edited by IgnorantGuru (2012-07-21 14:01:12)

Offline

#70 2012-07-21 17:19:14

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

udevil (next branch) has been prepared for translations.  If you'd like to see udevil in your language please consider translating.  It's a relatively small job (at least compared to spacefm).

See TRANSLATE for instructions - all that's needed is a text editor.

Offline

#71 2012-08-11 16:51:08

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I've formatted my USB flash disk to UDF like this:

mkudffs --blocksize=512 --media-type=hd --lvid=label --vid=label --vsid=label --fsid=label /dev/sdg

but when it gets mounted with devmon the label isn't recognised so the drive is mounted to /media/sdg-usb-USB_Flash_Disk_A/. Is there a way to make udevil recognise it? Even Windows recognises the label fine. And I'm not sure if the default options for UDF are optimal - ro and noexec should maybe be removed from the default config. ro because UDF file systems don't have to necessarily be read only and noexec because UDF supports POSIX file premissions so I might want to individually choose which files can be executed and which can't. Finally devmon keeps outputting

which: no udisks in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)
which: no udisksctl in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)
which: no pmount in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)

- is that normal? I don't need udisks, udisks2 or pmount and I've enabled kernel polling so devmon should't need them either. Thanks.

Offline

#72 2012-08-11 17:40:29

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

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

I think those messages are normal. I believe devmon is capable of using different backends so it checks if they are present on the system.

Offline

#73 2012-08-12 11:54:39

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

C5OK5Y wrote:

I've formatted my USB flash disk to UDF like this:

mkudffs --blocksize=512 --media-type=hd --lvid=label --vid=label --vsid=label --fsid=label /dev/sdg

but when it gets mounted with devmon the label isn't recognised so the drive is mounted to /media/sdg-usb-USB_Flash_Disk_A/. Is there a way to make udevil recognise it? Even Windows recognises the label fine.


What does info report the label to be?

udevil info /dev/sdg

That will show what udevil sees as the volume label (which it gets from a udev database property).  It will use it if it's a valid UTF-8 string, doesn't begin with a space, and doesn't contain a '/'.  I'll see if I can duplicate your result too.

And I'm not sure if the default options for UDF are optimal - ro and noexec should maybe be removed from the default config. ro because UDF file systems don't have to necessarily be read only and noexec because UDF supports POSIX file premissions so I might want to individually choose which files can be executed and which can't.

The ro is included to prevent mount warnings, but I'll reconsider that.  The noexec is to enhance security - by default udevil mounts everything with noexec.  It's up to the admin user to change this if desired.

Finally devmon keeps outputting

which: no udisks in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)
which: no udisksctl in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)
which: no pmount in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/core_perl)

- is that normal? I don't need udisks, udisks2 or pmount and I've enabled kernel polling so devmon should't need them either. Thanks.

That's just devmon checking to see what's available, but it could be less verbose.  Thanks for the feedback.

Offline

#74 2012-08-12 14:23:48

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

C5OK5Y wrote:

I've formatted my USB flash disk to UDF like this:

mkudffs --blocksize=512 --media-type=hd --lvid=label --vid=label --vsid=label --fsid=label /dev/sdg

but when it gets mounted with devmon the label isn't recognised

I tried formatting with the above command and udevil info shows no label, nor does udisks --show-info (v1).  udevil (and udisks 1) reads the label by getting udev property ID_FS_LABEL_ENC, or failing that, ID_FS_LABEL.  I've never seen this fail on any other fs type.

Also, mounting the device without specifying a fstype I get this error:

# mount /dev/sda3 /mnt/test
mount: /dev/sda3: more filesystems detected. This should not happen,
       use -t <type> to explicitly specify the filesystem type or
       use wipefs(8) to clean up the device.

mount: you must specify the filesystem type

This works:

# mount -t udf /dev/sda3 /mnt/test

udevil, which unlike mount determines the fstype using udev, also cannot get the fstype.  So it seems the udev database is not properly set for udf used in this way.  (You can also see there is no fstype listed in udevil info.)

volname also reports no volume label.  And blkid:

# BLKID_DEBUG=0xffff blkid -p /dev/sda3
[--snip--]
<-- leaving probing loop (failed) [SUBLKS idx=57]
ERROR: superblocks chain: ambivalent result detected (2 filesystems)!
zeroize wiper
/dev/sda3: ambivalent result (probably more filesystems on the device, use wipefs(8) to see more details)
reseting probing buffers pr=0x197a030
buffers summary: 37243 bytes by 95 read() call(s)
free probe 0x197a030

I also tried formatting a whole device usb stick like your example - same result.  I also tried block size of 2048, because some linux tools reportedly don't like block sizes less than that with udf, but same result.  This problem does not occur on udf DVDs, afaik.

This bug is not directly related perhaps, but may have some info.  I don't see much else.  You may need to set the iso9660 volume label somehow if there really are two filesystems on there.  Or this may be a bug or yet-to-do in udev.  Udevil is udev based so if this doesn't report a label, it won't get it, eg:

udevadm info -q env -n /dev/sdg | grep ID_FS_LABEL

Offline

#75 2012-08-14 09:45:28

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: udevil - mount without password, monitor udev [SpaceFM, devmon, CLI]

IgnorantGuru wrote:

What does info report the label to be?

udevil info /dev/sdg
Showing information for /org/freedesktop/UDisks/devices/sdg
  native-path:                 /sys/devices/pci0000:00/0000:00:1d.7/usb7/7-5/7-5:1.0/host7/target7:0:0/7:0:0:0/block/sdg
  device:                      8:96
  device-file:                 /dev/sdg
    presentation:              /dev/sdg
    by-id:                     /dev/disk/by-id/usb-USB_Flash_Disk_AAB7652700000190-0:0
  system internal:             0
  removable:                   1
  has media:                   1
  is read only:                0
  is mounted:                  1
  mount paths:                 /media/sdg-usb-USB_Flash_Disk_A
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  automount hint:              
  size:                        8019509248
  block size:                  512
  usage:                       filesystem
  type:                        udf
  version:                     
  uuid:                        
  label:                       
  drive:
    vendor:                    USB
    model:                     Flash Disk
    revision:                  1100
    serial:                    AAB7652700000190
    WWN:                       
    detachable:                1
    ejectable:                 0
    media:                     
      compat:                  
    interface:                 usb
    if speed:                  480000000 bits/s

The ro is included to prevent mount warnings, but I'll reconsider that.  The noexec is to enhance security - by default udevil mounts everything with noexec.  It's up to the admin user to change this if desired.

OK

That's just devmon checking to see what's available, but it could be less verbose.  Thanks for the feedback.

Great, you're welcome. Maybe devmon should list missing tools from PATH only when it actually needs them.

Also, mounting the device without specifying a fstype I get this error:

# mount /dev/sda3 /mnt/test
mount: /dev/sda3: more filesystems detected. This should not happen,
       use -t <type> to explicitly specify the filesystem type or
       use wipefs(8) to clean up the device.

mount: you must specify the filesystem type

I tried to do the same and it worked:

# mount /dev/sdg /mnt/test
$ mount | grep sdg
/dev/sdg on /mnt/test type udf (rw,relatime,utf8)

You're error might be caused by a leftover partition table, try clearing it with this:

# dd if=/dev/zero of=/dev/sdX bs=512 count=1

udevil, which unlike mount determines the fstype using udev, also cannot get the fstype.  So it seems the udev database is not properly set for udf used in this way.  (You can also see there is no fstype listed in udevil info.)

Actually if you look at my output of udevil info /dev/sdg it seems that udf is listed next to type:.

volname also reports no volume label.  And blkid:

# BLKID_DEBUG=0xffff blkid -p /dev/sda3
[--snip--]
<-- leaving probing loop (failed) [SUBLKS idx=57]
ERROR: superblocks chain: ambivalent result detected (2 filesystems)!
zeroize wiper
/dev/sda3: ambivalent result (probably more filesystems on the device, use wipefs(8) to see more details)
reseting probing buffers pr=0x197a030
buffers summary: 37243 bytes by 95 read() call(s)
free probe 0x197a030

My output doesn't have the filesystem errors:

# BLKID_DEBUG=0xffff blkid -p /dev/sdg
[--snip--]
<-- leaving probing loop (failed) [PARTS idx=10]
zeroize wiper
returning TYPE value
returning TYPE value
/dev/sdg: TYPE="udf" returning USAGE value
USAGE="filesystem" 
reseting probing buffers pr=0x1386030
buffers summary: 30679 bytes by 100 read() call(s)
free probe 0x1386030

I have had my flash drive formatted to UDF before and I can't recall any problems with recognition of the label. Then I wrote an ISO to the drive and after a while I reformatted it back to UDF (a few days ago) and I noticed that the label wasn't recognised. That would hint that it is a new error in udev (although I have no idea what I used for mounting back then - probably devmon, but I'm not sure - maybe the label wasn't recognised even back then, but I really think I would have noticed that).

Offline

Board footer

Powered by FluxBB