Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th December 2012, 03:47 PM
troyengel Offline
Registered User
 
Join Date: Dec 2009
Posts: 14
linuxfirefox
Mounting Nexus 4 via MTP in Fedora 17

Shiny new toy! I wrote a quick howto blog post for getting something working until a better solution comes along.

Link to blog edited out as per sub-forum rules --- DBelton

======================
...

First, install libmtp and simple-mtpfs. There are other projects like mtpfs (seems unmaintained) and go-mtpfs (uses some oddball compiler) so I stuck with simple-mtpfs because it’s already in the Fedora repos and seems to work.

Code:
$ sudo yum -y install fuse fuse-libs libmtp simple-mtpfs
NOTE: you probably already have fuse/fuse-libs and gvfs-fuse installed. Googling around I see there’s work on a MTP interface to GVFS but it’s not ready yet.

Next, write some quick udev rules to see your Nexus 4 — as of this writing (libmtp-1.1.5-1.fc17) they’re not in the stock /usr/lib/udev/rules.d/69-libmtp.rules file. I’m sure this will get updated, so we’ll put them in our own file and not edit the stock one. Create /etc/udev/rules.d/99-nexus4.rules with:

Code:
ACTION!="add", GOTO="nexus4_rules_end"
ENV{MAJOR}!="?*", GOTO="nexus4_rules_end"
SUBSYSTEM=="usb", GOTO="nexus4_usb_rules"
GOTO="nexus4_rules_end"

LABEL="nexus4_usb_rules"

# LGE Nexus 4/10 MTP
ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee1", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

# LGE Nexus 4/10 MTP+ADB
ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

LABEL="nexus4_rules_end"
Last, make your life a bit easier and add two aliases to mount/unmount your device. Make a directory (I used ~/Misc/Nexus4) and add something like the below to your ~/.bashrc file:

Code:
alias n4mount="simple-mtpfs ~/Misc/Nexus4"
alias n4umount="fusermount -u ~/Misc/Nexus4"
At this point you can either reboot (admit it, you needed to apply that new kernel update anyways) or reload your udev rules and log out/log in:

Code:
$ sudo udevadm control --reload-rules
You’re ready to rock & roll – I seem to be having a spurious problem where the first time I run the mounting alias it “doesn’t work” but the second time I run it it works fine, so “n4mount;n4umount;n4mount” and then my device shows up. Your mileage may vary here – when you plug in your Nexus 4 there should be a new device symlink being created that something like:

Code:
$ ls -l /dev/libmtp*
lrwxrwxrwx   1 root root   15 Dec  8 08:41 libmtp-2-1.1 -> bus/usb/002/007
If you’re not seeing that after plugging in your device, something’s not right – go back and check your rules and such again. Using the above I’ve been able to copy over all my backups, MP3s, etc. to the device seemingly without any errors or causing any device harm.
__________________
tactical vim

Last edited by troyengel; 26th January 2013 at 02:17 PM. Reason: add MTP+ADB
Reply With Quote
  #2  
Old 8th December 2012, 06:48 PM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

As per the sub-forum rules, there are no links to blogs allowed in guides posted in here.

Since your post pretty much has all of the information contained in the blog post, I simply removed the link in your post above. Please look over your post above and make sure that it does indeed contain everything needed, though.

This is a nice guide, and thanks for posting it here. There have been several people interested in using a nexus with their Fedora machine.
Reply With Quote
  #3  
Old 8th December 2012, 06:58 PM
troyengel Offline
Registered User
 
Join Date: Dec 2009
Posts: 14
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

ahh, gotcha - I visit all of a few times a year and maybe post some Howto and nobody has brought this up before, didn't know about the link rule. Yes, I on purpose replicated the content here to protect against disappearing links. I get a bunch of referrals from this forum for my "Installing Fonts" (2010) and "Disable Pulseaudio" (2009) Howtos in this forum...
__________________
tactical vim
Reply With Quote
  #4  
Old 8th December 2012, 07:40 PM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
Re: Mounting Nexus 4 via MTP in Fedora 17

I was looking around on your blog and it has some pretty useful information on it.

