LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-23-2018, 05:41 AM   #1
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Rep: Reputation: Disabled
MTP access without root rights


Hi. I only can have access to my Sony Xperia Z3 as a root user which is inconvinient, there's a qoute from mtpfs' readme:
Quote:
Note that you may need to be root to do all this if permissions on the
MTP device are not correct
what does it mean "permissions on the MTP device" and how to fix them?
Slackware 14.2
 
Old 01-23-2018, 06:08 AM   #2
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
Okay found it in arch-wiki:
Quote:
Note: The following is likely to not work and you might have to resort to gphoto2 or a file manager with gvfs support like PCManFM.
First edit your /etc/fuse.conf and uncomment the following line:
user_allow_other
Mount your device on ~/mnt:
$ mtpfs -o allow_other ~/mnt
but this time I just can't mount it:
Code:
# mtpfs /home/nr/mtp
Listing raw device(s)
Device 0 (VID=0fce and PID=01ba) is a SONY Xperia Z3 MTP.
   Found 1 device(s):
   SONY: Xperia Z3 MTP (0fce:01ba) @ bus 1, dev 17
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: Xperia™ Z3 Dual
fuse: bad mount point `/home/nr/mtp': Transport endpoint is not connected
Yes, I've allowed my phone to connect computer and chosen MTP
same with jmtpfs. phone displays menu to select how to use usb but jmtpfs is has exited already "Transport endpoint is not connected". Can't remember how did I made it work last time.
mtpfs now gives me this:
Quote:
# mtpfs /home/nr/mtp/
Listing raw device(s)
Device 0 (VID=0fce and PID=01ba) is a SONY Xperia Z3 MTP.
Found 1 device(s):
SONY: Xperia Z3 MTP (0fce:01ba) @ bus 1, dev 37
Attempting to connect device
Android device detected, assigning default bug flags
Error 7: Found a bad handle, trying to ignore it.
Error 7: Found a bad handle, trying to ignore it.
Listing File Information on Device with name: Xperia™ Z3 Dual
fuse: bad mount point `/home/nr/mtp/': Transport endpoint is not connecte
"Found a bad handle"... ofc phone is unlocked when I try to connect it

Last edited by Bad Blue Bull; 01-23-2018 at 06:21 AM.
 
Old 01-25-2018, 08:40 AM   #3
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Hi Bad_Blue_Bull,

Do you absolutely need to use MTP as a protocol or would simple file-based access be sufficient ?

MTP (media transfer protocol) treats the device as a "multimedia" device, essentially for purposes of "syncing" media libraries .. I personally never use this approach, preferring to manually copy media files and organize them the way I choose. For this type of usage, accessing the appliance as a simple removable storage device (similar to the way one would use a USB drive, for example) is all that's required.

Let us know !

Cheers.
 
Old 01-25-2018, 11:34 AM   #4
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
Rickkkk: I've connected it as MSC this time but I can't find my media files there.
 
Old 01-25-2018, 11:47 AM   #5
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by Bad Blue Bull View Post
Rickkkk: I've connected it as MSC this time but I can't find my media files there.
Hmmm. That's odd ... Couple more questions:
  • Do you see any directories/files at all ?

  • Is there a removable media card (SD ...) in the device ?

  • If yes, is it showing up as well as the device itself as a mass storage device ?
Thanks.
 
Old 01-25-2018, 12:00 PM   #6
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
I can browse dirs but they all are empty. Yes, MSC is about SD card only.
 
Old 01-25-2018, 12:23 PM   #7
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Bad_Blue_Bull,

I'm experimenting with this myself right now and having little success myself. I may have been too quick in recommending by-passing MTP.

Am currently troubleshooting using jmtpfs ... will update you with results.

Sorry this turned out being more finicky than I initially expected ...
 
Old 01-25-2018, 12:45 PM   #8
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
OK ... I had immediate success with MTP after all ... sorry for the confusion. I didn't even need jmtpfs. I just connected the phone (made sure it was unlocked first, which you have confirmed you've also done ...) and got a dialog on it asking me to allow access. Answered OK and it was available via my File Manager (I use PCManFM on Arch). Note that my system has libmtp, gvfs and gvfs-mtp installed.

An annoyance is that access disconnects when the phone automatically goes to its lock screen ... Since it's my office phone, I'm not sure I can modify that ...

