Mounting HDD or DVD in both Thunar and PCmanFM: "Not authorized to perform operation"

69 respostas [Última entrada]
hack and hack
Desconectado
Joined: 04/02/2015

Here's mount before plugging the HDD:


/dev/mapper/volumegroup-trisquel on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=me)

And here it is after:

/dev/mapper/volumegroup-trisquel on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=me)

sudo thunar after plugging it in (already made some research on the web):

thunar-volman: Type de périphérique USB non supporté.
thunar-volman: Type de périphérique USB non supporté.
thunar-volman: Type de périphérique bloc inconnu.

And after the DVD is in:

thunar-volman: Ne peux pas détecter le volume correspondant au périphérique.

In PCmanFM, no error messages whatsoever in the cli, (no icons appear);
and when I open it without sudo, I have both Icons, but the same error message.
policykit-1-gnome was already installed.
Same for gvfs.
I have nothing neither in /mnt/ nor in /media/username.
Keep in mind that this is a netinstall.
And that I spend a lotof time in looking for a solution.

I don't master mounting yet, but it doesn't seem practical to do it by hand, so I didn't try yet.

hack and hack
Desconectado
Joined: 04/02/2015

Sudo fdisk -l does show a /dev/sdb disk, and a /dev/sdb1 partition.

fstab only has the internal disk partitions showing.

Manual mounting works. BTW, it's format is FAT32.

I wasn't in the disk group. I added myself. Didn't work, I might need a reboot. EDIT: the reboot did nothing.

I'm out of ideas. I could manually modify fstab I suppose (even though my HDD still turns fast after unmounting), but I want to have an automount that really starts and stops it's activity.

No ideas for the DVD player either. Any input welcomed, as usual!

EDIT: I have to try this:
https://wiki.ubuntu.com/CustomXSession
I read that I need to launch something about dbus.
Hopefully this will do.

hack and hack
Desconectado
Joined: 04/02/2015

