You are not logged in.

#1 2011-08-15 08:24:27

choubbi
Member
Registered: 2011-08-14
Posts: 3

[SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

Hi,

I'm new to Arch (even though I must be approximately at my 15th try at installing it properly) and I have a problem with thunar-volman.

Whenever I log in as user, and try to mount a usb drive with thunar, let's say I want to plug a drive labeled Ext3_8Go, I get the same message in a pop-up window : "Failed to mount Ext3_8Go (or anything close, not in English in the text), not authorized (that part is in English)"

My install is :
- net install
- partitions : 9Go for /, no swap, no separate /home
- packages : base and base-devel. The only modifications in the package list is that I remove ppp, pcmciautils, and xfsprogs.
- config : at the install stage I only modify rc.conf to change LOCALE and HOSTNAME, and pacman's mirrorlist to allow all French mirrors in addition to the one at the top.


When the usb installation is over, I run this script :
"installation_xfce.sh"  (there may be some errors left, I modify this script as I learn) :

#!/bin/bash
# expected environment : freshly installed archlinux, login : root.

echo "Are you connected to internet ? If not, please Ctrl+C and reload this script when connected"
echo "Otherwise, press ENTER to continue installation"
read var_dummy

echo "Creation of the user : please type in your user name :"
read var_username
useradd -u 1000 -g users -G audio,lp,storage,optical,video,wheel,games,power,network -d /home/$var_username/ -s /bin/bash -m $var_username
echo "You will now be asked to create the password for this user:"
passwd $var_username

# Add servers for pacman to find packages
cat >> /etc/pacman.conf << EOF
[multilib]
Include = /etc/pacman.d/mirrorlist

[archlinuxfr]
Server = http://repo.archlinux.fr/\$arch

[catalyst]
Server = http://catalyst.apocalypsus.net/repo/catalyst/\$arch
EOF

# Install packages
pacman -Syyu
pacman -S acpi acpid alsa-oss alsa-plugins alsa-utils catalyst catalyst-utils cpufrequtils cups dbus gstreamer0.10-base-plugins iptables laptop-mode-tools mesa net-tools netcfg ntp pm-utils rfkill rsync sudo ttf-dejavu vim wireless_tools xf86-input-evdev xorg-server xorg-utils xorg-xinit xorg-xinput yaourt conky gamin gnome-icon-theme gnome-keyring gvfs-afc network-manager-applet networkmanager slim slim-themes archlinux-themes-slim hicolor-icon-theme xfce4 xfce4-goodies

# If pacman failed, better stop the script here, and wait for a network connection
if [[ $?!=0 ]]
then
echo : failed to install packages - check your network connection, or review script
exit 1
fi

# Fix sound issue
cat > /home/$var_username/.asoundrc << EOF
pcm.!default{
type hw
card 1
device 0
}
ctl.!default{
type hw
card 1
device 0
}
EOF
chown $var_username:users /home/$var_username/.asoundrc

# Configure video settings for X to use Catalyst
if [[ ! -e /etc/X11/xorg.conf.d ]]
then
	mkdir /etc/X11/xorg.conf.d
fi
cat > /etc/X11/xorg.conf.d/20-fglrx.conf << EOF
Section "Monitor"
	Identifier "aticonfig-Monitor[0]-0"
	Option "VendorName" "ATI Proprietary Driver"
	Option "ModelName" "Generic Autodetecting Monitor"
	Option "DPMS" "true"
EndSection

Section "Device"
	Identifier "aticonfig-Device[0]-0"
	Driver "fglrx"
EndSection
EOF

sed -e 's/top_left/bottom_right/' -e '/alignment/i\double_buffer yes' -e '/CPU Usage/a\${color lightgrey}Temperatures:' -e '/CPU Usage/a\ CPU:$color ${hwmon 0 temp 1}°C' </etc/conky/conky.conf >/home/$var_username/.conkyrc
chown $var_username:users /home/$var_username/.conkyrc

# Install clickpad support
yaourt -S xf86-input-synaptics-clickpad

# Add french keyboard to X
sed '/MatchIsKeyboard/a\\tOption "XkbLayout" "fr"' </etc/X11/xorg.conf.d/10-evdev.conf >/etc/X11/xorg.conf.d/10-evdev.conf.new
mv -f /etc/X11/xorg.conf.d/10-evdev.conf.new /etc/X11/xorg.conf.d/10-evdev.conf

# Add new daemons, remove old ones, disable hwclock and remove netfs since I don't use it. add it if you need it
sed '/DAEMONS=/c\DAEMONS=(!hwclock dbus syslog-ng networkmanager laptop-mode acpid @alsa @cupsd @cpufrequtils ntpd crond)' </etc/rc.conf >/etc/rc.conf.new
mv -f /etc/rc.conf.new /etc/rc.conf

# Slim login manager ; change theme
mv /usr/share/slim/themes/archlinux-darch-grey /tmp/
mv /usr/share/slim/themes/default /tmp/
rm -r /usr/share/slim/themes/*
mv /tmp/archlinux-darch-grey /usr/share/slim/themes
mv /tmp/default /usr/share/slim/themes
sed '/^current_theme/c\current_theme archlinux-darch-grey' </etc/slim.conf >/etc/slim.conf

# XFCE login, and thunar launched as a daemon
sed '/^# exec/c\' </etc/skel/.xinitrc >/tmp/.xinitrc
sed '/^# .../c\' </tmp/.xinitrc >/home/$var_username/.xinitrc
cat >> /home/$var_username/.xinitrc << EOF
exec ck-launch-session startxfce4
thunar --daemon &
EOF
chown $var_username:users /home/$var_username/.xinitrc

# Boot to runlevel 5 now, and run slim then
sed -e 's/id:3/#id:3/' -e 's/#id:5/id:5/' -e 's|x:5:respawn:/usr/bin/xdm|#x:5:respawn:/usr/bin/xdm|' -e 's|#x:5:respawn:/usr/bin/slim|x:5:respawn:/usr/bin/slim|' </etc/inittab >/etc/inittab.new
mv -f /etc/inittab.new /etc/inittab

# Add colored prompt to user and root
sed '/^PS1/c\' </etc/skel/.bashrc >/root/.bashrc 
cat >> /root/.bashrc << EOF
PS1='\[\e[0;32m\]\u@\h\[\e[m\] \[\e[0;35m\]\w\[\e[m\] \[\e[m\] \[\e[0;32m\]\t -\[\e[m\] \[\e[1;31m\]\$ \[\e[m\] '
EOF
cp /root/.bashrc /home/$var_username/.bashrc
chown $var_username:users /home/$var_username/.bashrc

# How does one do that automatically ?
# Manually add user to sudoers
EDITOR="vim" visudo

# Reboot, because it's quick and I'm too lazy to learn how to start all the daemons and others.
reboot

I can mount as a user, no password asked, with :

udisks --mount /dev/sdb2

but the GUI method tells me "not authorized".

"groups user" outputs :

lp wheel games network video audio optical storage power users

the command "ck-list-sessions" outputs :

Session2:
	unix-user = '1000'
	realname = ''
	seat = 'Seat1'
	session-type = ''
	active = TRUE
	x11-display = ':0.0'
	x11-display-device = '/dev/tty7'
	display-device = ''
	remote-host-name = ''
	is-local = TRUE
	on-since = '2011-08-15T08:56:03.716103Z'
	login-session-id = '1'
Session1:
	unix-user = '1000'
	realname = ''
	seat = 'Seat2'
	session-type = ''
	active = FALSE
	x11-display = ':0.0'
	x11-display-device = ''
	display-device = ''
	remote-host-name = ''
	is-local = TRUE
	on-since = '2011-08-15T08:56:03.573029Z'
	login-session-id = '1'

For those who don't have time to read the installation script, DBUS is in the DAEMONS list of rc.conf, and .xinitrc launches : exec ck-launch-session startxfce4

Any idea ?

Last edited by choubbi (2011-08-15 15:05:04)


Arch linux beginner
HP DM1z (DM1 3135sf) - 8GB DDR, 64GB SSD - Dual boot Arch/Ubuntu

Offline

#2 2011-08-15 10:32:43

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

Can you post your .xinitrc? I had problems with dbus getting launched from all over the place, resulting in the same errors as yourself. I had to comment out some things in the "default" .xinitrc that I copied from /etc/skel/.xinitrc, because one of the script started a dbus-session I did not want.

Offline

#3 2011-08-15 11:31:57

choubbi
Member
Registered: 2011-08-14
Posts: 3

Re: [SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

Here's my ~/.xinitrc :

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec ck-launch-session startxfce4
thunar --daemon &

and here's the output of "ps aux|grep dbus" :

dbus       727  0.0  0.0  13252  1396 ?        Ss   13:25   0:00 /usr/bin/dbus-daemon --system
user      1483  0.0  0.0  19840   548 ?        S    13:25   0:00 /usr/bin/dbus-launch --sh-syntax --exit-with-session
user      1484  0.0  0.0  14016  1664 ?        Ss   13:25   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
user      1736  0.0  0.0  10568  1000 pts/0    S+   13:30   0:00 grep dbus

I don't know if it helps


Arch linux beginner
HP DM1z (DM1 3135sf) - 8GB DDR, 64GB SSD - Dual boot Arch/Ubuntu

Offline

#4 2011-08-15 14:09:03

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

This is the problem. dbus-launch needs to be run AFTER ck-launch-session, which does not happen in this case. The if-for loop before the line with "exec..." runs a script in /etc/X11/xinit/xinitrc.d/ that runs dbus-launch, and so startxfce4 does not. Just comment out the whole if-fi thing and you are good to go smile There's more info here.

Offline

#5 2011-08-15 15:03:33

choubbi
Member
Registered: 2011-08-14
Posts: 3

Re: [SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

Thanks a lot !
That worked !
I stumbled across this part of the wiki several times before, but didn't really understand so I had not tried.

If anyone's interested in the script, here's the corrected version :

#!/bin/bash
# expected environment : freshly installed archlinux, login : root.

echo "Are you connected to internet ? If not, please Ctrl+C and reload this script when connected"
echo "Otherwise, press ENTER to continue installation"
read var_dummy

echo "Creation of the user : please type in your user name :"
read var_username
useradd -u 1000 -g users -G audio,lp,storage,optical,video,wheel,games,power,network -d /home/$var_username/ -s /bin/bash -m $var_username
echo "You will now be asked to create the password for this user:"
passwd $var_username

# Add servers for pacman to find packages
cat >> /etc/pacman.conf << EOF
[multilib]
Include = /etc/pacman.d/mirrorlist

[archlinuxfr]
Server = http://repo.archlinux.fr/\$arch

[catalyst]
Server = http://catalyst.apocalypsus.net/repo/catalyst/\$arch
EOF

# Install packages
pacman -Syyu
pacman -S acpi acpid alsa-oss alsa-plugins alsa-utils catalyst catalyst-utils cpufrequtils cups dbus gstreamer0.10-base-plugins iptables laptop-mode-tools mesa net-tools netcfg ntp pm-utils rfkill rsync sudo ttf-dejavu vim wireless_tools xf86-input-evdev xorg-server xorg-utils xorg-xinit xorg-xinput yaourt conky gamin gnome-icon-theme gnome-keyring gvfs-afc network-manager-applet networkmanager slim slim-themes archlinux-themes-slim hicolor-icon-theme xfce4 xfce4-goodies

# If pacman failed, better stop the script here, and wait for a network connection
if [[ $?!=0 ]]
then
echo : failed to install packages - check your network connection, or review script
exit 1
fi

# Fix sound issue
cat > /home/$var_username/.asoundrc << EOF
pcm.!default{
type hw
card 1
device 0
}
ctl.!default{
type hw
card 1
device 0
}
EOF
chown $var_username:users /home/$var_username/.asoundrc

# Configure video settings for X to use Catalyst
if [[ ! -e /etc/X11/xorg.conf.d ]]
then
	mkdir /etc/X11/xorg.conf.d
fi
cat > /etc/X11/xorg.conf.d/20-fglrx.conf << EOF
Section "Monitor"
	Identifier "aticonfig-Monitor[0]-0"
	Option "VendorName" "ATI Proprietary Driver"
	Option "ModelName" "Generic Autodetecting Monitor"
	Option "DPMS" "true"
EndSection

Section "Device"
	Identifier "aticonfig-Device[0]-0"
	Driver "fglrx"
EndSection
EOF

sed -e 's/top_left/bottom_right/' -e '/alignment/i\double_buffer yes' -e '/CPU Usage/a\${color lightgrey}Temperatures:' -e '/CPU Usage/a\ CPU:$color ${hwmon 0 temp 1}°C' </etc/conky/conky.conf >/home/$var_username/.conkyrc
chown $var_username:users /home/$var_username/.conkyrc

# Install clickpad support
yaourt -S xf86-input-synaptics-clickpad

# Add french keyboard to X
sed '/MatchIsKeyboard/a\\tOption "XkbLayout" "fr"' </etc/X11/xorg.conf.d/10-evdev.conf >/etc/X11/xorg.conf.d/10-evdev.conf.new
mv -f /etc/X11/xorg.conf.d/10-evdev.conf.new /etc/X11/xorg.conf.d/10-evdev.conf

# Add new daemons, remove old ones, disable hwclock and remove netfs since I don't use it. add it if you need it
sed '/DAEMONS=/c\DAEMONS=(!hwclock dbus syslog-ng networkmanager laptop-mode acpid @alsa @cupsd @cpufrequtils ntpd crond)' </etc/rc.conf >/etc/rc.conf.new
mv -f /etc/rc.conf.new /etc/rc.conf

# Slim login manager ; change theme
mv /usr/share/slim/themes/archlinux-darch-grey /tmp/
mv /usr/share/slim/themes/default /tmp/
rm -r /usr/share/slim/themes/*
mv /tmp/archlinux-darch-grey /usr/share/slim/themes
mv /tmp/default /usr/share/slim/themes
sed '/^current_theme/c\current_theme archlinux-darch-grey' </etc/slim.conf >/etc/slim.conf

# XFCE login, and thunar launched as a daemon (note that the part with 'if [ -d /etc/X11/xinit/xinitrc.d ]" is not present, to avoid mounting problems when logged as regular user)
cat > /home/$var_username/.xinitrc << EOF
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

exec ck-launch-session startxfce4
thunar --daemon &
EOF
chown $var_username:users /home/$var_username/.xinitrc

# Boot to runlevel 5 now, and run slim then
sed -e 's/id:3/#id:3/' -e 's/#id:5/id:5/' -e 's|x:5:respawn:/usr/bin/xdm|#x:5:respawn:/usr/bin/xdm|' -e 's|#x:5:respawn:/usr/bin/slim|x:5:respawn:/usr/bin/slim|' </etc/inittab >/etc/inittab.new
mv -f /etc/inittab.new /etc/inittab

# Add colored prompt to user and root
sed '/^PS1/c\' </etc/skel/.bashrc >/root/.bashrc 
cat >> /root/.bashrc << EOF
PS1='\[\e[0;32m\]\u@\h\[\e[m\] \[\e[0;35m\]\w\[\e[m\] \[\e[m\] \[\e[0;32m\]\t -\[\e[m\] \[\e[1;31m\]\$ \[\e[m\] '
EOF
cp /root/.bashrc /home/$var_username/.bashrc
chown $var_username:users /home/$var_username/.bashrc

# How does one do that automatically ?
# Manually add user to sudoers
EDITOR="vim" visudo

# Reboot, because it's quick and I'm too lazy to learn how to start all the daemons and others.
reboot

The important part of the script to solve the problem is :

cat > /home/$var_username/.xinitrc << EOF
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

exec ck-launch-session startxfce4
thunar --daemon &
EOF
chown $var_username:users /home/$var_username/.xinitrc

Arch linux beginner
HP DM1z (DM1 3135sf) - 8GB DDR, 64GB SSD - Dual boot Arch/Ubuntu

Offline

Board footer

Powered by FluxBB