# Can't mount CD's or flash drives

## Featherfoot

Hello,

I have just rebuilt my system after a disk crash. I am running an amd64 system with kernel 2.6.34-gentoo-r6. It is mostly working but right now I have two moderately serious problems:

I can't mount CD's, and I can't mount flash drives.

When I try to mount a CD, I get the error message "an error occurred while accessing 'JC_2010_01_06', the system responded: mount: only root can mount /dev/sr0 on /mnt/cdrom.

I tried the old trick of doing a chmod a+rwx /dev/sr0 and chmod a+rwx /mnt/cdrom, but it didn't help. I also changed my login to add a bunch of groups to my account. I am not a member of  disk, lp, wheel, floppy, mail, console, audio, cdrom, video cdrw usb, users, portage, sshd cron ssmtp crontab locate apache messagebus lpadmin plugdev pulse-access pulse, mysql, postgres, ntp. It didn't change anything.

When I try to read my flash drive, I get an error message: "An error occurred while accessing '488.1 MiB Removable Meddia'. the system responded org.freedesktop.Hal.Device.PermissionsDeniedByPolicy org.freedesktop.hal.storage.mount-removable no <--(action, result)

Both error messages are coming from the KDE 4.4.5 automounter.

I don't have any ideas what to try next.

```

 hal is  sys-apps/hal-0.5.14-r2

udev is sys-fs/udev-151-r4

hotplug is sys-apps/hotplug-20040923-r2

```

emerge --info is: 

```

bopper jc # emerge --info

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r6 x86_64)

=================================================================

System uname: Linux-2.6.34-gentoo-r6-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_6000+-with-gentoo-1.12.13

Timestamp of tree: Thu, 07 Oct 2010 21:30:01 +0000

app-shells/bash:     4.0_p37

dev-java/java-config: 2.1.11

dev-lang/python:     2.6.5-r3, 3.1.2-r4

dev-util/cmake:      2.8.1-r2

sys-apps/baselayout: 1.12.13

sys-apps/sandbox:    1.6-r2

sys-devel/autoconf:  2.13, 2.65-r1

sys-devel/automake:  1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.20.1-r1

sys-devel/gcc:       4.4.3-r2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.10

sys-devel/make:      3.81-r2

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"

GENTOO_MIRRORS="http://distfiles.gentoo.org"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="en es"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow X Xaw3d a52 aac aalib acl acpi aim alsa amd64 ao apache2 apm audiofile berkdb blas branding bzip2 cairo calendar caps cdda cddb cdinstall cdparanoia cdr cgi clamav cli cracklib crypt css ctype cups curl cvs cxx dbi dbm dbus dbx dga directfb dri dv dvb dvd dvdr eds encode enscript evo examples expat fastcgi fbcon ffmpeg firefox flac fontconfig foomaticdb fortran ftp gcj gdbm gif gimp glu gmp gnome gnuplot gnutls gphoto2 gpm graphviz gsl gsm gstreamer gtk gtkhtml guile gzip hal handbook hddtemp iconv icq idn ieee1394 imagemagick imlib innodb iodbc ipv6 jabber java java6 javascript jbig jingle jpeg jpeg2k kde kontact lapack latex lcms libcaca libedit libgda libnotify libwww lirc lm_sensors lua lzo mad maildir mikmod milter mime mmap mmx modules motif mozilla mp3 mp4 mpeg mpi mplayer msn mudflap multilib musepac mysql mysqli nas ncurses networkmanager nls nntp nptl nptlonly nsplugin odbc offensive ofx ogg opengl openmp osc oscar oss pam pch pcntl pcre pdf perl php plasma plotutils png policykit portaudio posix postgres ppds pppd pulseaudio python qt3support qt4 quicktime raw rdesktop readline reflection rss ruby samba sasl sdl semantic-desktop session sharedext sharedmem simplexml smp sndfile snmp soap sockets socks5 speex spell sqlite sqlite3 sse sse2 ssl subversion suid symlink sysfs syslog sysvipc szip tcl tcpd theora threads tidy tiff timiditytk tokenizer truetype unicode usb v4l v4l2 vcd vorbis wmf xcomposite xft xine xinerama xinetd xml xnlrpc xorg xosd xvid yahoo zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en es" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

bopper jc # 

```

----------

## Jaglover

So look which group owns sr0?

----------

## Featherfoot

```

bopper portage # ls -l /dev/sr0

brw-rw---- 1 root cdrom 11, 0 Oct  7 15:27 /dev/sr0

```

----------

## Jaglover

 *Quote:*   

> When I try to mount a CD, I get the error message "an error occurred while accessing 'JC_2010_01_06', the system responded: mount: only root can mount /dev/sr0 on /mnt/cdrom. 

 

I'm not a KDE user, is this message from KDE? Can you mount from CLI?

----------

## Featherfoot

I changed protections a bit.

```

jc@bopper ~ $ mount /mnt/cdrom

mount: only root can mount /dev/sr0 on /mnt/cdrom

jc@bopper ~ $ ls -al /mnt/cdrom

total 8

drwsrwsrwx 2 root cdrom 4096 Sep  2 00:13 .

drwsrwsrwx 4 root root  4096 Sep  2 00:13 ..

-rwsrwsrwx 1 root root     0 Sep  2 00:13 .keep

jc@bopper ~ $ ls -al /dev/sr0  

brw-rwx--- 1 root cdrom 11, 0 Oct  7 22:04 /dev/sr0

jc@bopper ~ $ 

```

----------

## jathlon

When you rebuilt you system did you add yourself to all the various groups that you needed?  In a console use the command <groups>  Mine looks like;

```
~ $ groups

lp wheel audio cdrom video games cdrw usb plugdev users username
```

You probably need to be a member of the usb and plugdev groups to automount your usb devices.  Note that I edit the output from my real username to username.

joe

----------

## Jaglover

 *Quote:*   

> I also changed my login to add a bunch of groups to my account. I am not a member of disk, lp, wheel, floppy, mail, console, audio, cdrom, video cdrw usb, users, portage, sshd cron ssmtp crontab locate apache messagebus lpadmin plugdev pulse-access pulse, mysql, postgres, ntp. It didn't change anything. 

 

Is there a typo? You should be member of cdrom to mount it.

----------

## Featherfoot

Here's mine:

```

jc@bopper ~ $ groups

disk lp wheel floppy mail cron console audio cdrom sshd video mysql postgres cdrw apache usb users pulse pulse-access plugdev lpadmin ntp messagebus crontab ssmtp locate portage username

```

----------

## adamf663

edit /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

change mount rule   <action id="org.freedesktop.udisks2.filesystem-mount">

change allow_any rule to:

      <allow_any>yes</allow_any>

----------