Ok so I tried/checked:
- that manual mounting works (I didn't try for the DVD, I don't know how yet)
- since I only use a WM, it seems I need to create and edit and .xinitrc file (I've properly made it an executable script. I think). Inside, I tried unsuccessfully "exec dbus-launch ck-launch-session i3". Prior to that, I installed consolekit.
- gvfs was installed from the start, and some versions of polkit. Someone suggested that I add "/usr/lib/x86_64-linux-gnu/lxpolkit &" in that same file, but navigating there, I can't find the file (though it is installed. It's supposed to force polkit to ask for my pass.
- I've read some stuff about HAL being obsolete, and I can't find it anyway.
- I have yet to understand permissions well enough to see if this is not the issue. But It shouldn't since launching those file managers with sudo or gksudo doesn't change a thing (in some cases, the hdd icon isn't even displayed (specially with gksudo).

One important question is to localize the true source of the issue:

I think that Thunar can be exempted, since the problem occurs with PCmanFM as well.

Trisquel itself? I know I've seen a similar (unanswered) issue on the forum. But I doubt it. At most, it's something missing in the netinstall, which is normal.
Plus I'm aware that I'm not using the stock install, so I'm not complaining. Just looking to make a simple netinstall work. It being Trisquel shouldn't change a thing on this subject.

My wm (i3)? I doubt it. But maybe it's a configuration I've overlooked. For now, it's the only wm I have, so it's launched with startx. from there, I'm trying to use .xinitrc to launch whatever should be launched on startup (including .Xresources config file, which I'm testing).

Rights (chmod)? Sudo/gksudo don't help, so I wonder.
What is really weird is that manual mounting works, and gvfs is supposed to take care of automounting.

EDIT:
I read that Ubuntu takes care of automounting automatically, but some other distros need to have fstab edited. But it seems I can edit fstab to automount.
Yet I wonder how this is taken care of in The normal install? Of course, that's assuming modifing fstab that way work, I have yet to try.
I can mount a DVD manually after creating a cdrom folder in the mnt folder.

But again, if you know how automounting is taken careof in the normal install, I'm interested. I'm comparing that to wifi with network-manager on the normal install vs wpa_supplicant on a netinstall.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

Is gvfsd running?

hack and hack
Desconectado
Joined: 04/02/2015

I'm not sure I'm doing this right: in htop, I have several lines with /usr/lib/gvfsd and other ones with fuse and trash or something. I don't know how to paste htop's content easily.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

You can use 'ps' to "report a snapshot of the current processes" (the 'man' page description) and 'grep' to filter the output. On my system:
$ ps -e | grep gvfsd
16276 ? 00:00:00 gvfsd
16299 ? 00:00:00 gvfsd-fuse
17763 ? 00:00:00 gvfsd-trash
17771 ? 00:00:00 gvfsd-burn
17962 ? 00:00:05 gvfsd-metadata
19467 ? 00:00:00 gvfsd-http

hack and hack
Desconectado
Joined: 04/02/2015

Thanks. Here's my output:

$ ps -e | grep gvfsd
1329 ? 00:00:00 gvfsd
1333 ? 00:00:00 gvfsd-fuse
1849 ? 00:00:00 gvfsd-trash
3931 ? 00:00:00 gvfsd
3935 ? 00:00:00 gvfsd-fuse
10740 ? 00:00:00 gvfsd-metadata

I have gvfsd and gvfsd-fuse twice, and I have neither burn nor http.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

It does not look right to have twice the same daemon running.

hack and hack
Desconectado
Joined: 04/02/2015

After a reboot, I have only 3:

ps -e | grep gvfsd
1403 ? 00:00:00 gvfsd
1407 ? 00:00:00 gvfsd-fuse
1795 ? 00:00:00 gvfsd-trash

This is driving me nuts, I've tried so many things...
I just don't want to rely on editing fstab.
I tried this :https://www.ab9il.net/linux/pcmanfm-usb-mount.html
I tried installing Nautilus (hoping for one of the dependencies to make it work)
I tried Duplicating .xinitrc in my home and adding
exec dbus-launch ck-launch-session i3 (in relation to consolekit which I installed)
I tried to remove completely and reinstall udisks2 and Thunar for example

Seems this happened a lot on ArchLinux, and those attempts I picked from the arch forum/wiki.

This one I definitely want to figure out. After this, KVM should be a piece of cake.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

Did you check whether there is a flag to turn on/off automount in Thunar. The key named "automount" in "org.gnome.desktop.media-handling" does that for Nautilus and can be set with dconf-editor or through the following command (but already is true by default):
$ gsettings set org.gnome.desktop.media-handling automount true

Also, what happens if you execute the following command (assuming that you want to mount /dev/sdb1)?
$ gvfs-mount -d /dev/sdb1

And this one?
$ udisksctl mount -b /dev/sdb1

hack and hack
Desconectado
Joined: 04/02/2015

In the options, there are a few to check. Since I've erased the config files, I rechecked them. No success though.

"gvfs-mount -d /dev/sdb1" tells me
"gvfs-mount: command not found".
After a bit of reading, I installed the missing gvfs-bin.
Now I have "Pas de volume pour le fichier de périphérique /dev/sdb1".

"udisksctl mount -b /dev/sdb1" prompts for the pass, and mounts the drive just fine.

I'll try with Nautilus again.

That gvfs-mount looks promising (thanks btw). I have nothing in my ~/.gvfs folder, even after that gvfs-mount command.
I need some rest, then I should also try this: http://ubuntuforums.org/showthread.php?t=2046659
https://askubuntu.com/questions/61196/why-do-my-gvfs-mounts-not-show-up-under-gvfs-or-run-user-login-gvfs
https://askubuntu.com/questions/232497/how-to-access-gvfs-mounts-from-command-line

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

I think it is normal that ~/.gvfs remains empty. When I plug a USB key, it is automounted but ~/.gvfs remains empty.

Use the default locale to run the command so that you can then search the Web with the error message in English:
$ LC_ALL=C gvfs-mount -d /dev/sdb1

hack and hack
Desconectado
Joined: 04/02/2015

A rather short message :

LC_ALL=C gvfs-mount -d /dev/sdb1
Error mounting /dev/sdb1: Not authorized to perform operation

Yet when I do "sudo id -u myusername", I get 1000.

lembas
Desconectado
Joined: 05/13/2010

> Yet when I do "sudo id -u myusername", I get 1000.

What did you expect?

hack and hack
Desconectado
Joined: 04/02/2015

That hopefully it was a matter of permission, but it's not (unless I overlooked something else).

I'll try a config file related to udisks and managed by polkit and see how it goes next.

hack and hack
Desconectado
Joined: 04/02/2015

Something I dodn't explore properly is the groups I belong to as the main user.

her's a list of groups:

$ compgen -g
root
daemon
bin
sys
adm
tty
disk
lp
mail
news
uucp
man
proxy
kmem
dialout
fax
voice
cdrom
floppy
tape
sudo
audio
dip
www-data
backup
operator
list
irc
src
gnats
shadow
utmp
video
sasl
plugdev
staff
games
users
nogroup
libuuid
netdev
crontab
syslog
messagebus
ME (the user. Btw, why the hell am I listed as a group? Is this schyzophrenia?)
lpadmin
sambashare
utempter
fuse
scanner
colord
pulse
pulse-access
rtkit
mlocate
stunnel4
saned
ssl-cert
avahi

A list of users (I thought I was the only one):
$ compgen -u
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
proxy
www-data
backup
list
irc
gnats
nobody
libuuid
syslog
messagebus
ME (the user)
colord
pulse
rtkit
usbmux
stunnel4
saned
avahi
statd

ADFENO
Desconectado
Joined: 12/31/2012

Sorry for interfering but I guess (but I'm not sure) that a group exists
with your user name so that you can insert users as members of the group.

Say user "organization" has a group whose name is "organization" and he
wants to add users (either through the user-friendly "adduser" command,
or the straight forward "useradd" command), then he associates these
users as the "organization" group as theirs.

hack and hack
Desconectado
Joined: 04/02/2015

I see, it's like the admin's default group. Interesting, thanks.
Please feel free to interfere anytime!

hack and hack
Desconectado
Joined: 04/02/2015

I've forgotten the essential: in which groups I am.

ME adm disk dialout cdrom floppy sudo audio dip video plugdev users lpadmin sambashare

Compared to the existing groups which I'm not in, two seem related to the issue:

messagebus

fuse (that one is interesting because associated with another program, I could be able to mount DVDs, but not sur about the usb drives)

EDIT:
Added myself to fuse, after reboot nothing changed.
Modified my .xinitrc file and added something about polkit to be launched on startup.
I must find a way to check if it's up, because it didn't solve the issue.

I think I'll try the fstab solution, even if it's not what I wanted.
I'll disable it if it works and will keep looking.

Btw, here's the content of my .xinitrc:
#!/bin/sh

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)

# invoke global X session script
. /etc/X11/Xsession
/usr/bin/lxpolkit &
exec dbus-launch ck-launch-session i3
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

The x11 line was already there.
The lxpolkit line is supposed to launch lxpolkit on startup.
The i3 line was supposed to solve the issue.
The last one works, it's to launch the config file of urxvt.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

The groups you are in look OK. My user is not in "disk" but being in more groups should not be the problem.

hack and hack
Desconectado
Joined: 04/02/2015

I tried the dconf-editor (all was checked),

here's my dmesg log (the end of it, about usb):

[30534.232069] usb 2-2: new high-speed USB device number 2 using ehci-pci
[30534.369618] usb 2-2: New USB device found, idVendor=05dc, idProduct=a838
[30534.369630] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[30534.369637] usb 2-2: Product: USB Flash Drive
[30534.369644] usb 2-2: Manufacturer: a brand
[30534.369650] usb 2-2: SerialNumber: a serial number
[30534.440207] usb-storage 2-2:1.0: USB Mass Storage device detected
[30534.440283] scsi4 : usb-storage 2-2:1.0
[30534.440359] usbcore: registered new interface driver usb-storage
[30535.583438] scsi 4:0:0:0: Direct-Access the brand USB Flash Drive 1100 PQ: 0 ANSI: 6
[30535.584130] sd 4:0:0:0: Attached scsi generic sg1 type 0
[30535.585632] sd 4:0:0:0: [sdb] 15634432 512-byte logical blocks: (8.00 GB/7.45 GiB)
[30535.589450] sd 4:0:0:0: [sdb] Write Protect is off
[30535.589455] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
[30535.590498] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[30535.596646] sdb: sdb1
[30535.600373] sd 4:0:0:0: [sdb] Attached SCSI removable disk

Nothing seems problematic.

I nearly tried eveything here.
I just want to dig in more about privileges and groups, and about what's autostarted on boot (how to monitor that first).

hack and hack
Desconectado
Joined: 04/02/2015

me as a user in the proper groups seems to be OK.

I found a command to list what's on on startup.
I'll try to find those that are stopped/waiting,
and appear to be related to the issue.

$ initctl list
avahi-cups-reload stop/waiting
avahi-daemon start/running, process 798
mountall-net stop/waiting
mountnfs-bootclean.sh start/running
passwd stop/waiting
rc stop/waiting
rsyslog start/running, process 724
startpar-bridge stop/waiting
tty4 start/running, process 827
udev start/running, process 371
upstart-udev-bridge start/running, process 362
ureadahead-other stop/waiting
console-setup stop/waiting
hwclock-save stop/waiting
idmapd-mounting stop/waiting
plymouth-log stop/waiting
rpcbind-boot stop/waiting
systemd-logind start/running, process 788
tty5 start/running, process 828
failsafe stop/waiting
mountall.sh start/running
rfkill-store stop/waiting
statd start/running, process 692
dbus start/running, process 613
mounted-var stop/waiting
plymouth-shutdown stop/waiting
plymouth stop/waiting
resolvconf start/running
udev-fallback-graphics stop/waiting
autofs start/running, process 976
checkroot.sh start/running
control-alt-delete stop/waiting
hwclock stop/waiting
mounted-proc stop/waiting
cups-browsed start/running, process 950
setvtrgb stop/waiting
shutdown stop/waiting
statd-mounting stop/waiting
cron start/running, process 972
mountall stop/waiting
mounted-debugfs stop/waiting
mountkernfs.sh start/running
rpcbind start/running, process 614
binfmt-support start/running
console stop/waiting
mounted-run stop/waiting
checkfs.sh start/running
checkroot-bootclean.sh start/running
kmod stop/waiting
mountnfs.sh start/running
plymouth-stop stop/waiting
rcS stop/waiting
wait-for-state stop/waiting
bootmisc.sh start/running
flush-early-job-log stop/waiting
gssd-mounting stop/waiting
rc-sysinit stop/waiting
cups start/running, process 1731
pulseaudio stop/waiting
upstart-socket-bridge start/running, process 664
cryptdisks start/running
mountdevsubfs.sh start/running
tty2 start/running, process 833
udevtrigger stop/waiting
upstart-file-bridge start/running, process 661
container-detect stop/waiting
mounted-dev stop/waiting
mtab.sh start/running
tty3 start/running, process 834
udev-finish stop/waiting
cryptdisks-udev stop/waiting
hostname stop/waiting
mountall-reboot stop/waiting
gssd stop/waiting
mountall-shell stop/waiting
mounted-tmp stop/waiting
network-interface (tun0) start/running
network-interface (lo) start/running
network-interface (eth0) start/running
network-interface (wlan0) start/running
plymouth-ready stop/waiting
plymouth-splash stop/waiting
plymouth-upstart-bridge stop/waiting
portmap-wait stop/waiting
tty1 start/running, process 1013
udevmonitor stop/waiting
dmesg stop/waiting
mountall-bootclean.sh start/running
network-interface-security (network-interface/tun0) start/running
network-interface-security (network-interface/eth0) start/running
network-interface-security (network-interface/wlan0) start/running
network-interface-security (network-interface/lo) start/running
network-interface-security (networking) start/running
networking start/running
procps stop/waiting
rfkill-restore stop/waiting
tty6 start/running, process 836
console-font stop/waiting
idmapd start/running, process 615
network-interface-container stop/waiting
ureadahead stop/waiting

dbus is on, but I don't see anything gvfs or pokit rtelated. Why?

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

I do not have anything related to GVFS or Polkit in this list either. And I do not have line including "mount" (i.e., 'initctl list | grep mount' does not return anything). On the contrary, you have all these lines that may be related to your problem:
mountall-net stop/waiting
mountnfs-bootclean.sh start/running
idmapd-mounting stop/waiting
mountall.sh start/running
mounted-var stop/waiting
mounted-proc stop/waiting
statd-mounting stop/waiting
mountall stop/waiting
mounted-debugfs stop/waiting
mountkernfs.sh start/running
mounted-run stop/waiting
mountnfs.sh start/running
gssd-mounting stop/waiting
mountdevsubfs.sh start/running
mounted-dev stop/waiting
mountall-reboot stop/waiting
mountall-shell stop/waiting
mounted-tmp stop/waiting
mountall-bootclean.sh start/running

hack and hack
Desconectado
Joined: 04/02/2015

Thanks for checking out. I'll gather as much data as I can about these. I quickly did earlier about mountall, and this one seems off the hook.

On a side note my first try with fstab was strange : before startx, during the boot, a message indicated that it tried to mount my USB drive, like it expected to be plugged in before startup. It might be standard behaviour though.
I thought it was recongnized when plugged in.
Either way, I have barely scratched the surface on fstab, I might be able to solve this by myself.

Worst case, I still can mount manually, which is the safest solution (though the fstab thing would be as safe, and more practical). I just wish I could be able to configure automount from a minimal system. I'll try what you suggested, thanks again :)

hack and hack
Desconectado
Joined: 04/02/2015

I have to try that next: https://askubuntu.com/questions/95596/upstart-not-loading-services

That's after reinstalling twe two suggested packages (maybe there's more to reinstall), followed by a reboot :

