mount phone for file transfer?

1 view
Skip to first unread message

Gary Aitken

unread,
Oct 19, 2025, 1:14:23 PMOct 19
to FreeBSD Mailing List
Hi all,

How does one mount a phone (android) to transfer files?
I can do this on a lynix system but can't figure out how on my fbsd 13.5.
I have urndis loaded:

$ kldstat | grep urn
16 1 0xffffffff82773000 3380 if_urndis.ko

$ dmesg | tail
ugen7.2: <SAMSUNG SAMSUNGAndroid> at usbus7
umodem0 on uhub2
umodem0: <CDC Abstract Control Model (ACM)> on usbus7
umodem0: data interface 2, has no CM over data, has no break

I could not find anything that seemed relevant in the handbook,
but may have missed it.

Thanks,

Gary

Matthias Apitz

unread,
Oct 19, 2025, 1:41:06 PMOct 19
to Gary Aitken, FreeBSD Mailing List
El día domingo, octubre 19, 2025 a las 11:13:50a. m. -0600, Gary Aitken escribió:

> Hi all,
>
> How does one mount a phone (android) to transfer files?
> I can do this on a lynix system but can't figure out how on my fbsd 13.5.
> I have urndis loaded:
>
> $ kldstat | grep urn
> 16 1 0xffffffff82773000 3380 if_urndis.ko
>
> $ dmesg | tail
> ugen7.2: <SAMSUNG SAMSUNGAndroid> at usbus7
> umodem0 on uhub2
> umodem0: <CDC Abstract Control Model (ACM)> on usbus7
> umodem0: data interface 2, has no CM over data, has no break
>
> ...

I don't mount, but use SSH and SCP from/to my Linux cellphone Purism L5.
On plugin of the USB cable the following driver is loaded:

Oct 19 19:33:24 c720-1400094 kernel: ugen0.4: <Purism, SPC Librem 5> at usbus0
Oct 19 19:33:24 c720-1400094 kernel: cdce0 on uhub0
Oct 19 19:33:24 c720-1400094 kernel: cdce0: <CDC Network Control Model (NCM)> on usbus0
Oct 19 19:33:24 c720-1400094 kernel: ue0: <USB Ethernet> on cdce0
Oct 19 19:33:24 c720-1400094 kernel: ue0: Ethernet address: a2:7a:8e:7f:ac:93
Oct 19 19:33:24 c720-1400094 kernel: umodem0 on uhub0
Oct 19 19:33:24 c720-1400094 kernel: umodem0: <CDC Abstract Control Model (ACM)> on usbus0
Oct 19 19:33:24 c720-1400094 kernel: umodem0: data interface 1, has no CM over data, has no break
Oct 19 19:33:24 c720-1400094 kernel: ue0: link state changed to UP
Oct 19 19:33:29 c720-1400094 kernel: usb_dev_resume_peer: Clearing device remote wakeup failed: USB_ERR_TIMEOUT


$ ifconfig ue0
ue0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=80000<LINKSTATE>
ether a2:7a:8e:7f:ac:93
inet 10.42.0.19 netmask 0xffffff00 broadcast 10.42.0.255
inet6 fe80::a07a:8eff:fe7f:ac93%ue0 prefixlen 64 scopeid 0x3
media: Ethernet autoselect
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

This is done by devd-hooks:

$ cat /usr/local/etc/devd/l5.conf

notify 1 {
match "system" "IFNET";
match "subsystem" "ue0";
match "type" "ATTACH";
action "/usr/local/etc/devd/l5.sh";
};

$ cat /usr/local/etc/devd/l5.sh
#!/bin/sh
#
dhclient ue0
exit 0

And works for years this way already, I forgot the hooks and have had to
look into :-)

HIH

matthias


--
Matthias Apitz, ✉ gu...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

An die deutsche Bundesregierung: Nein, meine Söhne geb' ich nicht für Ihren Krieg!
Al Gobierno alemán: ¡No, no doy mis hijos para su guerra!
To the German Government: No, I will not give my sons for your war!

Jin Guojun[VFF]

unread,
Oct 19, 2025, 1:46:53 PMOct 19
to ques...@freebsd.org
# kldload fusefs.ko

# jmtpfs -o allow_other /mnt

Make sure the phone is allowed other device to access its storage:
usually, the phone will ask this permission when  jmtpfs command is issued.

-Jin


The Doctor

unread,
Oct 19, 2025, 2:30:25 PMOct 19
to Gary Aitken, FreeBSD Mailing List
Try the ports for mounting your android file.

> Thanks,
>
> Gary
>

--
Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca
Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
Look at Psalms 14 and 53 on Atheism ;
All I want to hear from JEsus Christ is WEll done Good and Faithful servant

Gary Aitken

unread,
Oct 19, 2025, 11:41:14 PMOct 19
to Jin Guojun[VFF], ques...@freebsd.org
On 10/19/25 11:47, Jin Guojun[VFF] wrote:
> On 10/19/25 10:13, Gary Aitken wrote:

>> How does one mount a phone (android) to transfer files? I can do
>> this on a lynix system but can't figure out how on my fbsd 13.5. I
>> have urndis loaded:
...
> # kldload fusefs.ko
>
> # jmtpfs -o allow_other /mnt
>
> Make sure the phone is allowed other device to access its storage:
> usually, the phone will ask this permission when jmtpfs command is
> issued.


# jmtpfs -o allow_other /mnt/memstick
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
# ls -l /mnt/memstick
ls: /mnt/memstick: Input/output error
# umount /mnt/memstick

It acted like it worked...
phone dinged when plugged in
The phone is set to:
Use USB for: Transferring files/AndroidAuto
USB controlled by: This device (I can't seem to change it)

Once or twice I saw the notice for Allow/Disallow access and allowed,
but always after things didn't work; now I can't find it:
plug in phone
ding
... no dialog, even with no apps on screen
Swipe up, down, left, right... nada
Swipe down, I see "USB for file transfer", as if it's ok as is / already allowed,
but ls still fails.
Thoughts?
Samsung Galaxy A15

Thanks,

Gary

Polytropon

unread,
Oct 20, 2025, 9:40:04 AMOct 20
to ques...@freebsd.org, fre...@dreamchaser.org
On Sun, 19 Oct 2025 11:13:50 -0600, Gary Aitken wrote:
> How does one mount a phone (android) to transfer files?

One does not simply mount a phone. ;-)

