Solved mount Android phone using mtpfs

I would like to transfer files off of my phone via USB to my computer. Previously, I would use mtpfs to mount the phone and then just copy the files over, but I am not having any such luck in FreeBSD. I am also referring to this post:
https://forums.freebsd.org/threads/howto-transfer-files-between-freebsd-and-android-devices.49820/

I have installed:
fusefs-simple-mtpfs
libmtp

Additionally, I saw https://unix.stackexchange.com/questions/88305/mount-mtp-device-in-freebsd, that I need to update my permissions so:

/etc/devfs.rules
Code:
[system=10]
add path 'usb*'          mode 0770 group cups
add path 'ugen*'         mode 0660 group cups
add path 'ad[0-9]\*'     mode 0666
add path 'ada[0-9]\*'    mode 0666
add path 'da[0-9]\*'     mode 0666
add path 'acd[0-9]\*'    mode 0666
add path 'cd[0-9]\*'     mode 0666
add path 'xpt[0-9]\*'    mode 0666
add path 'mmcsd[0-9]\*'  mode 0666
add path 'pass[0-9]\*'   mode 0666
add path 'usb/\*'        mode 0666
add path 'ugen[0-9]\*'   mode 0666
/etc/rc.conf
Code:
devfs_system_ruleset="system"

sysctl vfs.usermount=1
service devfs restart

I reconnected my phone and then ran simple-mtpfs phone, but nothing. What am I missing?
 
Last edited by a moderator:
Try this (MTP):
pkg install sysutils/android-file-transfer
and optionally (I prefer GUI for such things)
pkg install sysutils/android-file-transfer-qt5

GUI example:
sudo android-file-transfer

Non of those settings needed and there's no need to have a rooted android device (I haven't).
 
use jmtpfs, when you plug the phone
to the computer
run jmtpfs -o allow_other mount_point as root

thats it, run your file manager an access your phone files
Thanks I was tinkering around simple-mtpfs and was not able to mount my phone but this thing works seemingly well for my case kind of freebsd version of working simple-mtpfs :)

Thanks anyways
 
Thanks I was tinkering around simple-mtpfs and was not able to mount my phone but this thing works seemingly well for my case kind of freebsd version of working simple-mtpfs :)

Thanks anyways
me too,something like that, I was able to mount the mount and see the root folders..nothing more,from there simple-mtpfs and ls or file-manager freeze
 
I can make a connection to my Android smartphone with filesystems/jmtpfs and browse the files. To have some archive with me on the road, I want to sync dirs and files on my box with the SD-card on the phone.

When I use net/rsync as root most files are skipped because an 'input/output error (5)'. This error keeps coming even when I use a command that neglects permissions ( rsync -avz --no-o --no-g --no-perms).

Any idea how to use rsync without errors?

TIA,
 
I can make a connection to my Android smartphone with filesystems/jmtpfs and browse the files. To have some archive with me on the road, I want to sync dirs and files on my box with the SD-card on the phone.

When I use net/rsync as root most files are skipped because an 'input/output error (5)'. This error keeps coming even when I use a command that neglects permissions ( rsync -avz --no-o --no-g --no-perms).

Any idea how to use rsync without errors?

TIA,
have you checked the names of the files?
what is your filesystem on the sdcard ?
in one case i was rsync-ing mp3s and all files with weird "non-fat32 allowed" file names were skipped... i had to write a script to replace said characters. or maybe the size?
hope it helps.
a-
 
have you checked the names of the files?
what is your filesystem on the sdcard ?
in one case i was rsync-ing mp3s and all files with weird "non-fat32 allowed" file names were skipped... i had to write a script to replace said characters. or maybe the size?
hope it helps.
a-
I didn't look at the file system used on the card yet.

The files on the SD card have some unknown dot-extention after the regular extension like .pdf, .txt or .html. just 'ramdom' characters.

I tried with a new SD card that was formatted by the Android device. The same result. So I doubt if it is just the name of files or something different.
 
Use some FreeBSD commands to identify the filename problem. Sorry for faulty output from my memory.
man geom
man camcontrol
man gpart

geom disk list
camcontrol devllist
gpart status
gpart show -lp
gpart show -rp
mount
df -h
files /your/SDcard/path/screwy_filename.xyz
best wishes in finding a solution. Start with diagnosing the problem.
 
The input/output error is interesting to me. Whenever that happens, I assume the mount is invalid and umount and then remount. From my experience, this occurred when my phone was connected, but not unlocked. The solution for me in my case was to umount, disconnect my phone physically, reconnected, then unlock my phone.

One comment regarding the use of rsync, I generally don't put extensions on my files unless absolutely necessary, so I ran into issues previously trying to open text files that had no extension. Once I appended .txt to them, they opened right up on my Android phone.

Best of luck.
 
I didn't look at the file system used on the card yet.

The files on the SD card have some unknown dot-extention after the regular extension like .pdf, .txt or .html. just 'ramdom' characters.

I tried with a new SD card that was formatted by the Android device. The same result. So I doubt if it is just the name of files or something different.
I, too, wanted to learn from your posted problem, meine. Would like to see some output you got from running the posted commands, I shared with you. Then we all can learn, what you saw with the microSD card and rsync issues. Yes disconnect the USB cable, ReAttach the USB cable to the phone. Android, scroll to bottom of messages, and change/enable the Anroid cell phone USB port function, from 'USB charging' to 'USB File transfer' Share back details with us. I wish you success using FreeBSD, meine.
 
Back
Top