So now ... questions:
  • What file manager are you using ? Do you know if it is is gvfs-capable ? It it is, and you have the appropriate packages installed on your system, it should auto-mount the phone.

  • Rereading the output you provided, mtpfs and jmtpfs seem to be objecting to your mount point (/home/nr/mtp) ... I imagine you are certain this directory actually still exists ? Are the permissions on the directory sufficiently ... permissive .. ?

  • Also, although I realize you were advised that root access may be required, have you tried any of this while logged on as your regular user ? That is how it is working in my particular case ...

  • Lastly, what version of Android are you running on your phone ?

Last edited by Rickkkk; 01-25-2018 at 01:05 PM.
 
Old 01-25-2018, 02:14 PM   #9
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
1. Dolphin automounts phone, I can browse its memory but I can't open any file.
2. well, well, well, I've managed to access it somehow. Changed mode of the mtp dir to drwxrwxrwx and now it works, but only when I run mtpfs as root. As I said before I could access it few days ago, so not sure if it lasts.
still can't access it as a regular user.

so back to the first msg of topic:
Quote:
Note that you may need to be root to do all this if permissions on the
MTP device are not correct
how to make it available for all users?
 
Old 01-25-2018, 02:27 PM   #10
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
dddammmnne, unmounted it, mounted it again successfully but can't mount again neither with mtpfs nor with jmtpfs

Quote:
# jmtpfs mtp <<<<<<<<<<<<<< success
Device 0 (VID=0fce and PID=01ba) is a SONY Xperia Z3 MTP.
Android device detected, assigning default bug flags
# ls mtp
SD-карта Внутренний накопитель
# umount mtp
# mtpfs mtp <<<<<<<<<<<<<<< fail
Listing raw device(s)
Device 0 (VID=0fce and PID=01ba) is a SONY Xperia Z3 MTP.
Found 1 device(s):
SONY: Xperia Z3 MTP (0fce:01ba) @ bus 1, dev 24
Attempting to connect device
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
Listing File Information on Device with name: Xperia™ Z3 Dual
LIBMTP_Get_Storage() failed:-1
# mtpfs mtp <<<<<<<<<<<<<<<<<<<<<<<< fail again
Listing raw device(s)
Device 0 (VID=0fce and PID=01ba) is a SONY Xperia Z3 MTP.
Found 1 device(s):
SONY: Xperia Z3 MTP (0fce:01ba) @ bus 1, dev 26
Attempting to connect device
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
Listing File Information on Device with name: Xperia™ Z3 Dual
LIBMTP_Get_Storage() failed:-1
 
Old 01-25-2018, 03:12 PM   #11
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
It's weid but I've opened an image with through Dolphin. But can't open another one.
 
Old 01-25-2018, 03:57 PM   #12
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
While in the directory containing those images, could you run the following command and post the output ? It's beginning to sound more like a permissions issue now ...

Code:
ls -l
Thanks.
 
Old 01-25-2018, 04:04 PM   #13
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
... Sorry ... just read your 2 previous posts ... It is also sounding unreliable. This is one of the reasons I shy away from MTP when there is another alternative ... It is known to be finicky. Alot depends on the version of Android and how the device manufacturer has configured it.

Unfortunately, Android basically removed UMS mode a couple of versions back, so we are mostly stuck with MTP. On my Samsung Galaxy S7 running Android 7.0 - it seems to work well. Obviously, your experience is not the same.

There are other solutions out there : Airdroid, SCP over SSH, among others. I have no experience with them to share with you, unfortunately. I tend to store anything I'm likely to need on the SD card in the phone and just pop it out and into the computer when I want to transfer or access files. I rarely hook the phone up to the computer for data access.

Perhaps other members can chime in here with more experience ? Sadly ... I am running out of ideas ...
 
Old 01-25-2018, 04:29 PM   #14
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware64-current
Posts: 85

Original Poster
Rep: Reputation: Disabled
Quote:
While in the directory containing those images, could you run the following command and post the output ? It's beginning to sound more like a permissions issue now ...
mounted it again successfully (as root)

-rw-r--r-- 1 root root 2311802 Jan 21 21:44 DSC_0095.JPG

can't mount it as a normal user
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware mount MTP as a non-root user gonny95 Linux - Newbie 11 08-02-2014 01:48 PM
How to check local accounts have root and user access rights ? ranjithm Linux - Server 3 01-08-2013 04:03 AM
ubuntu, I can no longer become root or have root rights TroelsSmit Linux - Newbie 7 03-24-2007 07:17 PM
Root/User rights to Root commands? mrde50garfield Linux - Software 2 10-24-2006 05:42 AM
no access to devices with group access rights flipper333 Debian 2 12-28-2004 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration