Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mount a digital camera as non-root user

7 views
Skip to first unread message

Erich Hoffmann

unread,
Jul 6, 2009, 12:16:26 AM7/6/09
to
Hello all.

When I log into X, KDE or gnome, as root, and plug in a digital camera,
it is recognized and mounted without any problem.

When I log in as normal user, the camera isn't mounted because of
security policy. How can I allow the normal user to mount the camera?
I tried with various visudo-commands, my googleing didn't lead to
a solution.

I have the same problem with audio CDs, but those I can mount manually
(sudo) because I know the device name on this box - it is /dev/sdb1.
Neither in dmesg, /var/log/syslog or /var/log/messages I can identify
the device name.

I must be missing something obvious, don't I.

TIA,

Erich

Chris Sorenson

unread,
Jul 6, 2009, 1:02:40 AM7/6/09
to

If it's auto-detected it should say what device it is in
/var/log/debug. You might have more luck mounting it as a regular user
if you add the user to the group that owns the device (add the user in
/etc/group).

Robby Workman

unread,
Jul 6, 2009, 3:08:39 AM7/6/09
to


Yes. Read the CHANGES_AND_HINTS.TXT file on the installation media.

-RW

Erich Hoffmann

unread,
Jul 6, 2009, 3:24:02 AM7/6/09
to

Thanks for your quick reply.

Unfortunately it doesn't work. The version is slackware 12.2.

As to the cdrom, my user is in the cdrom group. (The device is sr0,
I was wrong above with sdb1) I tried to change the ownership and the
entry in fstab from 'noauto,owner' to 'users', I even tried to change
ownership of /dev/sr0, but the system resets that immediately.

As to the camera, the device doesn't show up in /var/log/debug,
and contrary to the cdrom I don't get a popup message on screen.

Here is what dmesg says:

usb 1-3: new high speed USB device using ehci_hcd and address 8
usb 1-3: configuration #1 chosen from 1 choice
usb 1-3: New USB device found, idVendor=04a9, idProduct=311b
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-3: Product: Canon Digital Camera
usb 1-3: Manufacturer: Canon Inc.

So it _is_ recognized, but not mounted and no device.

Normally the usb device is /dev/sdb1, and I can (manually) mount an usb
stick here, but when I plug in the camera, that device does not exist.

Thanks anyway. Perhaps I should read more deeply, but what?

Erich


Erich

jess

unread,
Jul 6, 2009, 6:47:58 AM7/6/09
to

Not all cameras appear as storage devices; some require custom MS
windows software from the mfr's CD. If there is any Linux version of
the driver, it would be available from the Japanese site of the mfr.
The EuroAmericaan operations of Jap companies are controlled by
business-types who would not come near Linux with a 10 foot pole.

The good news is that you can take out the SD card of the camera and
use that as a normal storage device (with a card reader).

jess

unread,
Jul 6, 2009, 6:58:11 AM7/6/09
to

Sorry I misread your post. Since you can mount it as root, try adding
the normal user to various groups including plugdev, video

notbob

unread,
Jul 6, 2009, 10:03:35 AM7/6/09
to
On 2009-07-06, Erich Hoffmann <erichh...@gmx.de> wrote:

> usb 1-3: Manufacturer: Canon Inc.

Bingo!

Unlike most camaras that mount as a simple storage device, Canon makes you
jump through some hoops. You need to install a program that can deal with
Canon's proprietary storage system. I use digiKam, a KDE front end based on
gphoto. You need to install digikam, gphoto2, and a few other libs to see
your canon camera. Most of these have been made into slackware pkgs for
painless install.

As for your other media mount probs, I can't say. I do know that a full
install of slack 12.2 will provide full auto mounting of almost all media
through amorok. I barely need to wave a blank CD at my box and amorok is
popping up windows for every user logged on! ;)


nb

tripwire

unread,
Jul 6, 2009, 11:13:43 AM7/6/09
to
On Jul 6, 9:16 am, Erich Hoffmann <erichhoffm...@gmx.de> wrote:
Make sure you are part of

plugdev <---- group


That should solve your problem

Robby Workman

unread,
Jul 7, 2009, 12:24:21 AM7/7/09
to
On 2009-07-06, Erich Hoffmann <erichh...@gmx.de> wrote:
> Am Mon, 06 Jul 2009 00:02:40 -0500 schrieb Chris Sorenson:
>
>> Erich Hoffmann wrote:
>>> Hello all.
>>>
>>> When I log into X, KDE or gnome, as root, and plug in a digital camera,
>>> it is recognized and mounted without any problem.
>>>
>>> When I log in as normal user, the camera isn't mounted because of
>>> security policy. How can I allow the normal user to mount the camera?
>>> I tried with various visudo-commands, my googleing didn't lead to a
>>> solution.
>>>
>>> I have the same problem with audio CDs, but those I can mount
>>> manually
>>> (sudo) because I know the device name on this box - it is /dev/sdb1.
>>> Neither in dmesg, /var/log/syslog or /var/log/messages I can identify
>>> the device name.
>>>
>>> I must be missing something obvious, don't I.
>>>
>>>
>> If it's auto-detected it should say what device it is in /var/log/debug.
>> You might have more luck mounting it as a regular user if you add the
>> user to the group that owns the device (add the user in /etc/group).
>
> Thanks for your quick reply.
>
> Unfortunately it doesn't work. The version is slackware 12.2.


What "doesn't work?"
From CHANGES_AND_HINTS.TXT:

HAL is not new anymore, but here are a few notes related to it:
1. User accounts with permission to mount removable devices must be in at
least the plugdev group, and the power group is also recommended to
allow shutdown and reboot via HAL methods.
2. HAL will honor settings in /etc/fstab if a device is present there, so
you could technically have removable devices defined in /etc/fstab, but
if the fstab settings do not allow normal users to mount them (with the
"user" or "users" option), then HAL/dbus will not allow them to be
mounted either. In other words, for example, if your fstab line for the
cdrom/dvd drive includes the "owner" option, you will not be able to
mount it as a normal user.

Note that you'll need to restart the messagebus service after making
changes to /etc/group.


> As to the cdrom, my user is in the cdrom group. (The device is sr0,
> I was wrong above with sdb1) I tried to change the ownership and the
> entry in fstab from 'noauto,owner' to 'users', I even tried to change
> ownership of /dev/sr0, but the system resets that immediately.
>
> As to the camera, the device doesn't show up in /var/log/debug,
> and contrary to the cdrom I don't get a popup message on screen.
>
> Here is what dmesg says:
>
> usb 1-3: new high speed USB device using ehci_hcd and address 8
> usb 1-3: configuration #1 chosen from 1 choice
> usb 1-3: New USB device found, idVendor=04a9, idProduct=311b
> usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> usb 1-3: Product: Canon Digital Camera
> usb 1-3: Manufacturer: Canon Inc.
>
> So it _is_ recognized, but not mounted and no device.
>
> Normally the usb device is /dev/sdb1, and I can (manually) mount an usb
> stick here, but when I plug in the camera, that device does not exist.


That's a separate issue. That camera is almost surely a PTP camera,
which means you should be able to use gphoto to query/manipulate it.
gphoto is a command-line app, but I think kde has some sort of gui
tool for working with it also.

-RW

Erich Hoffmann

unread,
Jul 7, 2009, 3:33:42 AM7/7/09
to
Am Mon, 06 Jul 2009 03:47:58 -0700 schrieb jess:

> On Jul 6, 3:24 am, Erich Hoffmann <erichhoffm...@gmx.de> wrote:
>> Am Mon, 06 Jul 2009 00:02:40 -0500 schrieb Chris Sorenson:
>>
>>
>>
>> > Erich Hoffmann wrote:
>> >> Hello all.
>>
>> >> When I log into X, KDE or gnome, as root, and plug in a digital
>> >> camera, it is recognized and mounted without any problem.
>>
>> >>    When I log in as normal user, the camera isn't mounted because
>> >>    of
>> >> security policy.  How can I allow the normal user to mount the
>> >> camera? I tried with various visudo-commands, my googleing didn't
>> >> lead to a solution.
>>

[...]


>
> The good news is that you can take out the SD card of the camera and use
> that as a normal storage device (with a card reader).

This idea with the card reader is very good, I'll go into that. Thanks.

For the rest, please see my summary reply.

Best, Erich

ZZ

Erich Hoffmann

unread,
Jul 7, 2009, 3:42:00 AM7/7/09
to
Am Tue, 07 Jul 2009 04:24:21 +0000 schrieb Robby Workman:

> On 2009-07-06, Erich Hoffmann <erichh...@gmx.de> wrote:
>> Am Mon, 06 Jul 2009 00:02:40 -0500 schrieb Chris Sorenson:
>>
>>> Erich Hoffmann wrote:
>>>> Hello all.
>>>>
>>>> When I log into X, KDE or gnome, as root, and plug in a digital
>>>> camera, it is recognized and mounted without any problem.
>>>>
>>>> When I log in as normal user, the camera isn't mounted because of
>>>> security policy. How can I allow the normal user to mount the
>>>> camera? I tried with various visudo-commands, my googleing didn't
>>>> lead to a solution.

[...]


>> Unfortunately it doesn't work. The version is slackware 12.2.
>
>
> What "doesn't work?"
> From CHANGES_AND_HINTS.TXT:

Sorry, my post you are answering here was posted before I read your hint
to CHANGES_AND_HINTS.TXT.

[...]

Erich Hoffmann

unread,
Jul 7, 2009, 2:25:55 PM7/7/09
to
Am Mon, 06 Jul 2009 04:16:26 +0000 schrieb Erich Hoffmann:

This is a summary reply considering your answers.
Excuse the delay. I was going to post this, and then my wlan connection
went down. Then I had to go to work. Shit happens.

First, thanks for your good help.

Now the main problem is solved, but some others persist (or have
arisen). The camera is recognized and audio cd's are automounted,
only DVD (e.g. the slackware installation dvd) has to be mounted by
hand with sudo.

First, I read CHANGES AND HINTS and some manpages (fstab,mtab...).

I checked the groups and put my user in plugdev and power. Then
I checked /etc/fstab and adapted the lines:

/dev/dvd /media/dvd iso9660 ro,users
0 0
/dev/cdrom /media/cdrom iso9660 ro,users 0 0
/dev/sdb1 /media/usb0 auto ro,users 0 0

As Device name for dvd I had 'auto' as well.

As I said, the camera is recognized, but the dvd I have to mount by
hand. What is strange: When I insert a dvd before starting the
notebook, it is mounted, but the icons on my desktop are gone. I eject
the dvd, log out , log in angain as user, and everything is well again.

OK I 'm happy with this solution and I can do everything I want. The
warning popup "onyl superuser can mount a dvd" is perhaps a sudo issue,
I'll go deeper into that.

Thanks again, erich

0 new messages