EDIT:

initctl list
avahi-cups-reload stop/waiting
avahi-daemon start/running, process 642
mountall-net stop/waiting
mountnfs-bootclean.sh start/running
passwd stop/waiting
rc stop/waiting
rsyslog start/running, process 505
startpar-bridge stop/waiting
tty4 start/running, process 943
udev start/running, process 428
upstart-udev-bridge start/running, process 420
ureadahead-other stop/waiting
console-setup stop/waiting
hwclock-save stop/waiting
idmapd-mounting stop/waiting
plymouth-log stop/waiting
rpcbind-boot stop/waiting
systemd-logind start/running, process 619
tty5 start/running, process 946
failsafe stop/waiting
mountall.sh start/running
rfkill-store stop/waiting
statd start/running, process 733
dbus start/running, process 522
mounted-var stop/waiting
plymouth-shutdown stop/waiting
plymouth stop/waiting
resolvconf start/running
udev-fallback-graphics stop/waiting
autofs start/running, process 1029
checkroot.sh start/running
control-alt-delete stop/waiting
hwclock stop/waiting
mounted-proc stop/waiting
cups-browsed start/running, process 995
setvtrgb stop/waiting
shutdown stop/waiting
statd-mounting stop/waiting
cron start/running, process 1016
mountall stop/waiting
mounted-debugfs stop/waiting
mountkernfs.sh start/running
rpcbind start/running, process 677
binfmt-support start/running
console stop/waiting
mounted-run stop/waiting
checkfs.sh start/running
checkroot-bootclean.sh start/running
kmod stop/waiting
mountnfs.sh start/running
plymouth-stop stop/waiting
rcS stop/waiting
wait-for-state stop/waiting
bootmisc.sh start/running
flush-early-job-log stop/waiting
gssd-mounting stop/waiting
rc-sysinit stop/waiting
cups start/running, process 1353
pulseaudio stop/waiting
upstart-socket-bridge start/running, process 633
cryptdisks start/running
mountdevsubfs.sh start/running
tty2 start/running, process 971
udevtrigger stop/waiting
upstart-file-bridge start/running, process 482
container-detect stop/waiting
mounted-dev stop/waiting
mtab.sh start/running
tty3 start/running, process 972
udev-finish stop/waiting
cryptdisks-udev stop/waiting
hostname stop/waiting
mountall-reboot stop/waiting
gssd stop/waiting
mountall-shell stop/waiting
mounted-tmp stop/waiting
network-interface (tun0) start/running
network-interface (lo) start/running
network-interface (eth0) start/pre-start, process 539
network-interface (wlan0) start/running
plymouth-ready stop/waiting
plymouth-splash stop/waiting
plymouth-upstart-bridge stop/waiting
portmap-wait stop/waiting
tty1 start/running, process 1055
udevmonitor stop/waiting
dmesg stop/waiting
mountall-bootclean.sh start/running
network-interface-security (network-interface/tun0) start/running
network-interface-security (network-interface/eth0) start/running
network-interface-security (network-interface/wlan0) start/running
network-interface-security (network-interface/lo) start/running
network-interface-security (networking) start/running
networking start/running
procps stop/waiting
rfkill-restore stop/waiting
tty6 start/running, process 974
console-font stop/waiting
idmapd start/running, process 524
network-interface-container stop/waiting
ureadahead stop/waiting

It seems that besides the processes numbers, nothing changed.
Plus I do notice on startup a line telling about automounting as running.

Are there any packages I could try to reinstall?
Maybe systemd?

hack and hack
Desconectado
Joined: 04/02/2015

These are all the processes running with my user account:

ps -u myusername
PID TTY TIME CMD
1313 tty1 00:00:00 bash
1345 tty1 00:00:00 xinit
1376 tty1 00:00:00 ck-launch-sessi
1421 tty1 00:00:01 x-window-manage
1424 tty1 00:00:00 dbus-launch
1425 ? 00:00:00 dbus-daemon
1427 ? 00:00:00 sh
1429 ? 00:00:00 sh
1437 ? 00:00:00 sh
1439 ? 00:00:00 sh
1441 ? 00:00:00 sh
1445 ? 00:00:00 sh
1446 ? 00:00:00 conky
1449 ? 00:00:00 conky
1450 ? 00:00:01 urxvtd
1451 ? 00:00:02 conky
1452 ? 00:00:01 conky
1454 ? 00:00:00 i3bar
1456 ? 00:00:00 urxvtd
1457 ? 00:00:00 sh
1458 ? 00:00:00 i3status
1471 ? 00:00:00 gksu
1473 ? 00:00:00 gconfd-2
1477 ? 00:00:00 gvfsd
1481 ? 00:00:00 gvfsd-fuse
1693 ? 00:00:00 pulseaudio
1785 ? 00:00:00 sh
1786 ? 00:00:06 thunar
1788 ? 00:00:00 xfconfd
1792 ? 00:00:00 gvfs-udisks2-vo
1815 ? 00:00:00 gvfs-gphoto2-vo
1819 ? 00:00:00 gvfs-afc-volume
1824 ? 00:00:00 gvfs-mtp-volume
1828 ? 00:00:00 gvfsd-trash
1875 ? 00:00:00 sh
1876 ? 00:06:16 abrowser
1922 ? 00:00:00 at-spi-bus-laun
6701 ? 00:00:00 bash
6703 ? 00:00:04 transmission-gt
6704 ? 00:00:00 dbus-daemon
6707 ? 00:00:00 at-spi2-registr
7674 ? 00:00:00 gvfsd-metadata
7825 pts/1 00:00:00 bash
7877 pts/1 00:00:00 ps

