I've been faffing around for a while trying to work out how to do this, without much success.
Part of the trouble is that looking for USB and automount on Google comes up with lots of stuff about automount and that's a different beast altogether.
I have fathomed out that it's something to do with HAL and udev. If I need to go and edit new entries into /etc/udev/rules.d then so be it but I suspect there's simpler, higher level ways of doing it.
What I want is to be able to plug in my USB Mass Storage camera and get to see the pictures without any further hassle. At the moment I have to do a manual mount command (and in addition I regularly forget to umount it).
I'm sure modern Linux systems should be able to automate this but I can't find out how at the moment. Can anyone point me at a good tutorial or tell me what I need to do?
..., Fedora 8, kernel 2.6.24
On Tuesday 02 September 2008 14:36:40 Chris G wrote:
I'm sure modern Linux systems should be able to automate this but I can't find out how at the moment.
Hehe, I just read that as "auto-*mate*", with the same stress pattern as auto-mount.
..., Fedora 8, kernel 2.6.24
Does you use GNOME in Fedora 8? The gnome-volume-manager does this. Otherwise there's pmount which it seems is available in Fedora https://admin.fedoraproject.org/pkgdb/packages/name/pmount
Cheers, Richard
2008/9/2 Chris G cl@isbd.net:
What I want is to be able to plug in my USB Mass Storage camera and get to see the pictures without any further hassle. At the moment I have to do a manual mount command (and in addition I regularly forget to umount it).
I'm sure modern Linux systems should be able to automate this but I can't find out how at the moment. Can anyone point me at a good tutorial or tell me what I need to do?
..., Fedora 8, kernel 2.6.24
<flippant>Install Ubuntu</flippant>
My Ubuntu box is not reachable from my current location so I'll post the relevant looking bits from udev, etc., later if no one beats me to it.
Tim.
On Tue, Sep 02, 2008 at 03:02:33PM +0100, Tim Green wrote:
2008/9/2 Chris G cl@isbd.net:
What I want is to be able to plug in my USB Mass Storage camera and get to see the pictures without any further hassle. At the moment I have to do a manual mount command (and in addition I regularly forget to umount it).
I'm sure modern Linux systems should be able to automate this but I can't find out how at the moment. Can anyone point me at a good tutorial or tell me what I need to do?
..., Fedora 8, kernel 2.6.24
<flippant>Install Ubuntu</flippant>
My Ubuntu box is not reachable from my current location so I'll post the relevant looking bits from udev, etc., later if no one beats me to it.
Not at all flippant, in fact my next upgrade is probably going to be Ubuntu as I already have Ubuntu Server on my 'garage' backup machine.
Chris G cl@isbd.net wrote: [...]
Part of the trouble is that looking for USB and automount on Google comes up with lots of stuff about automount and that's a different beast altogether.
I have fathomed out that it's something to do with HAL and udev. If I need to go and edit new entries into /etc/udev/rules.d then so be it but I suspect there's simpler, higher level ways of doing it. [...]
I wouldn't do it at a higher level - filesystems are a low-level task and should be available to the whole system, not just GNOME applications or whatever.
My udev rule for one USB stick is:-
ACTION=="add", KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="0930_USB_Flash_Memory_0B70F57172221A70", RUN+="/sbin/mount /Mount/USB-Blue1"
(all on one line, ID_SERIAL from /dev/disk/by-id when it's connected)
The tricky part is unmounting automatically. The system doesn't know when you've finished using it. automount or amd can unmount things after a period of non-use if you want - I just try to remember for some of my devices. Others have a RUN command that sync's the USB stick and a directory on the main filesystem, then umounts. Good for backup of the stick and avoids the umount problem.
Hope that helps,
On Wed, 2008-09-03 at 09:11 +0100, MJ Ray wrote:
I wouldn't do it at a higher level - filesystems are a low-level task and should be available to the whole system, not just GNOME applications or whatever.
Erm...When Gnome on Ubuntu automounts my usb devices they *are* available to the whole system. For example I just plugged in one of my USB sticks and in mount now I have /dev/sdh1 on /media/disk type vfat.
Are you sure you are not confusing this with how Gnome browses SMB resources, those are only available to certain applications because Gnome does it in more of an samba-client style then actually mounting the volume.
On Wed, Sep 03, 2008 at 10:13:16AM +0100, Wayne Stallwood wrote:
On Wed, 2008-09-03 at 09:11 +0100, MJ Ray wrote:
I wouldn't do it at a higher level - filesystems are a low-level task and should be available to the whole system, not just GNOME applications or whatever.
Erm...When Gnome on Ubuntu automounts my usb devices they *are* available to the whole system. For example I just plugged in one of my USB sticks and in mount now I have /dev/sdh1 on /media/disk type vfat.
So how does that get to work? What Gnome utility does it?
On Wed, Sep 03, 2008 at 01:00:27PM +0100, Chris G wrote:
On Wed, Sep 03, 2008 at 10:13:16AM +0100, Wayne Stallwood wrote:
On Wed, 2008-09-03 at 09:11 +0100, MJ Ray wrote:
I wouldn't do it at a higher level - filesystems are a low-level task and should be available to the whole system, not just GNOME applications or whatever.
Erm...When Gnome on Ubuntu automounts my usb devices they *are* available to the whole system. For example I just plugged in one of my USB sticks and in mount now I have /dev/sdh1 on /media/disk type vfat.
So how does that get to work? What Gnome utility does it?
As Richard said yesterday, gnome-volume-manager.
J.
On Wednesday 03 September 2008 13:04:47 Jonathan McDowell wrote:
So how does that get to work? What Gnome utility does it?
As Richard said yesterday, gnome-volume-manager.
I did. Though I didn't mean to suggest "pmount" as an alternative. I think I meant usbmount. (Is that in Fedora? Is it still maintained?)
Cheers, Richard
On Wed, Sep 03, 2008 at 01:04:47PM +0100, Jonathan McDowell wrote:
On Wed, Sep 03, 2008 at 01:00:27PM +0100, Chris G wrote:
On Wed, Sep 03, 2008 at 10:13:16AM +0100, Wayne Stallwood wrote:
On Wed, 2008-09-03 at 09:11 +0100, MJ Ray wrote:
I wouldn't do it at a higher level - filesystems are a low-level task and should be available to the whole system, not just GNOME applications or whatever.
Erm...When Gnome on Ubuntu automounts my usb devices they *are* available to the whole system. For example I just plugged in one of my USB sticks and in mount now I have /dev/sdh1 on /media/disk type vfat.
So how does that get to work? What Gnome utility does it?
As Richard said yesterday, gnome-volume-manager.
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
On Wednesday 03 September 2008 13:18:15 Chris G wrote:
As Richard said yesterday, gnome-volume-manager.
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
Its configuration options are in System > Preferences > Removable Drives and Media.
It probably uses dbus. Check that's running:
$ ps x | grep dbus
If you don't see any processes apart from the ps one then you'll need to find out why dbus isn't running.
Also check that the kernel notices you plug the device in. Plug it in, give it a few seconds, and check:
$ sudo tail -20 /var/log/messages
and you should see several lines regarding your device. Including something like:
"sd 0:0:0:0: [sda] Attached SCSI removable disk"
(That assumes you can sudo tail. If not, you could become root and examine /var/log/messages.)
Cheers, Richard
On Wed, Sep 03, 2008 at 01:36:01PM +0100, Richard Lewis wrote:
On Wednesday 03 September 2008 13:18:15 Chris G wrote:
As Richard said yesterday, gnome-volume-manager.
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
Its configuration options are in System > Preferences > Removable Drives and Media.
It probably uses dbus. Check that's running:
$ ps x | grep dbus
If you don't see any processes apart from the ps one then you'll need to find out why dbus isn't running.
The underlying interface from userspace to the kernel will be HAL (http://hal.freedesktop.org/) which will use DBUS to inform any interested parties that there's a new device they might like to take a prod at. So you'll need hald running too.
J.
On Wed, Sep 03, 2008 at 01:40:54PM +0100, Jonathan McDowell wrote:
On Wed, Sep 03, 2008 at 01:36:01PM +0100, Richard Lewis wrote:
On Wednesday 03 September 2008 13:18:15 Chris G wrote:
As Richard said yesterday, gnome-volume-manager.
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
Its configuration options are in System > Preferences > Removable Drives and Media.
It probably uses dbus. Check that's running:
$ ps x | grep dbus
If you don't see any processes apart from the ps one then you'll need to find out why dbus isn't running.
The underlying interface from userspace to the kernel will be HAL (http://hal.freedesktop.org/) which will use DBUS to inform any interested parties that there's a new device they might like to take a prod at. So you'll need hald running too.
Yes, that's running:-
68 2646 1 0 Aug17 ? 00:00:11 hald root 2647 2646 0 Aug17 ? 00:00:00 hald-runner root 2667 2647 0 Aug17 ? 00:00:02 hald-addon-input: Listening on /dev/input/event5 /dev/input/event4 /dev/input/event1 root 2707 2647 0 Aug17 ? 00:00:00 /usr/libexec/hald-addon-cpufreq 68 2708 2647 0 Aug17 ? 00:00:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket root 2722 2647 0 Aug17 ? 00:01:30 hald-addon-storage: polling /dev/sr0 (every 2 sec) root 2725 2647 0 Aug17 ? 00:05:48 hald-addon-storage: polling /dev/sr1 (every 2 sec)
On Wed, Sep 03, 2008 at 01:36:01PM +0100, Richard Lewis wrote:
On Wednesday 03 September 2008 13:18:15 Chris G wrote:
As Richard said yesterday, gnome-volume-manager.
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
Its configuration options are in System > Preferences > Removable Drives and Media.
Ah, OK, I'd hunted around the menus and not found it, thanks. It seems to have the right boxes there ticked for "Removable Storage".
It probably uses dbus. Check that's running:
$ ps x | grep dbus
If you don't see any processes apart from the ps one then you'll need to find out why dbus isn't running.
Several processes:-
dbus 2026 1 0 Aug17 ? 00:00:09 dbus-daemon --system chris 2983 1 0 Aug17 ? 00:00:00 /usr/bin/dbus-launch --exit-with-session fvwm chris 2984 1 0 Aug17 ? 00:00:00 /bin/dbus-daemon --fork --print-pid 4 --print-address 8 --session
Also check that the kernel notices you plug the device in. Plug it in, give it a few seconds, and check:
$ sudo tail -20 /var/log/messages
and you should see several lines regarding your device. Including something like:
"sd 0:0:0:0: [sda] Attached SCSI removable disk"
Oh it does that alright, that's where I've been getting the information to mount it manually.
Hi,
2008/9/3 Chris G cl@isbd.net:
Several processes:-
dbus 2026 1 0 Aug17 ? 00:00:09 dbus-daemon --system chris 2983 1 0 Aug17 ? 00:00:00 /usr/bin/dbus-launch --exit-with-session fvwm chris 2984 1 0 Aug17 ? 00:00:00 /bin/dbus-daemon --fork --print-pid 4 --print-address 8 --session
Do you run fvwm? Is that even dbus-aware?
I don't really know how it all fits in, but I'd have thought you'd need a dbus-aware desktop environment to be able to get the automatic "new device! what do you want to do with it?" notification. Gnome does it, as does KDE. But for eg. fluxbox does not (AFAIK).
If you were to run Gnome, does the automatic mounting work?
Srdjan
On Wed, Sep 03, 2008 at 02:32:49PM +0100, Srdjan Todorovic wrote:
Hi,
2008/9/3 Chris G cl@isbd.net:
Several processes:-
dbus 2026 1 0 Aug17 ? 00:00:09 dbus-daemon --system chris 2983 1 0 Aug17 ? 00:00:00 /usr/bin/dbus-launch --exit-with-session fvwm chris 2984 1 0 Aug17 ? 00:00:00 /bin/dbus-daemon --fork --print-pid 4 --print-address 8 --session
Do you run fvwm? Is that even dbus-aware?
I don't really know how it all fits in, but I'd have thought you'd need a dbus-aware desktop environment to be able to get the automatic "new device! what do you want to do with it?" notification. Gnome does it, as does KDE. But for eg. fluxbox does not (AFAIK).
I have just tried a USB card reader and that *does* work, when I plug in a window pops up with "A photo card has been detected", so I am making progress at last.
Now to see if the camera is detected....
*Yes*, it is detected! :-)
Thanks all for your help, it seems that all I needed to do was to run gnome-volume-manager as all the other required bits were already in place. What I hadn't done after running gnome-volume-manager was to check to see if it was automagically working, I was expecto either see something happen when I started gnome-volume-manager or to have to configure something.
As I said, thanks everyone, all I have to do now is get gnome-volume-manager started automatically, I guess I can just add it in the same way as I have added gnome-panel to my fvwm start-up.
On 3 Sep 2008, at 1:18 pm, Chris G wrote:
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
If you're not running gnome, I guess it won't do anything. If you are you should have a "Removable Drives and Media" setting in your preference menu where you can configure it.
As ever, Googling for configuring gnome-volume-manager and clicking the first result allowed me to find this out.
Also, I would suggest running things without configuring them or knowing what they do might be a very bad idea.
On Wed, Sep 03, 2008 at 01:40:07PM +0100, David Reynolds wrote:
On 3 Sep 2008, at 1:18 pm, Chris G wrote:
I ran that yesterday and nothing *appeared* to happen. It's still happily running. Should it automatically spot USB mass storage devices being plugged in and mount them for you or do I need to do something to configure it or make it do something?
If you're not running gnome, I guess it won't do anything. If you are you should have a "Removable Drives and Media" setting in your preference menu where you can configure it.
As ever, Googling for configuring gnome-volume-manager and clicking the first result allowed me to find this out.
Also, I would suggest running things without configuring them or knowing what they do might be a very bad idea.
I run an fvwm desktop but have all the gnome libraries installed and fvwm is supposed to be quite 'gnome friendly'. I run a minimal gnome-panel and that provides me with the Gnome System and other menus.
I *did* Google for gnome-volume-manager and read a few of the results but I wasn't all that enlightened. The first hits for my Google were:-
http://ftp.gnome.org/pub/GNOME/sources/gnome-volume-manager/ http://blogs.gnome.org/cneumair/2005/10/06/gnome-volume-manager-sub-optimal-...