USB file transfer question
#1
Thanks to the 5.9 kernel I'm once again able to see my phone (UBPorts CE with the upgraded main board) when I plug it into a computer, which is great. But when I try to transfer files from the computer to the phone I can't open them on the phone (I get various errors, depending on the file type).

At first I thought the files were being corrupted somehow by the transfer, but I just realized that's not the problem. The files are being transferred over with root ownership and permissions, instead of mobian. I know I can go in afterwards with chown to change the ownership to mobian, and then the files can be opened on the phone, but it would be nicer if they could just transfer over with mobian ownership from the start.

Does anyone know how I can transfer files to the phone with mobian ownership already set up?

Thanks!
#2
How are you trying to transfer them? I have beeen successful with SSH and USB-MTP
#3
A possible solution would be to set your username on mobian to the same as on your computer.
I haven't tried that so I do not know what you would have to do so that phosh is ok with it.
A workaround would be to make a "mobian" user on your workstation and change the owner on your workstation.

The most clean way would possibly be to let the Bluetooth or USB file sharing daemon do that.
Unluckily I am not involved enough to know how to do that.

Sorry if that isn't helpful.

Another workaround would be to set the permission of "others" to what you need it to be.

(12-11-2020, 12:25 PM)kop316 Wrote: How are you trying to transfer them? I have beeen successful with SSH and USB-MTP
The thing with ssh is that there the ssh server takes care of the problem.
With USB-MTP I think you mean using a usb stick which most likely is formated NTFS or fat.
This would mean that the "owner" and the permission are getting lost since this are features of the filesystem, which NTFS and fat does not support and
aren't part of the file itself.
#4
(12-11-2020, 12:25 PM)kop316 Wrote: How are you trying to transfer them? I have beeen successful with SSH and USB-MTP

SSH works fine, since as @cybercow suggested the SSH server takes care of it. What I'm having a problem with is direct USB connection from my computer (running PopOS 20.10) to the phone. Not sure if it's technically using MTP or some other protocol.

(12-11-2020, 12:53 PM)cybercow Wrote: A possible solution would be to set your username on mobian to the same as on your computer.
I haven't tried that so I do not know what you would have to do so that phosh is ok with it.
A workaround would be to make a "mobian" user on your workstation and change the owner on your workstation.

The most clean way would possibly be to let the Bluetooth or USB file sharing daemon do that.
Unluckily I am not involved enough to know how to do that.

Sorry if that isn't helpful.

Another workaround would be to set the permission of "others" to what you need it to be.

(12-11-2020, 12:25 PM)kop316 Wrote: How are you trying to transfer them? I have beeen successful with SSH and USB-MTP
The thing with ssh is that there the ssh server takes care of the problem.
With USB-MTP I think you mean using a usb stick which most likely is formated NTFS or fat.
This would mean that the "owner" and the permission are getting lost since this are features of the filesystem, which NTFS and fat does not support and
aren't part of the file itself.

Thanks for the tips @cybercow . It would be nice if the USB file sharing daemon just handled this for me, but it doesn't, and I don't even know where I'd look to change its "settings," if that's possible.

Ultimately it's no real biggie, though. I just realized I can use chown recursively, so if I copy a bunch of files I can just quickly set the ownership of the whole folder and all the files to mobian, then go my merry way without too much trouble.
#5
I ran into this problem and found that when copying files directly to the phone over USB they are owned by root with permissions set such that only root can access them.

To fix this you can ssh into the phone (or use the built-in terminal) and issue the command "sudo chown mobian:mobian filename_pattern" to fix the ownership. With ssh running though I find it easier to just use sshfs and the files then arrive on the phone with the proper ownership. (It is slower than a direct USB transfer though.)


Possibly Related Threads…
Thread Author Replies Views Last Post
  Quick question abtut sources.list jojuma 1 596 06-17-2024, 04:46 AM
Last Post: zetabeta
  Lock screen question: always squeekboard tuxcall 1 1,525 02-02-2023, 08:51 PM
Last Post: Haibara23
  low disk space on file system root revisited benedikt55 2 1,975 09-24-2022, 10:16 AM
Last Post: benedikt55
  This Qutebrowser config file made browsing on the PinePhone great again ryo 0 1,428 01-05-2022, 05:49 PM
Last Post: ryo
  can't get file transfer working. Help, please! quixote 26 21,525 11-14-2021, 10:50 PM
Last Post: quixote
  File Transfer With Bluetooth food 0 1,213 10-29-2021, 11:00 AM
Last Post: food
  Installing Mobian --> "Resizing file system" forever Anna 13 14,783 09-09-2021, 04:26 AM
Last Post: spaetz
  Replace Potrtfolio with another file manager? nelstomlinson 1 2,015 09-03-2021, 08:08 AM
Last Post: arno_nuehm
  Change default program for a file type 3x5co 1 2,017 09-01-2021, 05:26 PM
Last Post: Zebulon Walton
  File transfer from Linux Desktop and PinePhone livanti21 18 28,851 03-09-2021, 08:15 PM
Last Post: MtnSk8

Forum Jump:


Users browsing this thread: 1 Guest(s)