I don't see polkit. dbus, gvfs, they're here.
Yet I think I've seen it on another log.

Oh yeah, when doing ps -e, I do have a polkitd running.

Interesting.

hack and hack
Desconectado
Joined: 04/02/2015

While reading this, sice fstab seemed to be used for mounting drives on bootup (https://en.wikipedia.org/wiki/Fstab), I see that udev is used for automounting.

So I reinstalled it, but still no automounting.
But I see other related programs, I wonder if they are installed by default on a normal Trisquel install.

Can someone please tell me if you have USB mount and/or udevil installed by default?

EDIT:
Ok, I've made some serious progress here : after installing usb mount, I can access the HDD when hotplugged, at last!
There's a huge, fat "but", though: not only do I have two items displayed in Thunar (even though only one drive is in), the normal drive name, and something called usb0.
No big deal, but the problem is that I can't unmount them.

EDIT_2:
Talked too soon. I removed some fstab line I previously created (that didn't work anyway), and a bunch of folders in media (usb0 to usb8 or something).
I've also removed a folder named after my HHD that I've created previously.
I'll try a reboot first. And maybe create a folder, but I shouldn't have to since it's about hotplugging usb devices.
_______________________________________________________
EDIT3:
I tried to reinstall both udev and usbmount, but the folder don't appear. Maybe a full removal and install is needed, but I decided to create them myself (the description of usbmount says 7 folders). And I'm back to square one.
I can hotplug a drve, I can't unmount with the mouse.
And 2 drives are displayed in Thunar while only one is plugged (the name of my drive, and the usb0 drive/folder).

I modified the usbmount config file: added ntfs and umask=0 so that i can mount ntfs and so that I'm able to write in the plugged HDD. When saved, I plugged it in again, and this time, only the drive name appeared. I was like "cool!" until I clicked on it: I can't access it anymore.

But I also noticed that in the Thunar window opened with gksudo, previously only usb0 appeared. This tells me that prior to allowing writing rights, the HDD was in read only (I suppose), while usb0 was modifiable with root access.

But now that I modified the conf file, I can't do neither (following an official Ubuntu tutorial).

Any insight welcomed, as usual.

hack and hack
Desconectado
Joined: 04/02/2015

My mistake, I forgot a comma in the conf file.
Now I can hotplug, copy/paste, but for some reason, I still can't unmount.

Also the usb0 folder is back again.

Another thing I've noticed: I can disconnect (what's the difference with eject, and unmount, I have no idea) usb0 from the gksudo Thunar. And while usb0 disappears on both Thunars (with and without gksudo), I still have the drive name without being able to access it anymore (until I unplug and replug). But fdisk tells me it doesn't unmount the drive.

I'm so close...

Btw, I think I have 2 folders appearing because my HDD has a name. So I have this one plus the default usb0.

EDIT:
I need to use pumount to unmount. Maybe I can associate a Thunar action to that, but I'm already hacking too much.
It's supposed to be simple.
Also, I still hear a click when I disconnect the HDD too quickly after unmounting, why is that?

I must be missing some program, it must be it.
Ah, the joys of a vanilla install... The rewards come later :)

hack and hack
Desconectado
Joined: 04/02/2015

While reading this, sice fstab seemed to be used for mounting drives on
bootup (https://en.wikipedia.org/wiki/Fstab), I see that udev is used for
automounting.

So I reinstalled it, but still no automounting.
But I see other related programs, I wonder if they are installed by default
on a normal Trisquel install.

Can someone please tell me if you have USB mount and/or udevil installed by
default?

hack and hack
Desconectado
Joined: 04/02/2015

My mistake, I forgot a comma in the conf file.
Now I can hotplug, copy/paste, but for some reason, I still can't unmount.

Also the usb0 folder is back again.

hack and hack
Desconectado
Joined: 04/02/2015

I succeeded in automounting a USB key.
I tried the very first thing here : http://crunchbang.org/forums/viewtopic.php?id=34355&p=1

I created an automount.pkla in /etc/polkit-1/localauthority/50-local.d/

[Allow Automount]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.filesystem-mount
ResultAny=yes
ResultInactive=yes
ResultActive=yes

I still need to eject it through the command line.

So two questions here :
- why isn't this file installed by default ? I'd like to understand and potentially fix that in the Trisquel netinstall.

- how can I enable the ejection when using the ejection icon in Thunar? For now, I'll try to look for a possible "filesystem-eject" to append to the freedesktop.udisks2. command, and then try another .pkla file (after some reading, as usual).

EDIT:
I tried something about ejection, but it doesn't work yet :
https://marc.info/?l=mageia-discuss&m=130926243419549

I tried udisks2 instead of udisks, I tried yes instead of no, and filesystem-eject instead of drive-eject.

That's as far as I can go with blind trial and error (exluding mixing and matching all these options).

hack and hack
Desconectado
Joined: 04/02/2015

It worked with an external HDD too, but not only do I have to eject through the CLI, but the ejection doesn't seem to work : the disks are still turning fast, and the disk name is still displayed in Thunar. I assume this is a security feature.

When I let it rest, and the led turns itself off, I can unplug it without any weird noise. But it takes AGES.
On a proprietary lappy, it ejects and quiets down right away. This is my goal.

As usual, any tip is warmly welcomed!

__________________________________________________
EDIT:

What I can do now:
I can mount/unmount at will from Thunar, at last.
I can turn the HDD off so I can safely remove it right away, but I need to launch gnome-disks as root each time. Not practical.

What I still can't do:
eject from Thunar (though I have yet to try with a DVD).
That's the last hurdle here.
Seems that Thunar doesn't have a "safey remove" feature though.
so I tried Nautilus, which gives me the following error : can't stop ASMT 2105. And there's no "safely remove" as root.

I'll try the command line "detach" option, and see if I can use it as a Thunar personnalized command.

Still, this inability to eject bothers me.

hack and hack
Desconectado
Joined: 04/02/2015

I found out that Action=org.freedesktop.udisks2.filesystem-mount;org.freedesktop.udisks2.eject-media;org.freedesktop.ud$ does the ejection as well. Supposedly, because it didn't work for me.
Also, not sure about the last bit (ud$).
But I understand now that a netinstall demands a manual configuration regarding policikit.
Source http://brahim.hamdouni.com/usb-mount-and-polykit-en/

I might ask the author of the article directly to solve and understand this.

Of course, it wouldn't stop the disk from turning, but that's normal. So what's left then is to possibly implement HDD poweroff with a command, and making it a shortcut in Thunar, and voilà.

EDIT:
I tried this, and it works: https://askubuntu.com/questions/532586/what-is-the-command-line-equivalent-of-safely-remove-drive

I need to make it a Thunar command now. Should be ok.
but that eject part is still annoying. udisks --unmount partition doesn't work without sudo (as it is supposed ton according to the article). and it completely removes the drive from Thunar. Sounds like ejection to me, but I need to be sure. If it is, then all I'd need would be udisks with a personalised Thunar command.

I also wonder why I need udisks and not udisks2 to detach. The latter should be more up-to-date.

hack and hack
Desconectado
Joined: 04/02/2015

To spin down/power off a HDD, there's also (or only) udisks --detach /dev/sdx, and I'd like to make it a clickable item in Nautilus as well.

Provided I can do that (which is a probleme on its own), there's no way such a command would differentiate one drive from another.

As long as it's unmounted, the drive is safe to unplug, but it really feels bad to unplug it while it's spinning. Waiting isn't always an option.

Got any tip?

EDIT: As lembas suggested here (how-create-browser-integration-youtube-dl#comment-92020), launchy could work in order to launch the command (maybe if I put it in a script).
That's another option.

I still would need to identify and isolate the drive name/path in order to power off only the one I want to remove.

hack and hack
Desconectado
Joined: 04/02/2015

About powering the drive off:
in gnome shell (standard install), I have on right-clic the ability to safely remove the drive.
I tested udisks --detach /dev/sdx, which had the exact same effect.
It works, but it immediately starts again. Not mounting, but still getting powered on again.
My goal is to keep it off.

The other thing is that I get a message telling me that the drive is in use every time I try to unmount. But the only thing that's on is Nautilus.

Compared to my netinstall: udisks --detach has the intended effect, but I have yet to associate the right-clic to Thunar.

EDIT:
It's weird because on gnome-shell with Nautilus (right-clic gives "remove safely", which is udisks --detach), it works, but one of my HDD just mounts again one second after. It does work with the other.
I'll check the formatting of both, maybe that's the cause.
https://askubuntu.com/questions/609756/cannot-remove-safely-usb-external-hard-drive-it-mounts-again
https://askubuntu.com/questions/487525/external-disk-mount-again-after-safe-removal
Unfortunately I don't have another cable (it's not the stamdard usb to micro o mini usb).
I have yet to try twice in a row.
Otherwise, I still have to try and configure Thunar, though I'll combine umount with udisks --detach in the same command.
The only issue is when I have more than one drive plugged in at a time. Is each drive associated to a /dev/sdx number? Or is it the plug order that counts? Gotta figure this out.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

The plug order matters. The 'mount' command tells what device is mounted where.

hack and hack
Desconectado
Joined: 04/02/2015

Thanks, that means I should be able to write generic umount && udisks --detach commands.

It seems complicated to do anything with the Thunar command creation. gksu umount %f gave me the gksudo prompt, but that's it (f% being the path of the currently selected folder or document).
I suppose I could write some scripts that I could launch with a keyboard shortcut in i3wm, or with dmenu. Not great but would be acceptable.

Btw, it's weird because udisks --detach just works on my netinstall. Only on the full install with gnome-shell added does it detach and mount again.

I have to write my password but this command works like a charm from the CLI:
"sudo udisksctl unmount -b /dev/sdb1 && sudo udisksctl power-off -b /dev/sdb1"

Unfortunately, Thunar still doesn't buy it.

Just to be on the safe side, I could add the same command with sdb2, sdb3, sdc1, sdc2, etc. Ugly, but might work.
Or something like unmount and detach -a (all), if it existed (only for umount).

EDIT:
OK, I just found this, and it means I should be able to start the script from Thunar after all:
https://www.linux.com/learn/tutorials/440846-extend-xfces-thunar-file-manager-with-custom-actions

Though I'm not sure the folder corresponding to my drive in the media folder would respond to it.
But I can try. Or if the path variable is absolutely needed (and instead writing my own). I just tried for another command: it's not needed, so the script alone should work if the HDD's path isn't picked up by the variable.

hack and hack
Desconectado
Joined: 04/02/2015

Last issue in this thread (beyond the one right above) is DVD copy. I'll add the details when I have some time to tackle it.

I can read, eject, but I can't copy it. I installed something that was supposed to help (can't remember it, I need better organization), but didn't.
I think it was a Trisquel wiki tip.

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016

