Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi
Using libmtp and mtp-tools in Ubuntu-mate to copy files from an MTP device(camera) over usb.
I can copy files but when I try and delete using the following command
Code:
sudo mtp-delfile -n <File ID>
I get the following error
Quote:
> Failed to delete file:3 Error 2: PTP Layer error 200e:
> LIBMTP_Delete_Object(): could not delete object. Error 2: Error 200e:
> PTP: Store Read Only
where filename is the name and path of the file to delete.
Nota bene: Be very careful when using the command rm with the -rf option since -r makes the file removal recursive (meaning it will remove files inside of folders) and -f will force the removal even for files which aren't writable. To play it safe, please consider typing in the absolute path to the file
sudo rm -rf /path/to/file/filename
to prevent any mishaps that can/will occur. It takes longer to type but you can't put a price on peace of mind. See the rm man page for details.
Hi
Using libmtp and mtp-tools in Ubuntu-mate to copy files from an MTP device(camera) over usb.
I can copy files but when I try and delete using the following command
Code:
sudo mtp-delfile -n <File ID>
I get the following error
as you are using that software you got running commands, if the prior post does not work using rm -rf
as your error message states,
Quote:
> Failed to delete file:3 Error 2: PTP Layer error 200e:
> LIBMTP_Delete_Object(): could not delete object. Error 2: Error 200e:
> PTP: Store Read Only
that your files are stored read only on your camera. you also might want to go through your camera setting and delete the files through there if it provides that option.
If it has a removable medium that you are not removing so you can use that setup you did to get this to work, then remove it, plug it in your system and try the post above mine method rm -rfv (the v is to give you feedback to have it tell you what it did for visual verification)
thanks, will try the suggested but my first thought is that the rm command will only work with mass storage devices, not MTP or PTP devices, and that I have to use some command specific to libmtp
thanks, will try the suggested but my first thought is that the rm command will only work with mass storage devices, not MTP or PTP devices, and that I have to use some command specific to libmtp
That is why I stated what I did. process it is a process. If one thing does not work, then try a different way.
Seeing that you are using a Camera -- does not the storage unit within that device have a removable medium? ie SD CARD.
Another thing you have to look at is permissions and how it is used within the software you are using to perform your task.
Problem Solving 101:
As you seen the error message told you it is a "read only" file.
What knowledge should you have gained from that message?
What does read only mean?
What permission is missing from the file types that allow you to remove it?
what command can you use to override that issue?
What user type in Linux possesses the ability to override permissions of a file?
Did you check to see if you have the ability to change the permissions on the medium that you are working with before getting started?
Did you check to see if you have the ability to change the permissions on the files on the medium that you are working with before getting started?
Did you check to see if that user type that has the ability to destroy everything on the System you are using also has the same ability with the commands within the software you are using?
The exact same command works with an LGE360 camera.
rm and cp commands cannot be used with MTP devices AFAIK. hence my use of libmtp, mtp-tools
I can only assume this has something to do with the way the SamsungGear360 implements the MTP protocol.
The actual photos, videos are not 'locked' and can be removed manually via the menu on the camera.
But this must be done from the command line.
Stop assuming and go find out. Dig into your device specs in how to deal with it and getting your images off it, or whatever you are doing with them. That would mean going and talking to the source, and not the third party (ie LQ) first.
LQ is not SamsungGear360 Questions.
One should not expect everyone to know everything about the devices you are dealing with and how to do everything with them but you. That is a backward thought.
I only say that because it is no longer a Linux or its software it uses issue, but your device issue.
using these key words in a search would be a good start samsung gear 360 and MTP
You can use rm and cp commands if you mount the device to the file system.
You said that you have simple-mtpfs working. Did you try to mount that camera to an empty directory? Or did you just ignore the advice you asked for? It will allow you to access that device just like any other directory of files. User will need to have permissions to the directory and files.
Example:
Code:
mount | tail -3
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=192324k,mode=700,uid=1000,gid=100)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
Code:
ls ~/usb
(nothing here)
Plug in a android phone...
Code:
simple-mtpfs ~/usb
Code:
ls ~/usb
Alarms Download Movies Pictures Ringtones obb
Android 'FM Recording' Music Podcasts SMSBackupRestore otaLogs
DCIM Bookmarks.html Notifications Recording ServeStream
Code:
mount | tail -n3
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
simple-mtpfs on /home/me/usb type fuse.simple-mtpfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
do what you want with the files...
Code:
fusermount -u ~/usb
unplug android phone...
Code:
ls ~/usb
(nothing here again)
Code:
mount | tail -n3
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=192324k,mode=700,uid=1000,gid=100)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
So what happens when you mount that camera's file system with simple-mtpfs? What permissions do the files mount with? Does your user have permissions to those files?
libmtp has been buggy for a while. That why I suggested simple-mtpfs.
Thanks I'm giving simple-mtpfs another try. A bit of a challenge for me getting it compiled properly.
I'm stumbling a bit with the actual syntax. Could you give a few examples of simply copying and deleting a file?
Quote:
Due to MTP nature, it is necessary to use a folder, where the temporary files downloaded will be downloaded. The project can be configured to use custom directory for such files. To configure the simple-mtpfs to use desired temporary directory, add --with-tmpdir=TMPDIR option to configure script. Default value for temporary directory is /tmp.
Look at the output of mount and see if it's mounted read only.
Look if user has permissions to delete files in folder.
When I mount a droid device here, everything is as user.
Code:
simple-mtpfs ~/usb
Code:
ls -l ~/usb
total 40
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Alarms
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Android
drwxrwxr-x 2 teckk users 0 Dec 31 1969 DCIM
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Download
drwxrwxr-x 2 teckk users 0 Dec 31 1969 'FM Recording'
-rw-r--r-- 1 teckk users 40897 Sep 27 12:34 Bookmarks.html
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Movies
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Music
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Notifications
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Pictures
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Podcasts
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Recording
drwxrwxr-x 2 teckk users 0 Dec 31 1969 Ringtones
drwxrwxr-x 2 teckk users 0 Dec 31 1969 SMSBackupRestore
drwxrwxr-x 2 teckk users 0 Dec 31 1969 ServeStream
drwxrwxr-x 2 teckk users 0 Dec 31 1969 obb
drwxrwxr-x 2 teckk users 0 Dec 31 1969 otaLogs
You should be able to do what you want with it.
What is the output of:
Code:
mount | tail -n3
with the device mounted? Is it rw like in post 8? If not start there.
Thanks again. Attempting install of simple-mtpfs on a 2nd machine I see that running ../configure can be finicky, doesn't always complete properly and I have to try several times before it completes properly. Will try all your suggestions.
Thanks again. Attempting install of simple-mtpfs on a 2nd machine. I believe I've installed all necessary dependencies as listed at the end of this post.
However I am getting an error at sudo make
In my working folder I DO see makefile.am and makefile,in
Does this error mean my configure was not run correctly? I see no errors when configure is run however I DO see 1 syntax error
>
Code:
//download and extract zip
https://github.com/phatina/simple-mtpfs
//need libmtp
$ sudo apt-get install libmtp-dev
//need to install C compiler
$ sudo apt-get install build-essential
$ sudo apt-get update
//need to install latest fuse
$ sudo apt-get install libfuse-dev
//need to install autoconf
$ sudo apt install autoconf
$ sudo autoreconf -i
$ mkdir build && cd build
$ ../configure
$ sudo make
$ sudo make install
Building from source. if you see a configure file then that is what you run. If you see a makefile without a configure but a configure.ac file, run autoconf to get a configure file to run.
read the README file first if you have no idea how they set it up to compile. or the INSTALL file even.
basic tools needed to compile, are a C and or C++ compiler, make, automake, autoconf, gettext (it comes in handy for some look for it). build-essential usually covers most of it on Debian and its knock offs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.