simple-mtpfs - unable to delete files [permissions issue]
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.
Although a fuse filesystem does "treat" your Android device like a mass storage device it is only a bridge and simple-mftpfs still uses libmtp as an interface. If gphoto2 or mtp-tools does not work then as you have posted in your other thread that it could be some protocol incompatibility. Gnome and KDE have their own mtp virtual file systems and I think you have already tried those with similar results.
It could be that libmtp does not like your Android device.
Hi
Yes, of course my phone and cameras automount as MTP devices whenever conncted via USB.
When you say you are 'able to copy,move files onto it, and copy,move,delete files off ', I assume you mean manually, not scripted in the terminal?
I need an automated solution via shell scripting. The problem with MTP mounted devices as I have noted elsewhere, is that the mount point is constantly changing making it near impossible to use standard cd, rm etc commands to navigate to your photos.
So I've tried both gphoto2 and mtp-tools which both use libmtp AFAIK to access MTP-PTP devices.
With these MTP solutions I am able to list, copy files, but not to delete them.
So now I am resorting to simple-mtpfs, which seems the most robust solution. However still need a way to delete files via scripting.
Isn't it possibly a simple-mtpfs configuration issue?
What would be the proper syntax to enable permission checking by kernel?
Hi
Yes, of course my phone and cameras automount as MTP devices whenever conncted via USB.
When you say you are 'able to copy,move files onto it, and copy,move,delete files off ', I assume you mean manually, not scripted in the terminal?
I need an automated solution via shell scripting. The problem with MTP mounted devices as I have noted elsewhere, is that the mount point is constantly changing making it near impossible to use standard cd, rm etc commands to navigate to your photos.
So I've tried both gphoto2 and mtp-tools which both use libmtp AFAIK to access MTP-PTP devices.
With these MTP solutions I am able to list, copy files, but not to delete them.
So now I am resorting to simple-mtpfs, which seems the most robust solution. However still need a way to delete files via scripting.
post your script you are using in code block so I can see exactly what you are doing.
let me install some of this 'crap' and see what I can figure out for you.
userx@voider~:>> simple-mtpfs ~/mpts
userx@voider~:>> cd mpts
userx@voider~/mpts:>> ls
'Internal storage' 'SD card'
userx@voider~/mpts:>> cd 'SD card'
userx@voider~/mpts/SD card:>> ls
Android LOST.DIR movies mpon
userx@voider~/mpts/SD card:>> cd movies
userx@voider~/mpts/SD card/movies:>> ls
Goldrush.mp4 paranoid-2000-jessica-alba.mp4
userx@voider~/mpts/SD card/movies:>> rm Goldrush.mp4
userx@voider~/mpts/SD card/movies:>> ls
paranoid-2000-jessica-alba.mp4
I had no problem deleting a file using simple-mtpfs in my terminal. My first time I've ever done this.
Please post your entire script so I can take a look at it for you and anyone else that might catch something within it.
It is automounting via the desktop using gvfs if I remember from your other thread. Just out of curiosity can you delete files from your file browser?
As stated above simple-mtpfs also uses libmtp which is why you can not delete files using it either. android-file-transfer is not dependent upon libmtp so it might fair better. I have not used it so do not know how well it works.
In the ArchWiki link I posted there is information on how to use gvfs-mount to detect mtp devices. Have you tried using that to find your device. May not be the best long term solution due to updates or switching desktops could change how it works.
BW-userx, what is the make/model of your camera and is it on the list of known working devices?
I have 90% of a solution but will do further testing
Looking at the various FUSE options I see that there is allow_root
I also discovered that FUSE options are set when you mount the device
ie
Code:
$ simple-mtpfs ~/camera -o allow_root
However, i at first got an error with the above and first had to edit my /etc/fuse.conf and uncomment 'user_allow_other'
So then
Code:
$ simple-mtpfs ~/camera -o allow_root
$ ##chmod not necessary, we are already accessing camera as root
$ sudo rm -rf ~/camera/DCIM/Camera/*(no permissions error yeah!)
To confirm unmounted, remounted and checked mounted Camera directory. All photos gone!
This seems to work, the last remaining hurdle is that original photos on the actual camera are NOT deleted even though they seem to be when I remount the camera.
Back to square one. I assume this must be because FUSE works with a copy of the actual camera directories.
BW-userx, what is the make/model of your camera and is it on the list of known working devices?
I have no idea about that known working devices,I do not have a camera, he too said he was using a phone as well as a camera. I've never mounted my phone manually ever. That was the first time ever and it would have been the same mythology but he got it working. Finally.
needing root user type as I stated prior or in another post of his on this situation. gooo root!
something for the back burner:
if you ever get a device is busy and it will not unmount using fusermount -u
When mounting with jmtpfs vs simple-mtpfs there is an extra directory present"Internal storage" which seems to reflect what actually exists on my device
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.