You are not logged in.

#26 2011-02-09 10:41:34

pit
Member
From: Poland
Registered: 2010-10-11
Posts: 19

Re: devmon - bash udisks automounting & autostarting

This is what I meant smile
Thanks!

Offline

#27 2011-02-09 15:21:44

BabyDoc
Member
From: Belgium
Registered: 2008-03-20
Posts: 74

Re: devmon - bash udisks automounting & autostarting

I am having some trouble getting a removable drive connected through esata mounted automatically with Devmon. Devmon does detect judging by the console output, but it does not mount it. Mounting it manually works flawlessly. without any special actions or options. Also if I connect the same drive through usb everything works fine and Devmon mounts it automatically.


Existence is futile.

Offline

#28 2011-02-10 00:08:05

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

Devmon seems an excellent piece of work and a worthy lighter alternative to udiskie.
Though I have a couple of comments which you may care to consider:
- I rarely want to unmount all removable devices at the same time, so I'd have to use 'udisks --unmount /dev/etc' to unmount a specific device. Udiskie allows you to more conveniently unmount with reference to the mount point name (/media/etc) instead. (It's much easier for users I support to find their drive by its label rather than the more obscure sdx devices.)
- When I had both a USB flash drive and a DVD mounted, the '--unmount-all' option only unmounted the flash drive; nothing was reported at the console regarding the DVD drive whatsoever. I had to manually unmount the DVD.

Offline

#29 2011-02-10 01:48:04

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

Re: devmon - bash udisks automounting & autostarting

BabyDoc wrote:

I am having some trouble getting a removable drive connected through esata mounted automatically with Devmon. Devmon does detect judging by the console output, but it does not mount it. Mounting it manually works flawlessly. without any special actions or options. Also if I connect the same drive through usb everything works fine and Devmon mounts it automatically.

Please enter this command with the drive connected via esata:

udisks --show-info /dev/xxxx

and let me know the ouput - thanks.  If esata lists it as a 'systeminternal" drive (despite the fact that its external), that would cause devmon to ignore it.

Offline

#30 2011-02-10 01:59:30

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

Re: devmon - bash udisks automounting & autostarting

ninian wrote:

Devmon seems an excellent piece of work and a worthy lighter alternative to udiskie.
Though I have a couple of comments which you may care to consider:
- I rarely want to unmount all removable devices at the same time, so I'd have to use 'udisks --unmount /dev/etc' to unmount a specific device. Udiskie allows you to more conveniently unmount with reference to the mount point name (/media/etc) instead. (It's much easier for users I support to find their drive by its label rather than the more obscure sdx devices.)
- When I had both a USB flash drive and a DVD mounted, the '--unmount-all' option only unmounted the flash drive; nothing was reported at the console regarding the DVD drive whatsoever. I had to manually unmount the DVD.

Thanks - I'll consider implementing the label unmount.  Re --unmount-all, that behavior is by design.  In my case I use it to quickly unmount devices with a key shortcut so I can safely remove them.  I don't see any need to unmount an optical disc - I can just eject it and the filesystem can't be corrupted.  I do have another shortcut that unmounts and ejects the disc, because sometimes vlc will prevent it from ejecting.  If you think it should work differently let me know how you would like it to work so I can consider that. I tried to make devmon versatile but not redundant with udisks, eject, etc.

Offline

#31 2011-02-10 12:24:54

BabyDoc
Member
From: Belgium
Registered: 2008-03-20
Posts: 74

Re: devmon - bash udisks automounting & autostarting

IgnorantGuru wrote:

Please enter this command with the drive connected via esata:

udisks --show-info /dev/xxxx

and let me know the ouput - thanks.  If esata lists it as a 'systeminternal" drive (despite the fact that its external), that would cause devmon to ignore it.

Here is the output, it shows that the drive is considered as 'system internal'. So I am assuming now this is not a devmon problem, the tool just works the way it is intended to based on the information it receives.

Showing information for /org/freedesktop/UDisks/devices/sdb1
  native-path:                 /sys/devices/pci0000:00/0000:00:1f.2/host4/target4:0:0/4:0:0:0/block/sdb/sdb1
  device:                      8:17
  device-file:                 /dev/sdb1
    presentation:              /dev/sdb1
    by-id:                     /dev/disk/by-id/ata-ST31000528AS_9VP225F4-part1
    by-id:                     /dev/disk/by-id/scsi-SATA_ST31000528AS_9VP225F4-part1
    by-id:                     /dev/disk/by-id/wwn-0x5000c500198d7871-part1
    by-id:                     /dev/disk/by-uuid/83402f55-257a-4cfc-ba83-4c2b8e5c1a65
    by-path:                   /dev/disk/by-path/pci-0000:00:1f.2-scsi-4:0:0:0-part1
  detected at:                 Thu 10 Feb 2011 01:16:36 PM CET
  system internal:             1
  removable:                   0
  has media:                   1 (detected at Thu 10 Feb 2011 01:16:36 PM CET)
    detects change:            0
    detection by polling:      0
    detection inhibitable:     0
    detection inhibited:       0
  is read only:                0
  is mounted:                  0
  mount paths:             
  mounted by uid:              0
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  size:                        1000202241024
  block size:                  512
  job underway:                no
  usage:                       filesystem
  type:                        ext4
  version:                     1.0
  uuid:                        83402f55-257a-4cfc-ba83-4c2b8e5c1a65
  label:                       esata
  partition:
    part of:                   /org/freedesktop/UDisks/devices/sdb
    scheme:                    mbr
    number:                    1
    type:                      0x83
    flags:                     boot
    offset:                    32256
    alignment offset:          0
    size:                      1000202241024
    label:                     
    uuid:                      

Existence is futile.

Offline

#32 2011-02-10 13:11:47

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

Re: devmon - bash udisks automounting & autostarting

BabyDoc wrote:

Here is the output, it shows that the drive is considered as 'system internal'. So I am assuming now this is not a devmon problem, the tool just works the way it is intended to based on the information it receives.

Yeah I don't see anything there that devmon can use to distinguish it from an internal hard drive.  The removable flag is unreliable, but the system internal flag is usually viable.  You might want to file a bug report against either udisks or whatever component is responsible for setting that flag.  Let me know if udiskie mounted that for you automatically - if so I can take a look and see how it distinguished it.  It's a little tricky because by spec devmon isn't supposed to attempt to mount internal drives (which the user may not want done).

You might be able to do it manually:

udisks --mount /dev/sdb1

Or you can hack the script.  For example change this section:

        case $event in
            added )
                driveinfo $devpath
                if [ "$systeminternal" != "1" ] && [ "$usage" = "filesystem" ] && \
                   [ "$partition" = "1" ] && [ "$ismounted" != "1" ]; then
                    mountdrive $devpath "$label"
                fi
                ;;

to

        case $event in
            added )
                driveinfo $devpath
                if [ "$systeminternal" != "1" ] && [ "$usage" = "filesystem" ] && \
                   [ "$partition" = "1" ] && [ "$ismounted" != "1" ]; then
                    mountdrive $devpath "$label"
                elif [ "$systeminternal" = "0" ] && [ "$usage" = "filesystem" ] && \
                   [ "$partition" = "1" ] && [ "$ismounted" != "1" ] && \
                   [ "$label" = "esata" ]; then
                    mountdrive $devpath "$label"
                fi
                ;;

which distinguishes it by label, or

        case $event in
            added )
                driveinfo $devpath
                if [ "$usage" = "filesystem" ] && \
                   [ "$partition" = "1" ] && [ "$ismounted" != "1" ]; then
                    mountdrive $devpath "$label"
                fi
                ;;

which ignores systeminternal and simply tries to mount everything (may produce some mount errors).

Also note that to mount system internal drives, udisks needs the org.freedesktop.udisks.filesystem-mount-system-internal action to be granted through PolicyKit, instead of just org.freedesktop.udisks.filesystem-mount, so you may need to create an explicit pkla rule for that or udisks will say 'only root can do that'.

Let me know if you learn anything else - I think mostly this is a problem for whatever component is setting the system internal flag, but that may be a limitation of esata itself.

Offline

#33 2011-02-10 14:45:34

BabyDoc
Member
From: Belgium
Registered: 2008-03-20
Posts: 74

Re: devmon - bash udisks automounting & autostarting

Udiskie does not mount it automatically either. But udiskie does not work well for me in general, it also fails to automatically mount drives connected through usb.
I'll check further into it and let you know if I come up with something. Thanks for the help anyway.

Last edited by BabyDoc (2011-02-11 12:19:51)


Existence is futile.

Offline

#34 2011-02-10 20:35:31

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

Re: devmon - bash udisks automounting & autostarting

devmon 0.9.0 is available.  In addition to some minor changes to existing functions, devmon now provides more manual mount and unmount options.

Changes to existing functions:

* --unmount-all (-a) now unmounts optical drives in addition to removable drives

* mount errors from udisks are now printed to stdout in addition to devmon's error, providing more feedback

* devmon now does eject detection on a per drive basis (eject detection prevents devmon from instantly remounting an optical drive you manually unmount)


Features added in this version:

* added --unmount-removable (-r) and --unmount-optical (-o)

* added --unmount DIR|DEVICE to unmount by mount point label

* added --eject DIR|DEVICE to unmount (if needed) and eject discs in one step

* added --mount-all (-a)

* added --mount DEVICE

* added --info-on-mount to show a drive usage info dialog on mount

* devmon will now pass the following mount options to udisks : --mount-options --mount-fstype --unmount-options --eject-options  (note that --eject-options currently causes a segmentation fault in udisks)

* you can now specify your preferred --mount-options for automounting (note that udisks may add and override options depending on the media)

The new usage:

devmon --help

Automounts and unmounts optical and removable drives using udisks
Requires:    udisks bash>=4
Recommended: consolekit zenity
Usage: devmon [AUTOMOUNT-OPTIONS]   # Run as daemon to automount
       devmon [MOUNT-OPTIONS]       # Or run as client to manually un/mount

AUTOMOUNT-OPTIONS:
--exec-on-device DEVICE "COMMAND"  Execute COMMAND after mounting DEVICE
--exec-on-label "LABEL" "COMMAND"  Execute COMMAND after mounting LABEL
--exec-on-video "COMMAND"          Execute COMMAND after video DVD mount
--exec-on-audio "COMMAND"          Execute COMMAND after audio CD insertion
--exec-on-disc  "COMMAND"          Execute COMMAND after data CD/DVD mount
--exec-on-drive "COMMAND"          Execute COMMAND after drive mount
  Where the following in COMMAND will be replaced with:
     %d    mount point directory (eg /media/cd)
     %f    device name (eg /dev/sdd1)
     %l    label of mounted volume
  Multiple --exec-on-XXX options may be used to execute multiple commands.
  Other exec-on-XXX commands are ignored if exec-on-device or -label executed.
--ignore-device DEVICE             Ignore DEVICE (eg /dev/sdd1)
--ignore-label "LABEL"             Ignore volume with LABEL
--mount-options "OPTIONS"          Default: noexec,nosuid,noatime
--info-on-mount                    Show mounted drive info in a zenity dialog
--no-mount                         Don't mount anything, just exec (disables
                                   --exec-on-video)
--unmount-on-exit                  Unmount all removable drives on exit

MOUNT-OPTIONS:
--unmount-removable | -r      sync and unmount all removable drives and show
                              pop-up dialog (zenity installation required)
--unmount-optical | -o        unmount all optical drives (no pop-up)
--unmount-all | -u            same as --unmount-removable --unmount-optical
--unmount DIR|DEVICE          unmount DEVICE or mount point DIR
--eject DIR|DEVICE            unmount and eject DEVICE or mount point DIR
--mount-all | -a              mount all removable and optical drives
--mount DEVICE                mount DEVICE
--mount-options|--mount-fstype|--unmount-options|--eject-options "OPTIONS"
                              these options will be passed to udisks
--no-gui | -g                 do not show zenity pop-up dialog
--ignore-device DEVICE        Do not unmount DEVICE (eg /dev/sdd1)
--ignore-label "LABEL"        Do not unmount volume with LABEL

For more instructions visit
http://igurublog.wordpress.com/downloads/script-devmon/
http://aur.archlinux.org/packages.php?ID=45842

Offline

#35 2011-02-10 22:11:29

pit
Member
From: Poland
Registered: 2010-10-11
Posts: 19

Re: devmon - bash udisks automounting & autostarting

IgnorantGuru wrote:

d
* added --info-on-mount to show a drive usage info dialog on mount

<3
Again, thanks!

Offline

#36 2011-02-10 23:55:20

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

@IgnorantGuru: Fast response and great work!
Will be most keen to try out your new version and options when I finish work tomorrow.
smile

