4

After initially not recognising MTP at all (here) I have an issue with both my Nexus 5 and my new Nexus 5x whereby some - but not all - DCIM (camera) and Music folder content shows up in Thunar. I can see the discrepancy on the phone itself or via AirDroid

Thunar view of MTP connected phone on left, AirDroid view of same on right:

Thunar view of MTP connected phone AirDroid view of MTP connected phone

As far as I recall, all files were added using AirDroid, but at different times. The same happens with camera images. Possibly-helpfully, <=5 day old pictures were listed in Thunar, >=6 day old pictures weren't. Photos taken on same phone in same timezone with no other obvious changes. This is NOT true for the music: Elephant (White Stripes; present in Thunar) was added most recently but before that was Deep House (absent Thunar) and before that The National (present Thunar). No obvious pattern to the present/absent folders.

Any thoughts much appreciated.

Edit: versions of stuff: xubuntu 15.10 Thunar 1.6.10

dez93_2000
  • 1,201
  • 1
    What Ubuntu release? – xangua Feb 17 '16 at 21:16
  • 3
    Sounds likely to be a bug in libmtp. – dobey Feb 17 '16 at 21:33
  • apologies, versions added: xubuntu 15.10 Thunar 1.6.10 libmtp-runtime libmtp9 libmtp-common 1.1.9-3ubuntu1 – dez93_2000 Feb 18 '16 at 00:25
  • Trying to install libmtp 1.1.11 now but getting "libusb not found! (missing -dev/-devel package?)" even though I have libusb-1.0-0 2:1.0.19-1 installed. I'm worried about going further & installing 1.0.20 (latest) in case it makes things worse. – dez93_2000 Feb 18 '16 at 00:44
  • ugh. Down the linux rabbit hole. Tried installing libusb, hits "configure: error: "udev support requested but libudev not installed"". Software center shows libudev1 225-1ubuntu9 installed. – dez93_2000 Feb 18 '16 at 00:58
  • Support request left with libmtp team asking them whether they think it's likely that libmtp is to blame https://sourceforge.net/p/libmtp/support-requests/206/ – dez93_2000 Feb 18 '16 at 01:49
  • "libusb not found! (missing -dev/-devel package?)" Try sudo apt-get install libusb-1.0-0-dev – QwertyChouskie Mar 02 '16 at 20:44

1 Answers1

1

According to go-mtpfs

Go-mtpfs is a simple FUSE filesystem for mounting Android devices as a MTP device.

It will expose all storage areas of a device in the mount, and only reads file metadata as needed, making it mount quickly. It uses Android extensions to read/write partial data, so manipulating large files requires no extra space in /tmp.

It has been tested on various flagship devices (Galaxy Nexus, Xoom, Nexus 7). As of Jan. 2013, it uses a pure Go implementation of MTP, which is based on libusb.

install the Go compiler suite; e.g. on Ubuntu:

sudo apt-get install golang-go
Install libmtp header files
sudo apt-get install libusb1-devel

Then run

mkdir /tmp/go
export GOPATH=/tmp/go
go get github.com/hanwen/go-mtpfs

/tmp/go/bin/go-mtpfs will then contain the program binary.

You may need some tweaking to get libusb to compile. See the comment near the top of usb/usb.go, ie.

 # edit to suit libusb installation:
 vi /tmp/go/src/github.com/hanwen/go-mtpfs/usb/usb.go
 go install github.com/hanwen/go-mtpfs

A 32 and 64-bit linux x86 binaries are at

go-mtpfs

USAGE

mkdir /tmp/go
GOPATH=/tmp/go go get github.com/hanwen/go-mtpfs
sudo mv /tmp/go/bin/go-mtpfs /usr/bin/
mkdir ~/Android

to mount device:

go-mtpfs ~/Android
GAD3R
  • 3,507
  • Thanks. Some notes (not intended to be snarky, but for other users' ease): "Install libmtp header files" shouldn't be formatted as code. I think it should be "sudo apt-get install libusb-1.0-0-dev" as it's "Unable to locate package libusb1-devel". Having done this, I'm not having any luck getting it to work. Thanks for your answer, I'll have another try with it tomorrow. – dez93_2000 Mar 07 '16 at 00:55