You are not logged in.
@IgnorantGuru:
Thanks for the detail of your reply - it helps to explain what's happening.
Will look into the photo frame (if you excuse the pun) a bit more ...
Offline
devmon 0.9.5 should successfully mount troublesome devices that aren't normally identified as containing a filesystem. It also now ignores a trailing slash on manual mount and unmount commands.
Offline
devmon 0.9.5 should successfully mount troublesome devices that aren't normally identified as containing a filesystem. It also now ignores a trailing slash on manual mount and unmount commands.
Bravo! 0.9.5 works well with my mysterious photo frame device, and trailing slashes on mountpoints are happy too.
I think you have provided a very valuable utility for Arch with devmon; all your hard work is much appreciated here.
Offline
Thanks too for your feedback and details - you and the others here have been very helpful in taking it the extra distance.
Also to Sirsurthur: Floppy drives have no media detection as far as I can see, so automounting is not feasible. I think your best bet are keyboard shortcuts to:
devmon --mount /dev/fd0
# and
devmon --unmount /dev/fd0
Offline
Thanks for your answer IgnorantGuru !
devmon --mount /dev/fd0 works great so it's not an issue for me !
Offline
Kind of off-topic I know, but I thought it might be useful to mention a script udsks I wrote for manually mounting and unmounting removable media via udisks, adapted from the Bash script by some-guy94. Some of the users I support prefer automounting, some don't, so it's good to have devmon versus a manual alternative!
Offline
Would it be possible to add an option to display notifications when (un)mounting devices. Not with zenity but using notify-send. I like to have some notification when such events occur but I am not really a fan of zenity because using notify-send fits better in the overall setup of my system. Currently I have adapted the script myself in a quick and dirty way to get this functionality, but doing this every time you update it seems a bit stupid to me.
Offline
devmon 1.0.0 is available, which adds an --unmount-recent option to unmount the most recently mounted removable drive. It also adds mount info from udisks to stdout, and slightly improves the way devices which don't report a filesystem are handled.
Last edited by IgnorantGuru (2011-02-16 13:49:51)
Offline
Would it be possible to add an option to display notifications when (un)mounting devices. Not with zenity but using notify-send. I like to have some notification when such events occur but I am not really a fan of zenity because using notify-send fits better in the overall setup of my system. Currently I have adapted the script myself in a quick and dirty way to get this functionality, but doing this every time you update it seems a bit stupid to me.
Not sure what you mean by "when (un)mounting devices". When automounting, you should be able to use an --exec-on-XXX option to update notify-send, traymanager, etc. There is no auto-unmounting (from the daemon mode). As for manual mounts and unmounts, whatever script or keyboard shortcut issues the command "devmon --(un)mount..." should also be able to manually update notify-send, etc. Could you explain where you're modifying the script or what specific events you're looking to execute a command on?
Zenity was just a minor convenience. While I'm not too keen on natively supporting multiple notification apps (everyone has their favorite), I would consider adding --exec-on-XXX type hooks so users can issue the commands they want on various events. But for manual mounting and unmounting, I'm not sure why this would be required, and devmon already provides this ability for automounts.
Offline
@BabyDoc
For mounting 'pop-up' you can use simle notify-send script (which can be autostarted) eg:
#!/bin/sh
killall 'devmon udisks' &
sleep 10
devmon --exec-on-drive "notify-send --icon='block-device' --urgency='low' 'Disc has been mounted' && thunar /media"
ps. I don't know bash - could you tell me how to tell the script to show disc label in pop-up and start thunar directly in mounted folder?
Lenovo G50 | LXQT-git | compton | conky
Offline
@BabyDoc
For mounting 'pop-up' you can use simle notify-send script (which can be autostarted) eg:#!/bin/sh killall 'devmon udisks' & sleep 10 devmon --exec-on-drive "notify-send --icon='block-device' --urgency='low' 'Disc has been mounted' && thunar /media"
ps. I don't know bash - could you tell me how to tell the script to show disc label in pop-up and start thunar directly in mounted folder?
With devmon you can do that with %d=mount point, %l=label, %f=device, and you can use two --exec-on-drive options since they don't need to be executed sequentially. Since %l is passed by devmon in single quotes, I'm changing your single quotes to escaped quotes:
devmon --exec-on-drive "notify-send --icon=block-device --urgency=low \"Disc %l has been mounted\"" \
--exec-on-drive "thunar %d"
Also, your killall 'devmon udisks' will attempt to kill a single program named 'devmon udisks', so you don't want to quote that. eg
#!/bin/sh
killall devmon udisks
sleep 10
devmon --exec-on-drive "notify-send --icon=block-device --urgency=low \"Disc %l has been mounted\"" \
--exec-on-drive "thunar %d" &
Ideally killall devmon should be sufficient, but if you don't have any other udisks stuff running, it doesn't hurt to kill that just in case.
Last edited by IgnorantGuru (2011-02-16 17:50:30)
Offline
Not sure what you mean by "when (un)mounting devices". When automounting, you should be able to use an --exec-on-XXX option to update notify-send, traymanager, etc. There is no auto-unmounting (from the daemon mode). As for manual mounts and unmounts, whatever script or keyboard shortcut issues the command "devmon --(un)mount..." should also be able to manually update notify-send, etc. Could you explain where you're modifying the script or what specific events you're looking to execute a command on?
Zenity was just a minor convenience. While I'm not too keen on natively supporting multiple notification apps (everyone has their favorite), I would consider adding --exec-on-XXX type hooks so users can issue the commands they want on various events. But for manual mounting and unmounting, I'm not sure why this would be required, and devmon already provides this ability for automounts.
Yeah I knew I could add it to the script used for manually (un)mounting. But using the the --exec-on-XXX options to also achieve this when automounting did not occur to me for some reason. That's why I decided just to do everything in the devmon script itself. Anyway using --exec-on-device and some small modifcations to my pipemenu (I use openbox) gives me the desired result just as well.
Thank you both for the advice.
Offline
Good job, IgnorantGuru! I've found your script to be very useful.
In case there are any openbox users here - I made a pipemenu that allows listing the currently mounted media and open it/unmount it from devmon. It can be found here: http://10098.arnet.am/posts/devmon-pipe … r-openbox/
UPD: I also added the unmount all/optical/recent commands to the pipemenu
Last edited by 10098 (2011-03-07 16:14:36)
:x
Offline
I have a 'media-box' based on arch and was using Thunar for some time to auto-mount and auto-unmount CD/DVDs. It was always a bit unreleaible and now it is not working at all.
There is no keyboard or mouse on the media box, it is using an regular infrared remote and a lircd daemon for user interface.
I have been experimenting with devmon and it seems to be automounting very reliably, however it is not detecting when the DVD is removed. I have been running devmon in the foreground on a console window to monitor its output.
From what I have read Googling about I am not sure if it is supposed to detect when the DVD has been removed.
Will devmon automatically recognise and get rid of the /media directory when the DVD is removed?
Or is this usually handled by the script(s) which were activated when the DVD was inserted into the drive?
Thanks
Offline
I have been experimenting with devmon and it seems to be automounting very reliably, however it is not detecting when the DVD is removed. I have been running devmon in the foreground on a console window to monitor its output.
From what I have read Googling about I am not sure if it is supposed to detect when the DVD has been removed.
It should detect when the disc is ejected and report that to stdout, but it only uses this to know enough to mount it when a disc is next inserted. (Otherwise it would instantly re-mount any manual unmount, which is undesirable). However, the cd or dvd folder in /media is not removed, unlike removable drives. This is a feature/aspect of udisks and is not handled by devmon directly (when removable drives are unmounted, udisks removes their folder in media).
I think you would have trouble making it do so, as udisks is written this way. So you would need to be root to remove that folder. This is probably done this way because generally /media/cd is a permanent mount point. It could also have something to do with your fstab - if /media/cd is defined as a mount point there, udisks may leave it alone. You should be able to remove any optical drive references from fstab, then delete the mount point once as root, and this may change udisks behavior in this area (I haven't tried it like that).
Offline
IgnorantGuru, I want to thank you for providing this awesome program. You made my computing experience much better. You have my full support to continue your great work!!
Mister.Right
Offline
IgnorantGuru,
This seems to work well. I had some trouble getting it set up, but after smashing my head on my desk for a while, then with falconindy's suggestion from here:
https://bbs.archlinux.org/viewtopic.php … 27#p937827
then smashing my head against my desk for a little while longer, I got it fired up.
Thanks.
Offline
Maybe I have just missed it, but I start my WM as
devmon &
exec i3
and I have never had problems with automounting of drives.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Maybe I have just missed it, but I start my WM as
devmon & exec i3
and I have never had problems with automounting of drives.
Both falconindy and I are using urxvtd, maybe that's the difference?
Anyway, the trick is to get consolekit and dbus-launch started, then devmon, then urxvtd, then the window manager. After he explained to me the order and before I realized devmon's place in that order, I tried launching devmon from a terminal inside of X just to test it and failed. To complicate things (in my head), I was expecting to see "echo $DBUS_SESSION_BUS_ADDRESS" return something, which never happened. I wasn't aware of the file under .dbus/session-bus being the default if the global variable wasn't set until today.
Offline
Maybe its urxvtd. Because I don't use it and so all my terminals start up only after my WM has started up thereby also starting devmon by then. I don't even have consolekit installed.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I have what I hope is a quick question. I'm trying to use devmon to launch a script when a DVD is inserted but I get the following error from devmon:
devmon: mount /dev/sr0 --mount-options noexec,nosuid,noatime (ULTRVIOLET)
Mount failed: A job is pending on /dev/sr0
devmon: error mounting /dev/sr0 (0)
Can anyone make any suggestions as to what may be causing this?
Thanks
Offline
devmon: mount /dev/sr0 --mount-options noexec,nosuid,noatime (ULTRVIOLET)
Mount failed: A job is pending on /dev/sr0
devmon: error mounting /dev/sr0 (0)Can anyone make any suggestions as to what may be causing this?
FYI, that 'Mount failed' error is produced by udisks. For troubleshooting, you can manually do what devmon does. After the DVD is inserted:
udisks --mount /dev/sr0
I haven't encountered that "job is pending" though. Perhaps the drive was not unmounted before it was ejected? You can both unmount and eject the drive in one step using (convenient when assigned to a key shortcut):
devmon --eject /dev/sr0
Last edited by IgnorantGuru (2011-09-13 16:28:56)
Offline
Just wanted to say: Thx for your nice work, works like a charm!
Last edited by Evilandi666 (2011-10-23 00:23:47)
Offline
Brilliant! Works flawlessly with CDs/DVDs (data and video!) and all USB disks! One question: how can I get it to mount audio CDs under /media? After inserting audio CD I'm getting:
changed: /org/freedesktop/UDisks/devices/sr0
device: [/dev/sr0]
systeminternal: [0]
usage: []
type: []
label: []
ismounted: [0]
nopolicy: [0]
hasmedia: [1]
opticaldisc: [1]
numaudiotracks: [12]
blank: [0]
media: [optical_cd]
partition: [0]
devmon: audiocd /dev/sr0 ()
But there is nothing under /media or /mnt... Having them mounted under /media would be preferred method - this way I can listen to them in Clementine.
Offline
One question: how can I get it to mount audio CDs under /media? ...there is nothing under /media or /mnt... Having them mounted under /media would be preferred method - this way I can listen to them in Clementine.
You can't mount an audio CD because they don't have a filesystem.
Does Clementine just need a link than points "/dev/cdrom" to "/dev/sr0"?
Offline