The Android developers toolset can be used (adb_something).
Check your device settings, those "phones" often require you
to enable some "developer settings" in order to expose a
mountable device, and even then, it might be possible that
the directory containing the files you're interested in
is _not_ part of the exposed virtual root of the device
presented to the system. Sometimes it also seems to matter
that those settings are changed when the "phone" is connected
to the computer (not "offline" - they're not present), but
this all depends on many "moving parts" (different Android
versions, different manufacturer branding and different
Google intervention).

I got that stuff working once: Two device files were then
accessible to the system, one containing the SD card (there
was an actual micro-SD card in the "phone"), and the other
one contained a subtree of the system itself, so some stuff
could be read, others could not. The adb tools were helpful
for exploring what was going on.

Some "phones" also allow you to enable a PTP compatible
mode (or MTP mode). You can then use gphoto2 (and gtkam,
if you wish) to access photo and media files.



> I could not find anything that seemed relevant in the handbook,
> but may have missed it.

Maybe the handbook doesn't cover this... :-(




Good luck!

--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

fatty.merc...@aceecat.org

unread,
Oct 20, 2025, 12:24:49 PMOct 20
to ques...@freebsd.org
On Sun, Oct 19, 2025 at 11:13:50AM -0600, Gary Aitken wrote:

> How does one mount a phone (android) to transfer files?

I know the following doesn't directly answer the question, and I also
know that it might not be applicable in tight bandwidth
situations. I've been there myself. But anyway:

The easiest way to transfer files to / from Android, for me now, is
Magic Wormhole:

https://github.com/magic-wormhole/

Client software packages are available on most Penguin systems and on
F-Droid:

https://search.f-droid.org/?q=wormhole&lang=en

On FreeBSD, I have successfully (and easily) built the Rust client
from source.

hth,

--
Ian

Jin Guojun[VFF]

unread,
Oct 20, 2025, 1:54:05 PMOct 20
to fre...@dreamchaser.org, ques...@freebsd.org
This is a setting issue cross different phones, even between Samsung
phones, who is controlling the File Transfer (F/T).

To make things simpler, ignore who controls the F/T and repeat the same
process twice with a umount in between.

#  jmtpfs -o allow_other /mnt                 ; mount may fail due to
the phone is not ready to do F/T

wait for phone to ask Allow/Deny and press Allow

# ls /mnt may see nothing but Input/output error because mounting
process was done before phone allows F/T

# umount /mnt

#  jmtpfs -o allow_other /mnt              ; this time mount should be
successful

if phone asks Allow/Deny again due to some kind timing issue, try to do
umount and jmtpfs mount one more time.



Gary Aitken

unread,
Oct 24, 2025, 3:07:45 PMOct 24
to Jin Guojun[VFF], ques...@freebsd.org
> This is a setting issue cross different phones, even between Samsung
> phones, who is controlling the File Transfer (F/T).
>
> To make things simpler, ignore who controls the F/T and repeat the
> same process twice with a umount in between.
>
> # jmtpfs -o allow_other /mnt ; mount may fail due
> to the phone is not ready to do F/T
>
> wait for phone to ask Allow/Deny and press Allow
>
> # ls /mnt may see nothing but Input/output error because mounting
> process was done before phone allows F/T
>
> # umount /mnt
>
> # jmtpfs -o allow_other /mnt ; this time mount should
> be successful
>
> if phone asks Allow/Deny again due to some kind timing issue, try to
> do umount and jmtpfs mount one more time.

Getting back to this...
I have several mount points under /mnt, which is where I was trying to mount.
As I was having trouble, I made a fresh mount point at /newmnt

Originally I saw no allow prompt on the phone.
I thought the I/O error meant it didn't work, so issued umount but left it plugged in.
A few minutes later reopened the phone and the allow prompt was there.
Hit allow, then tried again and it worked.

I'm thinking it's the procedure, not the mount point, which made the difference.

Gary

Jin Guojun[VFF]

unread,
Oct 24, 2025, 3:16:24 PMOct 24
to fre...@dreamchaser.org, ques...@freebsd.org
This may be a USB port issue although it looks like a timing issue.

For 13.x-R and later, the USB 3 works much better/faster than USB 2 as 
I have experienced.


Mark G.

unread,
Oct 25, 2025, 6:20:27 PMOct 25
to fre...@dreamchaser.org, FreeBSD Mailing List
On 10/19/25 10:13, Gary Aitken wrote:
> Hi all,
>
> How does one mount a phone (android) to transfer files?
> I can do this on a lynix system but can't figure out how on my fbsd 13.5.
> I have urndis loaded:
>

[snip]

Hello,

I'm a bit late to the party, but didn't see android-file-transfer mentioned.
I use this on 14.3, so you may have different results on 13.5.

loader.conf settings that are likely related:

# usb android phone/tethering
if_urndis_load="YES"
if_cdce_load="YES"
if_ipheth_load="YES"

Package information.

% pkg info android-file-transfer

android-file-transfer-4.5
Name : android-file-transfer
Version : 4.5
Installed on : Wed Sep 3 00:24:06 2025 PDT
Origin : sysutils/android-file-transfer
Architecture : FreeBSD:14:amd64
Prefix : /usr/local
Categories : sysutils
Licenses : LGPL21
Maintainer : tiago....@gmail.com
WWW : https://github.com/whoozle/android-file-transfer-linux
Comment : Android MTP client with minimalistic UI
Options :
CLI : on
FUSE : off
OPENSSL : on
TAGLIB : on
Shared Libs required:
libc++.so.1
libc.so.7
libcrypto.so.30
libcxxrt.so.1
libgcc_s.so.1
libm.so.5
libmagic.so.4
libtag.so.2
libthr.so.3
libusb.so.3
libz.so.6
Annotations :
FreeBSD_version: 1403000
build_timestamp: 2025-09-03T07:23:18+0000
built_by : poudriere-git-3.4.3
port_checkout_unclean: no
port_git_hash : 567605906
ports_top_checkout_unclean: no
ports_top_git_hash: 42f4872b7
repo_type : binary
repository : Poudriere
Flat size : 513KiB
Description :
Android File Transfer for Linux - reliable MTP client with
minimalistic UI similar to Android File Transfer for Mac.

Features:
* Simple Qt UI with progress dialogs.
* FUSE wrapper (If you'd prefer mounting your device), supporting
partial read/writes, allowing instant access to your files.
* No file size limits.
* Automatically renames album cover to make it visible from media player.
* No extra dependencies (e.g., libptp/libmtp).
* Available as static/shared library.
* Command line tool (aft-mtp-cli)



Reply all
Reply to author
Forward
0 new messages