It is just in this sub-forum (Guides & Soultions) that has the no link to blogs rule in it, and one of the main reasons is the one you stated above. If you have been copying all of the information over anyway, that's probably why it's never been noticed or anyone said anything about it.

Anyone interested in checking out the blog, the link is in his signature
Reply With Quote
  #5  
Old 12th January 2013, 04:51 AM
ozjd Offline
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 59
Posts: 2,372
linuxchrome
Re: Mounting Nexus 4 via MTP in Fedora 17

Thanks for this guide. I used it to access my HTC One X which since the update to Jelly bean is using MTP.

Only extra step apart from using the correct Vendor and Product ids (0bb4 & 0dfb) was that I found the device had to be unlocked for it to mount correctly. It still shows the device as unknown but I can access the data.
Reply With Quote
  #6  
Old 12th January 2013, 05:04 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,524
linuxchrome
Re: Mounting Nexus 4 via MTP in Fedora 17

My own experience, with the Galaxy SIII has been a bit easier. Just installed simple-mtpfs and was then able to mount it with simple-mtpfs /mnt

Note that I was doing it for short periods, mostly to transfer a few pdfs from work (I converted them to epub and used the Nook app), and some silly sound bites for ring tones.

I have not found the unlocked locked thing to be consistent--that is, sometimes it doesn't work when locked, other times it has.

I didn't have to make udev rules. I've also found, on ArchLinx, that jmtpfs also works quite well.
Reply With Quote
  #7  
Old 12th January 2013, 02:02 PM
troyengel Offline
Registered User
 
Join Date: Dec 2009
Posts: 14
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

The Samsung Galaxy models have their vendor/product IDs listed in /lib/udev/rules.d/69-libmtp.rules with the shipping version if libmtp, which is why you're having a smoother time. I'd hazard a guess that they are the same for S2/S3 so have been around for awhile? Eventually a new version of libmtp will ship that has an updated udev ruleset for the N4, HTC One series, etc.
__________________
tactical vim
Reply With Quote
  #8  
Old 12th January 2013, 04:17 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,524
linuxchrome
Re: Mounting Nexus 4 via MTP in Fedora 17

Interesting--thank you for the explanation, which I suspect will help others in the future.
Reply With Quote
  #9  
Old 12th January 2013, 05:00 PM
Jon Baron Offline
Registered User
 
Join Date: Apr 2005
Posts: 15
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

I was able to mount a Nexus 10 through the usb connector. Just plug it and say
simple-mtpfs mountpoint
You need to install simple-mtpfs from the rpm of that name, and mountpoint
should be an empty directory. At the end, as usual, say
fusermount -u mountpoint.

I got an error message, but I ignored it. This works as it should. I can then copy files into the Download directory, and access them with the Astro file manager app.

This might be useful for other Android devices, so I am commenting here, even though this is about Nexus 4, not 10.
Reply With Quote
  #10  
Old 13th January 2013, 12:09 AM
ozjd Offline
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 59
Posts: 2,372
linuxchrome
Re: Mounting Nexus 4 via MTP in Fedora 17

The HTC One X has been added to the latest version according to http://sourceforge.net/p/libmtp/bugs/663/ I guess others have too and we'll see it as an update a some stage.
Reply With Quote
  #11  
Old 23rd January 2013, 02:41 AM
Mikko Offline
Registered User
 
Join Date: Nov 2008
Location: Finland
Posts: 162
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

I have a Sony Xperia Tipo running CyanogenMod 10 (Android 4.1.2). simple-mtpfs does mount the device, but I can't get any data to move. Any and all disk operations just hang for a long while and then do nothing. I have

kernel-3.7.2-204.fc18.x86_64
simple-mtpfs-0.1-4.fc18.x86_64

at the Fedora end of the cable.
Reply With Quote
  #12  
Old 23rd January 2013, 03:56 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,524
linuxchrome
Re: Mounting Nexus 4 via MTP in Fedora 17

One thing that I'm finding pretty consistently is that the phone should be unlocked at time of connection. Other than that, no real help, I'm afraid. You might try the jmptfs, but of course, it might turn out to be a complete waste of your time.
Reply With Quote
  #13  
