Bug 207718 - sysutils/mtpfs: mtp mount fails and causes odd behaviour
Summary: sysutils/mtpfs: mtp mount fails and causes odd behaviour
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: John Hixson
Depends on:
Reported: 2016-03-05 09:43 UTC by Dan MacDonald
Modified: 2018-01-17 12:53 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (john)


Note You need to log in before you can comment on or make changes to this bug.
Description Dan MacDonald 2016-03-05 09:43:16 UTC
I have installed mtpfs under PCBSD 11. I have added the line


to /etc/rc.conf and PCBSD already had the line:


in /etc/sysctl.conf.

After connecting my Samsung Galaxy S3 (running CyanogenMod 13) to my PCBSD laptop via a USB cable and enabling the MTP connection on my phone, I run `mtpfs /mnt` as root and I see this:

[dan@pcbsd-D76] /# mtpfs /mnt
Listing raw device(s)
Device 0 (VID=04e8 and PID=685c) is a Samsung Galaxy models (MTP+ADB).
   Found 1 device(s):
   Samsung: Galaxy models (MTP+ADB) (04e8:685c) @ bus 0, dev 5
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)

After a few seconds I am returned to the prompt but I am unable to cd or ls both /mnt and / as it says:

ls: mnt: Operation timed out

As a result I cannot access files on my phone via MTP under FreeBSD. I can use MTP fine under (Arch) Linux using gvfs-mtp.
Comment 1 Dan MacDonald 2016-03-05 09:44:29 UTC
Name           : mtpfs
Version        : 1.1_2
Installed on   : Sat Mar  5 08:24:42 2016 GMT
Origin         : sysutils/mtpfs
Architecture   : freebsd:11:x86:64
Prefix         : /usr/local
Categories     : sysutils
Licenses       : 
Maintainer     : john@pcbsd.org
WWW            : http://www.adebenham.com/mtpfs/
Comment        : MTP device filesystem
Shared Libs required:
Annotations    :
	repo_type      : binary
	repository     : pcbsd-major
Flat size      : 31.8KiB
Description    :
MTPFS is a FUSE filesystem that supports reading and writing from any
MTP device (as supported by libmtp)

WWW: http://www.adebenham.com/mtpfs/
Comment 2 Martin Wilke freebsd_committer 2017-03-05 13:04:57 UTC

Is this problem still existing with the current ports tree?
Comment 3 Dan MacDonald 2017-05-23 15:23:57 UTC
Sorry about the long delay in getting back to you Martin!

Yes, this is still not working for me under HEAD, albeit with a different error now:

# mtpfs /mnt
Listing raw device(s)
Device 0 (VID=1004 and PID=633e) is a LG Electronics Inc. LG G Flex 2.
   Found 1 device(s):
   LG Electronics Inc.: LG G Flex 2 (1004:633e) @ bus 0, dev 4
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 Data Expected
Listing File Information on Device with name: G4
LIBMTP_Get_Storage() failed:-1

This is running as root with MTP enabled on my phone and the previously mentioned config switches set.
Comment 4 Dan MacDonald 2017-05-23 15:34:47 UTC
I just tried again and after a couple of minutes delay, the command completes without an error but if I do an ls on /mnt the operation times out so its not actually working, even when it pretends otherwise.
Comment 5 Dan MacDonald 2017-05-23 16:07:37 UTC
simple-mtpfs is behaving in much the same way. It doesn't give any errors but takes minutes to do anything and times out when you try doing an ls on the supposedly mounted MTP device.
Comment 6 Dan MacDonald 2017-05-23 20:03:45 UTC
Success! Kinda.

gmtp to the rescue! :)