Linux - HardwareThis 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.
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.
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.
"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.
got commands you can play with as you sort out your situation. should help.
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 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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.