Old 24th January 2013, 01:01 AM
Mikko Offline
Registered User
 
Join Date: Nov 2008
Location: Finland
Posts: 162
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

I needed to put some MP3s on my phone and ended up trying all kinds of things. I don't have a home wireless network up, temporarily also don't have access to my Dropbox, Google Drive was taking indefinitely to sync anything, etc. etc. Eventually I zipped the files and pushed them onto the phone over Bluetooth. Took forever for 55 MB, but they got there. Then it turns out that clicking on the zip file in my file manager on Android doesn't do anything. No unzip, apparently. CyanogenMod comes with a terminal emulator installed by default. Turns out command-line unzip is there and worked on my zip archive as advertised. I was actually a bit pleased with myself.

Last edited by Mikko; 24th January 2013 at 01:08 AM.
Reply With Quote
  #14  
Old 26th January 2013, 02:25 PM
troyengel Offline
Registered User
 
Join Date: Dec 2009
Posts: 14
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

Small update - I updated the original post to add MTP+ADB idProduct and list the comments as 4/10 compatible. I was browsing the libmtp source and see that on 2012-12-26 they added these into the source, so in theory the next packaged release will obsolete the need for adding custom udev rules.

I still get janky problems trying to rsync data off sometimes - like this morning I get:

Code:
$ bkpn4.sh 
sending incremental file list
...
TunnyBrowser/cache/speeddial_covers/
file has vanished: "/home/tengel/Misc/Nexus4/TunnyBrowser/cache/speeddial_covers/00cdf31b.cache"
file has vanished: "/home/tengel/Misc/Nexus4/TunnyBrowser/cache/speeddial_covers/30d27251.cache"
file has vanished: "/home/tengel/Misc/Nexus4/TunnyBrowser/cache/speeddial_covers/68a98b16.cache"
file has vanished: "/home/tengel/Misc/Nexus4/TunnyBrowser/cache/speeddial_covers/8d080e2e.cache"
file has vanished: "/home/tengel/Misc/Nexus4/TunnyBrowser/cache/speeddial_covers/a12f52c5.cache"
...
rsync warning: some files vanished before they could be transferred (code 24) at main.c(1052) [sender=3.0.9]
It's seemingly random where I get these "file has vanished" errors - sometimes on pictures, sometimes on cache files. If I remount the device a few times or reboot it they might start working. One time these errors led to *something* going wrong on the device and a picture disappeared from my DCIM/Camera folder - *poof* gone. I use FolderSync and my free 50GB box.net to try and keep backups because of these results.

I do not yet trust mtpfs in Linux, I think it's very unstable - I seriously lament the loss of USB Mass Storage, it's a real kick in the pants to have to deal with this crappy MTP support.
__________________
tactical vim
Reply With Quote
  #15  
Old 27th January 2013, 05:28 PM
Mikko Offline
Registered User
 
Join Date: Nov 2008
Location: Finland
Posts: 162
linuxfirefox
Re: Mounting Nexus 4 via MTP in Fedora 17

gnomad2 appears to work with my CM10 (Android 4.1.2) phone well enough. It has a graphical UI for transferring files. I can't actually tell if it mounts the phone in some way that can be accessed from the command line.
Reply With Quote
Reply

Tags
fedora, mount, mounting, mtp, nexus, udev

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automount Nexus 7 in Nautilus Creak Using Fedora 2 22nd November 2012 06:01 PM
Can't mount Nexus BocasThunder Using Fedora 2 28th October 2012 03:15 PM
Nexus Personal mini guide nickeh Guides & Solutions (No Questions) 13 17th June 2011 01:22 AM
Hauppauge Nexus recnelis Hardware & Laptops 0 2nd October 2004 12:26 PM
DVD-S Nexus don't work on fedora core 2 petitlion Hardware & Laptops 0 30th June 2004 03:55 AM


Current GMT-time: 19:57 (Tuesday, 21-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Uberaba Travel Photos on Instagram - Tongzhou - Logansport Travel Photos on Instagram