LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2016, 03:41 PM   #1
eco_bach
Member
 
Registered: Dec 2016
Posts: 242

Rep: Reputation: Disabled
cd to MTP device in bash shell?


Hi
Have successfully mounted an MTP device on the desktop in Ubuntu and have figured out where the mount point is.

But when I navigate to where the device is mounted in the BASH shell what I see is something similar to


Code:
mtp:host=%5Busb%sldfnsdlfnsddasfdad%5D
Is there any way to navigate to this device(a camera)?

My goal is to copy media from the camera to the desktop using BASH commands.
 
Old 12-07-2016, 04:12 PM   #2
BW-userx
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

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
https://en.wikipedia.org/wiki/Media_Transfer_Protocol
Whereas PTP was designed for downloading photographs from digital cameras,

1>
http://www.linuxquestions.org/questi...sh-4175594970/

2>
https://www.linuxquestions.org/quest...tu-4175594971/

this is your 3rd post pertaining to the same issue ... stop jumping around.
 
Old 12-07-2016, 05:16 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
my bad. Sorry.
 
1 members found this post helpful.
Old 12-08-2016, 10:10 AM   #4
eco_bach
Member
 
Registered: Dec 2016
Posts: 242

Original Poster
Rep: Reputation: Disabled
yes. read the wiki quite a while ago.
Unfortunately doesn't answer my question
 
Old 12-08-2016, 10:32 AM   #5
BW-userx
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

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by eco_bach View Post
yes. read the wiki quite a while ago.
Unfortunately doesn't answer my question
well if ptp is for camera why you trying mpt?

did you try blkid after you hooked up your camera to see if it shows an address to it also?

try looking in /run or wherever that software you installed mounts the camera? see if you can find a directory you know was not there before you did this?


did you try this even?
Code:
sudo find / -iname mpt*
by what means did you mount it mpt? a 3rd party install or with whatever Ubuntututu had it in already?

and I do not have a camera to try this and that is all I can come up with at this moment. without more information.

Last edited by BW-userx; 12-08-2016 at 10:36 AM.
 
Old 12-08-2016, 10:45 AM   #6
BW-userx
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

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if you did this off your other post, that you should have kept all in one post to deal with this same problem.



http://www.linuxquestions.org/questi...tu-4175594971/

it says in here you may have used libmtp9

this is the documentation on it. go through it and I hope you get it up and running. it looks like file manager should work, but look towards the bottom about mounting it and adding ...

well here is the link

https://sourceforge.net/p/libmtp/cod...AD/tree/README


Quote:
Here is what some people do:

1. Plug in the device.
2. USB-mass storage folder will open automatically.
3. Unmount the device.
4. Run mtp-detect. It will most likely fail the first time.
5. Run mtp-detect again, it might work this time, or fail. Keep running
till it works. 99% it works by the third try.
6. Once mtp-detect gives you an "Ok", open either Rhythmbox or Gnomad2,
everything should work.

Linux: Try this, if you have a recent Linux kernel,
add the file (as root):

/etc/modprobe.d/no-usb-storage.conf
I am not saying that is what you need to do. only that it is within that README for libmtp9
 
Old 12-08-2016, 12:31 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,692

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
I assume that nautilus or other file browser is "mounting" the camera using its gvfs-mtp virtual filesystem. Although it appears that you can access the device via its mount point I don't think it is possible to use it in the CLI. There are similar fuse filesystem types i.e. fusemtpfs and go-mtpfs where you can "mount" the camera via the CLI however, I would try using gphoto2 first.

http://wiki.linuxquestions.org/wiki/Gphoto2
 
Old 12-08-2016, 01:27 PM   #8
eco_bach
Member
 
Registered: Dec 2016
Posts: 242

Original Poster
Rep: Reputation: Disabled
OP
Ok, thanks for the feedback. Not a simple problem for a novice like me. Further digging have the solution and wanted to share so others may benefit!

I needed 3 additional packages not already installed
sudo apt-get install libmtp-dev mtp-tools mtpfs

mtp-detect then displays a LOT of info about the MTP device

Then ran mtp-connect followed by mtp-folders to display folders with their ID

mtp-files displays files/folders with their ID

Then use mtp-getfile to copy files by their ID

My one remaining issue is how to reset the file ID since every time I delete the file the ID seems to increment by 1. I need the file ID to remain consistent

Last edited by eco_bach; 12-08-2016 at 02:39 PM.
 
  


Reply

Tags
bash, copy, mtp, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying file from MTP Device over USB using libmtp (& BASH) eco_bach Linux - Software 1 12-07-2016 08:05 AM
USB was not an MTP device errorpa OHNOOO Linux - Hardware 1 04-19-2016 05:57 AM
[SOLVED] USB is not a MTP device the_bigbalu Linux - Desktop 1 05-28-2013 02:55 AM
Automounting an mtp device amishtechie Linux - Hardware 0 04-09-2009 05:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration