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
  can't get file transfer working. Help, please! quixote 25 2,417 05-28-2021, 06:53 PM
Last Post: Rainer
  Installing Mobian --> "Resizing file system" forever Anna 9 2,276 05-01-2021, 07:51 PM
Last Post: jonnicholson
  File transfer from Linux Desktop and PinePhone livanti21 18 13,078 03-09-2021, 08:15 PM
Last Post: MtnSk8
  no "release file"? HLing 4 1,862 10-29-2020, 04:22 PM
Last Post: HLing
  weird SIM card question RodneyMyers 4 1,633 10-16-2020, 01:47 PM
Last Post: ThrillGates
  Unable to mount exFAT file system jyc88 4 2,187 07-23-2020, 05:21 PM
Last Post: jyc88
  Screen Brightness Question LinuxBrave 5 2,343 07-12-2020, 07:02 PM
Last Post: LinuxBrave
  noobie question regarding install HLing 15 6,193 07-08-2020, 05:03 PM
Last Post: HLing
Question Question re updates and nightly images JustineSmithies 1 1,082 06-27-2020, 12:24 PM
Last Post: devrtz

Forum Jump:


Users browsing this thread: 1 Guest(s)