Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-04-2019, 05:22 PM
|
#1
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Rep: 
|
howto mount android MTP as /media/...
Can someone offer a recipe so that my Android devices 'mount' at /media instead of (or in addition to) /run/user/... /mtp:host=...
2nd (related) question
Every time I connect my device, (usb cable) I get different 'mtp:host=' details. Is there some way to control, manage, or manipulate this?
I'd use predictable details, detect connection, then create a link into /media.
|
|
|
05-04-2019, 07:18 PM
|
#2
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
arch wiki
https://wiki.archlinux.org/index.php...nsfer_Protocol
got commands you can play with as you sort out your situation. should help/
|
|
1 members found this post helpful.
|
05-04-2019, 08:38 PM
|
#3
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
Re: your signature statments/quotes:
"A government big enough to give you everything you want,
is strong enough to take everything you have."
-- Thomas Jefferson
3rd President, Jan 20, 1777 to Jan 20, 1781
Thanks, again, for the reply to my [b]mtp:host=???" post.
Soldier on,
~~~ 0;-Dan
|
|
|
05-04-2019, 08:52 PM
|
#4
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
Quote:
Originally Posted by BW-userx
|
As I read the contents of the page(s) you referenced, it appears that they tell me how to get MTP
support if I don't have it already.
I'm running Linux Mint 19.1 Cinnamon Desktop. Out of the box my Android tablet and phone connected using the MTP protocol giving me:
Code:
prompt$ sudo ls /run/user/{someUID}/gvfs/mtp:host=*
/run/user/{someUID}/gvfs/mtp:host=%5Busb%3A001%2C014%5D/
where the host=gibberish corresponds to the details reported using lsusb for my connected device.
What I want is the magic words so that I might have access to something like:
Code:
prompt$ ls -FC /media/{username}/*
..... myDevice/ .....
I'm fine if the entry in /media is some sort of link over to the entry in /run/user.
I simply don't want to hunt down my Android device every time that I tether it via USB.
Thanks in advance,
~~~ 0;-Dan
|
|
|
05-04-2019, 08:58 PM
|
#5
|
LQ Veteran
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,301
|
Don't know for sure if this will help in Linux Mint or not.
https://unix.stackexchange.com/quest...ther-than-medi
Being as you might be dealing with udev rules that may be included with mtp mount.
Edit: I use
Code:
cp <file> <file.bk>
so any changes I make. I have a original fallback.
My search term : link
Last edited by rokytnji; 05-04-2019 at 09:06 PM.
|
|
1 members found this post helpful.
|
05-06-2019, 01:16 PM
|
#6
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
Quote:
Originally Posted by rokytnji
|
Thanks for this link. It sheds some light into the dark maze of device creation and mounting.
I'll continue to seek more light, 'cuz I'm really in the dark about this issue.
Quote:
Originally Posted by rokytnji
Being as you might be dealing with udev rules that may be included with mtp mount.
Edit: I use
Code:
cp <file> <file.bk>
so any changes I make. I have a original fallback.
|
Could not agree more. However, *.bk is often the result of various editors acting on a file.
In addition it might hide the original file type details. I've adopted the style
{filename}.{filetype}-ORIGINAL
This preserves the original name and tells me that it is a copy at some starting point.
I also use
{filename}.{filetype}-DISTRO
to indicate that the file is as delivered with the distribution or from a package repository.
If there are some set of config files or similar that I'm going to tinker with often,
I'll create a CVS {because I know this) or Subversion(so I can learn this) environment
to manage the changes and enable roll-back.
Quote:
Originally Posted by rokytnji
|
Thanks for this second reference.
~~~ 0;-Dan
Last edited by SaintDanBert; 05-06-2019 at 01:21 PM.
Reason: added content
|
|
|
05-08-2019, 11:38 PM
|
#7
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by SaintDanBert
I'm fine if the entry in /media is some sort of link over to the entry in /run/user.
I simply don't want to hunt down my Android device every time that I tether it via USB.
|
in any case, I'd let the mechanism in place just do its thing.
then,
question:
is it always mounted to the same location, or does the name of the folder differ?
if the former:
simply create a symlink to that location in a location that you're comfortable with.
if the latter:
assuming a udev rule, i believe they can be expanded (consist of more than 1 line). so after the mechanism did its thing, add a line that a) deletes any old symlinks, then b) creates a new one in a location that you're comfortable with.
http://hackaday.com/2009/09/18/how-to-write-udev-rules/
|
|
1 members found this post helpful.
|
05-12-2019, 09:34 AM
|
#8
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,519
|
My 2 cents.
Quote:
Can someone offer a recipe so that my Android devices 'mount' at /media instead
|
simple-mtpfs is the best thing I've found for mtp devices.
https://github.com/phatina/simple-mt...s-0.3.0.tar.gz
https://github.com/phatina/simple-mtpfs/
If it's not in your repo.
Then make a little script that mounts it where you want it every time. Example:
Code:
#! /usr/bin/env bash
#Script for simple-mtpfs
PS3=$'\nSelect an option.: '
#mount directory
dir="/media/myphone"
while :; do
clear
options=('Quit' 'List Devices' 'Mount' 'Umount')
select opt in "${options[@]}"; do
case "$opt" in
Quit) clear; exit
;;
'List Devices') simple-mtpfs -l
;;
Mount) simple-mtpfs "$dir"; echo "Mounted to "$dir""
;;
Umount) fusermount -u "$dir"; echo "Unmounted"
;;
esac
done
done
Plug it in, mount it, do something, unmount it. On Android devices past around 5 or so, you'll need to give permission in the little pop up window on the device when you try to mount it.
Otherwise mtp devices are obnoxious.
Edit: Formatting was off somehow.
Last edited by teckk; 05-12-2019 at 09:41 AM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 04:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|