Just a couple of ideas that may or may not be relevant for you now:

1.) Run a Trisquel LiveCD and then plug the usb hdd in and see what happens. If the same problem does not exist then it is probably some change you've made.

2.) What settings are in the BIOS related to USB?

3.) Is this USB 3.0 or 2.0?

4.) Is there anything on the hdd? What filesystem does it have? What partitions? edit: I see you answered this

Sorry if this isn't relevant--just some random thoughts on removable hd problems.

edit: clicking is bad. years ago I didn't pay attention to a clicking hard drive and it died. If you have anything you care to keep on a clicking hard drive I would back it up now.

hack and hack
Desconectado
Joined: 04/02/2015

I welcome any intervention, any tip could help me solve this. You already made me think about a few things to try and/or check.

1) I tried that weird HDD both on my netinstall with i3wm, and also on a full install with gnome-shell added. on gnome-shell (aka the full install), everything works with Nautilus, except this specific HDD starts again by itselff when I right-clic and select "safely remove".
On my netinstall, I had to configure polkit to allow automounting, and it worked. I can unmount as well (using Thunar, in my case). So it seems it's more like the netinstall "not changed enough" from the start (Which isn't necessarily a bad thing I suppose).

2) I run over Libreboot, and I frankly have no idea about this kind of setting. It's probably the stock settings though. I'll check it out.

3) It is USB 3.0 (so that's what this weird USB cable is, huh) because it's blue.

4) Yeah, no partitions or anything, the only thing is it's in FAT32 if I'm not mistaken.

In a nutshell, I need to implement the HDD spindown/power off from Thunar (I have high hopes about launching a script from Thunar).
Also, DVD copy has yet to work proprerly.
Last, and definitely least, if I can fix that restart after having safely removed the HDD from the gnome-shell full install, that would be a nice thing. If I remember correctly, it does detach correctly from the CLI. I'll try again.

Thanks for the backing up thing. I didn't know that clicking was this bad. But it does SOUND bad, it definitely doesn't feel like the thing to do (remove before spindown and power off).

