Skip to content

Instantly share code, notes, and snippets.

@sandys
Created October 13, 2012 12:23
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandys/3884439 to your computer and use it in GitHub Desktop.
Save sandys/3884439 to your computer and use it in GitHub Desktop.
Mount the HTC One X on Linux (Ubuntu 12.04 Precise)
sudo apt-get install golang git mercurial
git clone https://github.com/hanwen/go-mtpfs.git
cd go-mtpfs
go build
sudo mv go-mtpfs /usr/local/sbin/go-mtpfs 
sudo chmod a+x /usr/local/sbin/go-mtpfs
sudo mkdir /media/mtp
sudo chmod 775 /media/mtp
sudo /usr/local/sbin/go-mtpfs -allow-other=true /media/mtp

gives the following output

2012/10/13 20:32:15 compiled against libmtp 1.1.3
Device 0 (VID=0bb4 and PID=0c93) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
2012/10/13 20:32:15 device unknown: unknown (0bb4:0c93) @ bus 2, dev 23
: 

PTP_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
2012/10/13 20:32:36 storage ID 65537: @string/storage_internal
2012/10/13 20:32:36 backing data /tmp/go-mtpfs405580921
2012/10/13 20:32:36 starting FUSE.

sudo apt-get install mtpfs mtp-tools libmtp-dev
sudo mkdir /media/phone
sudo chmod 775 /media/phone
sudo mtpfs -o allow_other /media/phone

run df-hl and when it returns, your phone should be ready

IMPORTANT: DO NOT DISCONNECT YOUR DEVICE WITHOUT UNMOUNTING IT FIRST!

sudo umount /media/phone

@shark0der
Copy link

"run df-hl and when it returns, your phone should be ready" - should there be a space between "df" and "-hl" ?

@bthery
Copy link

bthery commented Apr 8, 2013

Finally managed to mount my HTC One SV using mtpfs.
Thanks for the tips!

@davidyell
Copy link

If you are cloning using GIt, why do you need to install Mercurial as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment