Mounting Android's File System
Bernie Hoefer
LUG-Member at TheMoreIKnow.info
Sat Sep 19 12:36:13 EDT 2026
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm sure that there are forums that might be better suited to this question, but I figured I'd try here in CINLUG, anyway!
On an *old* Android device, I was able to connect it to a computer via USB cable and mount its FAT file system.
A newer device (Android 17) does not, by default, allow direct file system mounting. One can only mount using Media Transfer Protocol (MTP). For the most part, that's OK. But apparently file modification times are not kept when copying files to the device.
I HAVE THESE FILES WITH THESE MODIFICATION TIMES ON MY COMPUTER:
$ ls -aFlgo testdir
total 8
drwx------. 2 87 Sep 15 15:31 ./
drwxr-x---+ 51 4096 Sep 15 15:30 ../
- -rw-------. 1 0 Jul 1 06:00 2026-07-01_file.txt
- -rw-------. 1 0 Aug 1 06:00 2026-08-01_file.txt
- -rw-------. 1 0 Sep 1 06:00 2026-09-01_file.txt
I ALSO HAVE THE DEVICE MOUNTED TO MY COMPUTER:
$ mount | grep mnt
jmtpfs on ~/mnt type fuse.jmtpfs (rw,nosuid,nodev,relatime,user_id=XXXXX,group_id=XXXXX)
IF I COPY (OR RSYNC) A FILE FROM THE LAPTOP TO THE DEVICE, THE TIMESTAMPS ARE NOT KEPT:
$ cp -p testdir/2026-07-01_file.txt ~/mnt/Internal\ shared\ storage/Documents
$ ls -aFlgo ~/mnt/Internal\ shared\ storage/Documents/2026-07-01_file.txt
- -rw-r--r--. 1 0 Sep 19 16:04 2026-07-01_file.txt
$ rsync -a --progress testdir ~/mnt/Internal\ shared\ storage/Documents
sending incremental file list
testdir/
testdir/2026-07-01_file.txt
0 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=2/4)
testdir/2026-08-01_file.txt
0 100% 0.00kB/s 0:00:00 (xfr#2, to-chk=1/4)
testdir/2026-09-01_file.txt
0 100% 0.00kB/s 0:00:00 (xfr#3, to-chk=0/4)
$ ls -aFlgo ~/mnt/Internal\ shared\ storage/Documents/testdir/
total 0
drwxr-xr-x. 2 0 Sep 19 16:05 ./
drwxr-xr-x. 3 0 Jul 23 2023 ../
- -rw-r--r--. 1 0 Sep 19 16:05 2026-07-01_file.txt
- -rw-r--r--. 1 0 Sep 19 16:05 2026-08-01_file.txt
- -rw-r--r--. 1 0 Sep 19 16:05 2026-09-01_file.txt
Does anybody know a way around this, please?
Some co-workers have suggested network-using alternatives (many of them non-FOSS):
Syncthing
Copyparty
Servers Ultimate
KDEconnect.kde.org
Installing a SSH (SFTP) client on the Android and pulling
the files instead of pushing them.
While I appreciate those suggestions, I was really hoping to just transfer the files (preserving timestamps) over USB.
Anybody have any ideas, please?
- --
Bernie Hoefer
PGP e-mail is welcome! Get my 1024 bit public key from:
https://www.TheMoreIKnow.info/hoeferbe/0x1EA6025D9DFB224E69D4CE0E7241A6A9446A6F93.key
"The more I know, the more I realize how much I do not understand."
-----BEGIN PGP SIGNATURE-----
iF0EARECAB0WIQQepgJdnfsiTmnUzg5yQaapRGpvkwUCaq650wAKCRByQaapRGpv
k0BvAJ9CIuyulg/hQeMsvGFHilPNmTYiWwCeOQ/yVl90Q+xWZixUQG7551Rdkco=
=GcXN
-----END PGP SIGNATURE-----
More information about the cinlug
mailing list