Offline

#37 2011-02-11 12:29:07

BabyDoc
Member
From: Belgium
Registered: 2008-03-20
Posts: 74

Re: devmon - bash udisks automounting & autostarting

I have done a bit of research on the esata thingie. Apparently it is close to impossible to differentiate an external sata drive from an internal sata drive. That's just the way it is made. So I changed the script a little like you suggested and that works great.

I think I found a minor error in the newest version though. On line 162 you have as the option "--unmount-rem", the help page on the other hand states that the option is "--unmount-removable".


Existence is futile.

Offline

#38 2011-02-11 13:18:21

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

Re: devmon - bash udisks automounting & autostarting

BabyDoc wrote:

I have done a bit of research on the esata thingie. Apparently it is close to impossible to differentiate an external sata drive from an internal sata drive. That's just the way it is made. So I changed the script a little like you suggested and that works great.

I think I found a minor error in the newest version though. On line 162 you have as the option "--unmount-rem", the help page on the other hand states that the option is "--unmount-removable".

Thanks for letting me know about the bug - now corrected in 0.9.2.  I do test these things but sometimes something will slip by.

EDIT:  To help with the esata issue, I have added an "--internal" switch to the command line, which in any mode will cause devmon to treat all drives as external.  In daemon automounting mode, this will cause it to mount any unmounted drives.  With --unmount-removable, this will cause it to attempt to unmount every drive on your system.  In general it shouldn't be able to unmount the real internal drives because udisks reports 'only root can unmount ...'.  So you can probably just ignore the errors, unless you have drives in fstab with a "user" option.

You can also combine the --internal switch with several --ignore-device options to ignore your real internal drives.  So between the two this should remove your need to edit the script, which is a pain when it is updated.  Let me know if that works for you or if you think it would be better to do it differently.

Last edited by IgnorantGuru (2011-02-11 13:49:46)

Offline

#39 2011-02-11 23:03:11

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

Unfortunately, I've discovered some problems with devmon version 0.9.2:

1) It does not mount a device without a first partition sdx1 (ie. device has no partition table?), so eg. typical bootable flash drives containing an operating system will not mount as they are sdx devices only.

2) If the mount directory contains blanks:
line 278: shows label with embedded blanks removed.
line 694: doesn't work as $3 only returns the first word of the directory name.

It's a pity because the new improvements are working well generally!
Will continue testing ...

Offline

#40 2011-02-12 11:32:18

BabyDoc
Member
From: Belgium
Registered: 2008-03-20
Posts: 74

Re: devmon - bash udisks automounting & autostarting

I came across another small bug. In the ignoredevice function (around line 321) the if condition states "${igdev[$iLx]}" this should be "${igdev[$iDx]}". This causes every but the first --ignore-device options to be ignored.
Thank you for the --internal option, gives a cleaner way to solve the esata problem.


Existence is futile.

Offline

#41 2011-02-12 15:12:07

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

Re: devmon - bash udisks automounting & autostarting

@(ninian BabyDoc):  Thanks for putting it through its paces - these problems should be corrected in 0.9.3

Offline

#42 2011-02-12 21:13:11

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

IgnorantGuru wrote:

@(ninian BabyDoc):  Thanks for putting it through its paces - these problems should be corrected in 0.9.3

Yes, thank you very much; these problems seem to have been fixed.

However, no matter what I do I seem to be plagued with the "Poll for media failed: Not Authorized" error message when devmon starts or when I issue the command (independently of devmon) at a terminal: udisks --poll-for-media /dev/sr0

I start X from ~/.bash_profile, using ~/.xinitrc to load Openbox with: exec ck-launch-session dbus-launch openbox-session
Also, I have the following file set up for the storage group I'm in which was set up for udiskie (but should apply to devmon too surely?):
/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla:

[udiskie]
Identity=unix-group:storage
Action=org.freedesktop.udisks.filesystem-mount
ResultAny=yes

Further, /etc/pam.d/login contains: session  optional  pam_ck_connector.so
I've also tinkered with: /usr/share/polkit-1/actions/org.freedesktop.udisks.policy

 <action id="org.freedesktop.udisks.filesystem-mount">
  ...   
  <defaults>
      <allow_any>yes</allow_any>
      ...

all to no avail!
Any ideas please to keep me sane? wink

Last edited by ninian (2011-02-12 21:14:25)

Offline

#43 2011-02-12 22:00:07

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

Re: devmon - bash udisks automounting & autostarting

ninian wrote:

However, no matter what I do I seem to be plagued with the "Poll for media failed: Not Authorized" error message when devmon starts or when I issue the command (independently of devmon) at a terminal: udisks --poll-for-media /dev/sr0

I assume you mean you also receive Not Authorized when devmon attempts to mount using udisks, not just with --poll-for-media.  If that's not the case please let me know.  As I'm sure you noticed I added a pop-up message when the Not Authorized error occurs, to give users a little feedback about what's not working in a backgrounded daemon.  But if that's not a reliable test for mount 'Not Authorized' messages then I would like to change that.  In any event you can disable the error pop-up with --no-gui   I wouldn't worry about the poll-for-media problem if un/mounting is working, although it is odd.

As for troubleshooting console kit, I found that the pkla file being setup had no effect on the 'Not Authorized' issue, in that if the WM wasn't started with consolekit then it still wouldn't work, and if it was started with consolekit then the pkla file was unnecessary as that permission seems to be the default (at least on Arch).

So I would focus on how you're starting ck-launch-session (through what chain of scripts, etc), as that does seem to make a difference in odd ways.  Also, is dbus-launch really required?  You might try removing it if dbus is already in your rc.conf DAEMONS array.  I assume you're starting devmon in autostart.sh after a little sleep.

Offline

#44 2011-02-12 23:39:16

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

Re: devmon - bash udisks automounting & autostarting

At any rate, in 0.9.4 I have made the polkit pop-up error more selective so it will only appear if there is a 'Not Authorized' error on a mount.  And as before it will only appear once, and can be silenced with --no-gui.  I want the error to be useful for those wondering why it was working in a terminal but not started from xinitrc, not merely annoying.  That is the only change in 0.9.4.

http://igurublog.wordpress.com/downloads/script-devmon/
http://aur.archlinux.org/packages.php?ID=45842

Offline

#45 2011-02-13 00:45:19

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

Sorry I wasn't clearer on the circumstances causing the error:

IgnorantGuru wrote:

I assume you mean you also receive Not Authorized when devmon attempts to mount using udisks, not just with --poll-for-media.

No, it only happens once at the start when devmon is loaded (as you suggest, via a sleep in Openbox's autostart.sh). Devmon mounts and unmounts fine after that!

IgnorantGuru wrote:

So I would focus on how you're starting ck-launch-session (through what chain of scripts, etc), as that does seem to make a difference in odd ways.

Eureka! You were dead right: this is the cause of the trouble. When I do a ck-list-sessions in a terminal after X is loaded, neither of my two sessions have 'active = TRUE'. So, after searching various places (Ubuntu especially), I found some Arch bug reports too, notably:
https://bugs.archlinux.org/task/21391
https://bugs.archlinux.org/task/21899
and the true horror of ConsoleKit versus .xinitrc is detailed in: https://wiki.archlinux.org/index.php/Xi … _Framework

From the first bug report comments, I found that both these lines should be added to /etc/pam.d/login (I already had the second):

session optional pam_loginuid.so
session optional pam_ck_connector.so

Lo and behold, my X session is now marked as active and the --poll-for-media error has disappeared!

Thanks for all your help, and I'll try out your latest 0.9.4 version tomorrow.
smile

Offline

#46 2011-02-13 09:50:14

Sirsurthur
Member
Registered: 2009-02-02
Posts: 114

Re: devmon - bash udisks automounting & autostarting

Hi IgnorantGuru and thanks for devmon that I find great !

Still one question : Is there a way to mount (manually or automatically) floppy disks with devmon?

Thanks for your answer !

Offline

#47 2011-02-13 14:48:10

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

Re: devmon - bash udisks automounting & autostarting

ninian wrote:

No, it only happens once at the start when devmon is loaded (as you suggest, via a sleep in Openbox's autostart.sh). Devmon mounts and unmounts fine after that!

Good to know.  0.9.4 won't give you a pop-up error in that case.  Also devmon does the poll-for-media to get the udisks daemon started, but it also starts it another way just in case, which is why in your case the subsequent monitoring and mounts worked.

Thanks for sharing the good research.  I'll update the installation instructions with some of that.  This consolekit business is ugly - more akin to Windows than Linux.  They're definitely not following the KISS principle and they're making quite a mess, which never makes for good security anyway.  But once udisks has its authorization setup, it seems to work reliably.

Offline

#48 2011-02-13 14:56:53

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

Re: devmon - bash udisks automounting & autostarting

Sirsurthur wrote:

Hi IgnorantGuru and thanks for devmon that I find great !

Still one question : Is there a way to mount (manually or automatically) floppy disks with devmon?

Thanks for your answer !

Hi, I think floppies should mount manually with either:

devmon --mount /dev/fd0
# or
udisks --mount /dev/fd0

which is the same thing.  You also have the option of setting /dev/fd0 as a 'user' authorized mount in fstab, in which case you can use mount to mount it as a normal user.  eg

/dev/fd0               /media/fl   auto    user,noauto             0      0

However, I don't think floppies provide any notification when one is inserted, so I don't think it can be mounted automatically.  Closest you could get would probably be to assign keyboard shortcuts to the mount and unmount commands.  I do have an old floppy drive in my system - if I can find a floppy I'll see what the story is.  But I think that is right.

Offline

#49 2011-02-13 21:09:11

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 695
Website

Re: devmon - bash udisks automounting & autostarting

IgnorantGuru wrote:

Thanks for sharing the good research.  I'll update the installation instructions with some of that.

You are welcome; it's certainly helpful for others to have this information in the installation instructions.
Regarding version 0.9.4, I have only two relatively minor/obscure findings:

1) When unmounting by specifying a mountpoint directory, devmon will not tolerate a trailing / on the path. This is a bit of a nuisance when you are using tab completion at a Bash prompt, which automatically ends a path with a trailing /. (But both umount and udiskie tolerate a trailing / on a mountpoint path.)

2) I have an Agfa digital photo frame which never gets mounted by any automounter I've tried, including devmon! However, udisks can mount and unmount it fine, if you specify it as device sdx (it has no partitions). Here's some output which may help:

dmesg:
sd 17:0:0:2: Attached scsi generic sg6 type 0
sd 17:0:0:0: [sdc] Attached SCSI removable disk
scsi 17:0:0:3: Direct-Access     PL1063   OBNAND           0100 PQ: 0 ANSI: 4
sd 17:0:0:3: Attached scsi generic sg7 type 0
sd 17:0:0:1: [sdd] Attached SCSI removable disk
sd 17:0:0:2: [sde] Attached SCSI removable disk
sd 17:0:0:3: [sdf] 222000 512-byte logical blocks: (113 MB/108 MiB)
sd 17:0:0:3: [sdf] Write Protect is off
sd 17:0:0:3: [sdf] Mode Sense: 27 00 00 00
sd 17:0:0:3: [sdf] Assuming drive cache: write through
sd 17:0:0:3: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
sd 17:0:0:3: [sdf] Assuming drive cache: write through
 sdf:
sd 17:0:0:3: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
sd 17:0:0:3: [sdf] Assuming drive cache: write through
sd 17:0:0:3: [sdf] Attached SCSI removable disk
sd 17:0:0:0: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
sd 17:0:0:1: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
sd 17:0:0:3: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
sd 17:0:0:3: ioctl_internal_command return code = 8000002
   : Sense Key : 0x0 [current] 
   : ASC=0x0 ASCQ=0x1
and many, many similar 8000002 messages
udisks --show-info /dev/sdf:
Showing information for /org/freedesktop/UDisks/devices/sdf
  native-path:                 /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host18/target18:0:0/18:0:0:3/block/sdf
  device:                      8:80
  device-file:                 /dev/sdf
    presentation:              /dev/sdf
    by-id:                     /dev/disk/by-id/usb-PL1063_OBNAND_3135204E6F76-0:3
    by-path:                   /dev/disk/by-path/pci-0000:00:1d.7-usb-0:6:1.0-scsi-0:0:0:3
  detected at:                 Sun 13 Feb 2011 20:44:49 GMT
  system internal:             0
  removable:                   1
  has media:                   1 (detected at Sun 13 Feb 2011 20:44:49 GMT)
    detects change:            1
    detection by polling:      1
    detection inhibitable:     1
    detection inhibited:       0
  is read only:                0
  is mounted:                  0
  mount paths:             
  mounted by uid:              0
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  size:                        113664000
  block size:                  512
  job underway:                no
  usage:                       
  type:                        
  version:                     
  uuid:                        
  label:                       
  drive:
    vendor:                    PL1063
    model:                     OBNAND
    revision:                  0100
    serial:                    3135204E6F76
    WWN:                       
    detachable:                1
    can spindown:              0
    rotational media:          Yes, unknown rate
    write-cache:               unknown
    ejectable:                 0
    adapter:                   Unknown
    ports:
    similar devices:
    media:                     
      compat:                 
    interface:                 usb
    if speed:                  480000000 bits/s
    ATA SMART:                 not available
