We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

Very large files fails to write over MTP

asked 2018-09-19 22:33:39 +0200

Kim gravatar image

updated 2018-09-20 09:42:14 +0200

Hi

While trying to transfer some maps for Monav from Linux to my sd card on Xperia X via MTP, I get an error "Could not write to file xxxxx".

This only happens on one file with a size of 8.2GB, otherwise I haven't tried with files larger than 1GB (without any problems), so I'm not sure exactly where the limit lays.

The MTP continues to work, only this one file fails.

The SD card is ext4 formatted, with about 50GB free, and after inserting the card into a card reader i could copy the file to the card.

Is this a limit in MTP or a problem with the sailfish implementation?

I'm using latest version of Sailfish.

edit retag flag offensive close delete

Comments

If your sdcard is formatted to fat32, then you are limited to files up to 4GB thereabouts.

Spam Hunter ( 2018-09-19 22:36:07 +0200 )edit

Yes, I should have mentioned:

My card is ext4 formatted, and after inserting the card into a card reader i could copy the file to the card.

Kim ( 2018-09-19 22:51:59 +0200 )edit

Okay, cool..... you can always edit your original question to reflect your comments, just so others know :)

Spam Hunter ( 2018-09-20 01:15:43 +0200 )edit

2 Answers

Sort by » oldest newest most voted
5

answered 2018-09-20 02:08:43 +0200

spiiroin gravatar image

PTP containers have 32 bit sizes -> There is about 4GB file size limit inherited by MTP.

There are ways around this, but buteo-mtp supports only up to 4GB files.

edit flag offensive delete publish link more

Comments

2

Any change to increase that limit?

Jk ( 2018-09-20 03:36:52 +0200 )edit
2

use ssh to transfer files to the sd instead of mtp

c.la ( 2018-09-20 12:40:07 +0200 )edit

@remote No idea about android, but there is well defined way to deal with it - sailfish / buteo-mtp just does not currently support it.

A mtp file transfer consists of two parts: 1) define file about to be sent 2) transfer the file content. Both of these are PTP transactions - which have maximum 4GB frame size. To transfer > 4GB files the arrangement is that both mtp initiator (=pc) and mtp responder (=phone) need to use transfer size defined in (1) and more or less ignore ptp frame size (2) supposedly has.

spiiroin ( 2020-04-06 07:08:02 +0200 )edit
1

answered 2018-09-20 17:03:00 +0200

DrYak gravatar image

As an alternative to using MTP, you could instead use the "Developper" USB-Mode of the device.

Then it shows up as a network device (the device has an address of 192.168.2.1, your PC gets some addresse in the same /24 range, e.g.: 192.168.2.13).

At that point you can use SSH to copy files.

On Microsoft Windows :

  • You can use FileZilla, which among other protocols, also supports SFTP.

    Simply select "SFTP" as the protocol, and give 192.168.2.1 as the server address

  • You can use WinSCP for a specialized SFTP/SCP tool.

  • You can use WSL (a.k.a.: Bash on windows) and the following commands

On Linux (and also WSL) :

  • Have a look at the SCP command for straight "copy over SSH".

    e.g.: scp -v Europe.osm.pbf 192.168.2.1:/run/media/nemo/SDCard/

  • Have a look at RSYNC (and install rsync on your smartphone), it also supports an "over SSH" mode, but comes with support for checksum, only copying the specific parts of files that have change, etc.

    e.g.: rsync -avP --inplace Europe.osm.pbf 192.168.2.1:/run/media/nemo/SDCard/

Security tips :

Have a look at what SSH Keys are. They are cryptographic key that you can use to log onto SSH, this will help you using something more secure than simple passwords.

On Windows, PuTTY can help you around with a GUI to set them up. FileZilla can talk to PuTTY's key agent to make this automatic.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2018-09-19 22:33:39 +0200

Seen: 1,848 times

Last updated: Sep 20 '18