# SD-Card not auto-mounted

## barbar

I use gentoo-sources-2.6.24-r3.hal version = 0.5.9.1-r3.

When I insert a SD-Card in the built-in card reader the card is not mounted. 

The card is recognzed

```
dmesg output:

mmc0: new SD card at address 0002

mmcblk0: mmc0:0002       1955328KiB

 mmcblk0: p1
```

Mounting the card manually works. Auto-Mounting worked with previous kernel gentoo-sources-2.6.22-r9.

I would like that the card is mounted automatically. 

What can I do?

----------

## barbar

Now it is working but only for root.

I added

```
# Mount and remove mmc partitions manually

ACTION=="add" KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/usr/bin/pmount %k"

ACTION=="remove" KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/usr/bin/pumount %k"

```

to /etc/udev/rules.d/10-mmc.rules

dmesg gives

```
mmc0: new SD card at address 0002

mmcblk0: mmc0:0002       1955328KiB

 mmcblk0: p1

UDF-fs: No VRS found

ISOFS: Unable to identify CD-ROM format.
```

but as root I can access the SD-Card in /media/mmcblk0p1

----------

## guen

did you enable

probe all LUNs on each scsi device

under device drivers -> SCSI device support 

in kernel config?

http://www.cs.sfu.ca/~ggbaker/personal/cf-linux

----------

## barbar

I enabled probe all LUNs on each scsi device but it did not help.

dmesg still gives

```
mmc0: new SD card at address 0002

mmcblk0: mmc0:0002       1955328KiB

 mmcblk0: p1

UDF-fs: No VRS found

ISOFS: Unable to identify CD-ROM format
```

Again the SD-Card is mounted but only accessable for root.

----------

## guen

i'm not really sure, but i guess your mounting script gives the rights to root only.

i don't know about "pmount" either.

my suggestion is you remove your udevrules.

then try with "rescan-scsi-bus" after inserting a card into the reader.

only for testing if other users than root can access the card(s).

some silly questions:

did you enable all necessary filesystems in your kernel?

is your user in the "plugdev" group?

follow the guide carefully i gave you a link. sometimes it's only one tiny option

one misses. http://www.cs.sfu.ca/~ggbaker/personal/cf-linux

----------

## barbar

The user is in plugdev group. 

rescan-scsi-bus gives:

```
No SCSI host adapters found in sysfs
```

. Maybe it is because it is a built in card reader (Ricoh).

I removed the udev rules for mmc. After removing I can mount the Sd Card as user with

```
pmount /dev/mmcblk0p1
```

.

When I use the mmc udev rules the Card is mounted only for root although I added 

```
/dev/mmcblk0p1
```

.

Since manually mounting works I guess that I have the important kernel modules enabled. Only the behaviour of udev, pmount is not as it is expected.

----------

## guen

my bad: rescan-scsi-bus can't find it, since cardreader is using usb.

as root do this:

mkdir /media/card

mount /dev/mmcblk0p1 /media/card

chown -R youruser:youruser /media/card

umount /dev/mmcblk0p1

then let your udev-rule mount the reader to /media/card

(aren't udev-rules run by root? maybe try with mount instead of pmount)

----------

## barbar

Hi guen,

I tried your suggestion but after removing the card it is again mounted only for root.

Manually mounting works either with pmaount or with mount (with an entry in fstab).

----------

## guen

You're right, since the udev-rule mounts as root.

But you should be able to access your files and folders on the card,

and write on it, after you have done chown once.

i'm sorry, i don't know of a better solution.

sometimes hotplug on Linux is really still a pain yet.

----------

## fumoffu

I'm having exactly the same problem. Until a few days ago, KDE would tell me about the connected card and ask me to mount it or not. I suppose the change might come from the upgrade from KDE 3.5.7 to 3.5.8 or HAL, but I can't tell for sure because I don't use my SD-Card on a regular basis. But the last time it worked I was still using 3.5.7.

----------

## mamac

Hi,

Please see what Onip does at https://forums.gentoo.org/viewtopic-t-604769-highlight-mmcblk+udev.html with his /etc/udev/rules.d/99-mmc_hack.rules.

----------

## fumoffu

Today I noticed that the issue is gone. Must be because of one of the last updates.

----------

## fbicknel

I had automounting a USB key under Gnome working great; users added to plugdev group, etc.

Then it quit working.  The symptom was a message saying that the user didn't have permission to mount the device.

After a little poking around, I discovered that it had indeed found the device and called it /dev/sdb*.  I remembered I had recently added an /etc/fstab entry to allow me to easily mount /dev/sdb1 on /mnt/backup for occasional backups.  

Turns out that if you remove that entry from /etc/fstab, the automount under Gnome works again.

Just posting my experience in case someone else runs into that problem.

I don't suppose anyone knows how to get devices with certain labels to mount as different device names (/dev/sdc, maybe?)

----------

## mamac

Updates solved the issue for me on my both laptops.

----------

## gerard27

Hi all,

I am also having problems with my cardreader.

When I plug it in I get a window in kde:

3 choices:

1 Open in a new window

2 Open with digikam (works fine)

3 do nothing.

When I choose 1 I get this message:

```

A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.Hal.Device.Volume" member "Mount" error name "(unset)" destination "org.freedesktop.Hal")
```

I am in the plugdev disk and floppy group (no floppy drive on this box)

I would like to be able to write to it.

Gerard.

----------

## mamac

Hi,

My user doesn't have any problem, here's the output of "groups":

```

tty disk lp wheel uucp audio cdrom video games cdrw usb users laure plugdev

```

----------

## gerard27

Thanks mamac!

I added uucp to my user and now it works.

Gerard.

----------