udisks --mount /dev/sdf:
Mounted /org/freedesktop/UDisks/devices/sdf at /media/disk
devmon log:
===========================================
Monitoring activity from the disks daemon. Press Ctrl+C to cancel.
===========================================
added:     /org/freedesktop/UDisks/devices/sde
===========================================
added:     /org/freedesktop/UDisks/devices/sdc
===========================================
added:     /org/freedesktop/UDisks/devices/sdd
===========================================
added:     /org/freedesktop/UDisks/devices/sdf
===========================================
changed:     /org/freedesktop/UDisks/devices/sdf
===========================================
job-changed: /org/freedesktop/UDisks/devices/sdf
===========================================
changed:     /org/freedesktop/UDisks/devices/sdf
===========================================
job-changed: /org/freedesktop/UDisks/devices/sdf
===========================================
job-changed: /org/freedesktop/UDisks/devices/sdf
===========================================
changed:     /org/freedesktop/UDisks/devices/sdf
===========================================
job-changed: /org/freedesktop/UDisks/devices/sdf
===========================================
changed:     /org/freedesktop/UDisks/devices/sdb
===========================================
changed:     /org/freedesktop/UDisks/devices/sda

What's baffling here is why devices sdc, sdd, sde and sdf all appear - I only have sda and sdb internal drives, and no other removable devices were added or removed since devmon was loaded. It's not a big nuisance, but if udisks can mount this device, it seems reasonable that devmon might too.
wink

Last edited by ninian (2011-02-13 21:27:08)

Offline

#50 2011-02-14 00:11:32

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

Re: devmon - bash udisks automounting & autostarting

ninian wrote:

1) When unmounting by specifying a mountpoint directory, devmon will not tolerate a trailing / on the path. This is a bit of a nuisance when you are using tab completion at a Bash prompt, which automatically ends a path with a trailing /. (But both umount and udiskie tolerate a trailing / on a mountpoint path.)

Thanks - I'll take care of that.

2) I have an Agfa digital photo frame which never gets mounted by any automounter I've tried, including devmon! However, udisks can mount and unmount it fine, if you specify it as device sdx (it has no partitions). Here's some output which may help:

It's not automounting because the Usage parameter is blank instead of saying it has a filesystem on it.  For example, if I have a device with 1 partition, the data is on /dev/sdc1, and /dev/sdc doesn't have a filesystem.  When I insert this device, first devmon sees that /dev/sdc has been added, but since Usage doesn't say filesystem it ignores it.  Then /dev/sdc1 will be added, and devmon will mount it since Usage is set to 'filesystem'.  So basically devmon is waiting for /dev/sdf1 in your case.

Now that I know there are devices which misrepresent themselves this way, I'll take a look at the feasibility of having devmon attempt mounts even where there is no apparent filesystem, and then ignore the error if it fails.  That might give us a happy medium.

What's baffling here is why devices sdc, sdd, sde and sdf all appear - I only have sda and sdb internal drives, and no other removable devices were added or removed since devmon was loaded.

I would say that device is designed to be used with a picture transfer protocol and doesn't particularly encourage it being mounted as a drive, which is also why it doesn't advertise the filesystem.  And apparently it's got several 'devices' in there, one of which is the mountable filesystem, and the others probably deal with the protocol - just a guess.  You could also check and see if it has a setting for how it connects to the computer - you might be able to make it appear as a mountable drive - I forget what they call the setting.

It's not a big nuisance, but if udisks can mount this device, it seems reasonable that devmon might too.

Mounting it is no problem - devmon should manually mount it fine.  It's detecting it as a mountable drive that's tricky, because it looks like it's not.

Offline

Board footer

Powered by FluxBB