My MTP device auto mounts on the desktop every time I boot or re connect the camera via usb. The problem is my code to copy files does not work unless the MTP device is first unmounted from the desktop.

How can I do this from the command line? I can retrieve both BUS and Device #'s.


I was asking the wrong question.

Instead of figuring out how to unmount the device, I needed to find out what process or daemon was claiming it.

I issued

ps aux | grep mtp

which gave me a few mtp related processes and compared with the camera mounted and unmounted to get the specific process

and then

pkill -9 gvfsd-mtp

does the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.