Page 1 of 1

Copying files to an MTP device in the terminal

Posted: Fri May 31, 2019 3:03 pm
by iain_33
I've just connected my Android phone to my laptop to copy some new music across. I can copy/paste folders through Caja, but I figured it would be simpler in the terminal with rsync (I don't have a music player / syncer set up on Mint, I don't play music from my laptop).

Straight away I ran into a problem - where's it mounted? It only connects as an MTP device, it doesn't have a mass storage mode. Caja's address bar showed mtp://%5Busb%3A002,004%5D/Card/Music. With a bit of googling, I found I could access it through the terminal at /run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C004%5D/Card/Music.

I can read files from the SD card, but can't copy anything to it - I get cp: cannot create regular file '........': operation not supported. I tried touch foo to create a file but got the same error - touch: cannot touch 'foo': Operation not supported. Thinking it was permissions, I tried it with sudo, then got touch: cannot touch 'foo': Permission denied.

As I said, copying & pasting folders in Caja works fine, surely it can be done somehow in the terminal?

Re: Copying files to an MTP device in the terminal

Posted: Fri May 31, 2019 4:58 pm
by Lord Boltar
Since it is and Android make sure you have the following files installed - open your Synaptic Package Manager and search for

go-mtpfs and jmtpfs if it is not installed install them

Now plug in your Android device using USB cable

From the Drop down menu on your Android device select "Conneted to USB in Charging Mode" then select "File Transfer" now you can transfer your files

hope this helps

Re: Copying files to an MTP device in the terminal

Posted: Sat Jun 01, 2019 7:46 am
by iain_33
Hi Lord Boltar, thanks for your reply.

I've installed go-mtpfs and jmtpfs, rebooted, connected my phone and made sure it's on file transfer mode, but it's still the same as before - operation not supported / permission denied.