EDIT:
I have problems with my script.
I can launch it from the CLI either with ./ or the full path, but I can't execute it from Thunar (I can execute another one with the same permission, so the problem isn't Thunar).
Also, neither udisks nor unidsksctl works without sudo on my machine (I don't want a sudo prompt for that). I tried to add polkit rules, but no success yet, even after restarting.

So the script works from the CLI, but not from Thunar (either directly clicked on, or through the personal command which is "nameofscript.sh %F". I tried with a full path as well).
And I failed to remove the sudo prompt, even from the CLI. There was a way to do it with sudoers, whatever that is.

I'm so close, I can smell success already.

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016

Have you tried this program: panel-test-applets

choose 'disk mounter' from the drop-down menu. Whatever size applet you choose you won't really see it (unless you resize it's window) until you plug something in.

That is a GNOME program. I'm not sure how well it will work for you in i3wm

hack and hack
Desconectado
Joined: 04/02/2015

Weird, I don't find it in the repo.

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016

Then it must have been included with GNOME. I installed GNOME.

hack and hack
Desconectado
Joined: 04/02/2015

It's weird that those dependencies aren't individually available. Maybe they're not made to work outside the gnome ecosystem, not counting a few exeptions.

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016
hack and hack
Desconectado
Joined: 04/02/2015

Thanks pragmatist :)

I already had this in my .xinitrc:
# invoke global X session script
. /etc/X11/Xsession
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec dbus-launch ck-launch-session i3
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

Which means I didn't have the "--exit-with-session" part.
But I don't really understand the condition (if what? else what?).
I'll have to remove the udisk rule (polkit) I've created (that allows automounting) in order to test it.
Now, this .xinitrc thing is about automounting, and might allow me to get rid of the udisk rule.

udev might definitely help if it can (as it says):
- launch a script when unplugged. Unfortunately though, I remember reading that it's already too late to power off an HDD if it's being unplugged.
- changing its permissions could be useful. I'm still trying to make unmount and power off work without sudo.

hack and hack
Desconectado
Joined: 04/02/2015

this part of the command, when using the --no-user-interaction argument, doesn't work: udisksctl power-off -b /dev/sdb1 --no-user-interaction
here's the message: "Error powering off drive: Not authorized to perform operation (udisks-error-quark, 4)"
Yet the manual clearly indicates:
udisksctl power-off {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
So it should work, in theory. And no luck finding something on the web yet.
Tried the exact syntax, no changes.
It does work with the unmount part though.

Now, clicking on the script in Thunar does work.
I have yet to make the command (accessible from a right clic) work.

Getting closer...

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016

Have you tried using the script exactly the way they did without any changes?

hack and hack
Desconectado
Joined: 04/02/2015

I think so, but I could have missed something.

this is the content of my script:
#!/bin/bash
#udisksctl unmount -b /dev/sdb1 && udisksctl power-off -b /dev/sdb --no-user-interaction
udisks --unmount /dev/sdb1 && udisks --detach /dev/sdb

The first two (commented) lines are what I describe above (basically, --no-user-interaction doesn't work for power-off).
The last one with udisks can't work without sudo for now.
I'm digging in the manuals.

Not as important, but this is interesting sinc it puts the plugged in device in a variable. But it doesn't solve the problem of having 2 or more devices plugged in at the same time: https://askubuntu.com/questions/597761/external-usb-hard-drive-wd-elements-not-power-off-itself. So I'll stick with my ugly method for now.

About the HDD starting again by itself, it seems to be a bug related to USB 3 devices:
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/792085

pragmatist

I am a member!

Desconectado
Joined: 03/03/2016

It doesn't look like you used anything in the scripts at those links!

Edit: It is important to realize that you don't reference devices by /dev/sdb you write a udev rule instead.

From Wikipedia on udev:
"udev supports persistent device naming, which does not depend on, for example, the order in which the devices are plugged into the system. The default udev setup provides persistent names for storage devices. Any hard disk is recognized by its unique filesystem id, the name of the disk and the physical location on the hardware it is connected to."

https://en.wikipedia.org/wiki/Udev

hack and hack
Desconectado
Joined: 04/02/2015

I don't understand, what are the scripts or links you're talking about? What's their purpose?

My personal script is supposed to be recognised when I right-clic in Thunar (kinda like with Launchy), in order to power off the HDD. I've chosen a script because Thunar supposedly can run one, but I have yet to make this work.
Maybe I should focus on that since Thunar has a path variable, but I can't make it work for now.

As for udev, I don't understand either: my HDD naming depends on the order it's plugged in, but since I intend to put an array of rules from /dev/sdb1, sdb2 etc., then sdc1, sdc2 etc., it should work ok.
But (If I understand correctly), having the same name assigned would be the solution to replace my messy solution.
But it's not ideal when a new HDD is plugged in I suppose, right?

I just found this, but I don't even know where to modify it: https://udisks.freedesktop.org/docs/2.1.3/udisks-std-options.html
Oh well, worst case is that I'll have to sudo each time I want to power it off (until I find a better way).

So to recap, let's assume my script is satisfactory.
My main problem is Thunar not reading it. Actually it executes it, but not from the personalized command.

Thunar tells me: /bin/sh: 1: safelyremovehdd.sh: not found
Now we're talking.
Ok I'll add it in the bin folder and see what happens.