oufm / UMS-Interface

config the USB mass storage for android to use the phone as usb disk, provide mount function and simple file explorer.
GNU General Public License v3.0
99 stars 20 forks source link

[question] cannot read the part of disk when set external SD as ums #9

Open Freed-Wu opened 3 years ago

Freed-Wu commented 3 years ago

ums_log.tar.gz

when set disk image file as ums, it can work normally.

when i try to set an external sd as ums, the disk can be listed by lsblk in linux or diskmgmt.msc in windows, but the part of the disk cannot be read.

i have formatted the external sd and try again, but nothing changed. and i make sure that the mount namespace is global and the software coming from github is latest.

thanks!

outofmemo commented 3 years ago

Do you mean the part of the disk can't be read in Windows or in Android?

Freed-Wu commented 3 years ago

0

In android, /mnt/media_rw/B81B-711D 1

In linux

 >  lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   128M  0 part /boot
└─sda2   8:2    0 465.7G  0 part /
sdb      8:16   1  15.4G  0 disk

/dev/sdb is the disk, but the part of it cannot be read.

In windows

> diskmgmt.msc

2

H: is the disk, but the part of it cannot be read.

outofmemo commented 3 years ago

Maybe there's some thing wrong with the file system.

You can try to plug the USB into a Linux PC to see whether it can be recognized. You can also use tools like parted or DiskGenius to check whether the file system is normal.

Freed-Wu commented 3 years ago

Reproduce Procedure

insert a sdcard to a phone. 0_1

ums_interface -> quick start -> start

3

or

ums_interface -> u disk -> select /dev/block/vold/disk:179:64 -> config usb
gadget

1

or

ums_interface -> u disk -> select /dev/block/vold/public:179:65 -> config usb
gadget

2

in linux, lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   128M  0 part /boot
└─sda2   8:2    0 465.7G  0 part /
sdb      8:16   1  58.2G  0 disk

in windows, diskmgmt.msc, the part also cannot be read.

Effort to Solve

i use a microsd-to-sd or microsd-to-usb to insert the sdcard to computer. in linux and windows, it also can be read. so the sdcard should be normal.

i buy a new sdcard. now i have 2 sdcard -- 64GB and 16GB, and both of them can reproduce the issue.

i format the sdcard to fat32 and exfat many times and use different softwares. it still doesn't change.

Environment

Sdcard

Mobile

Freed-Wu commented 3 years ago

i try to select /dev/block/mmcblk0 to config usb gadget, and the disk can display but the part of disk cannot be read. /dev/block/mmcblk0p* /dev/block/loop* /dev/loop* is same as /dev/block/mmcblk0 and /dev/block/vold/public*

Screenshot_2021-01-17-16-02-07-51

Screenshot_2021-01-17-16-06-57-64

and i try to mount an image file and get failure.

Screenshot_2021-01-17-16-19-33-28

perhaps i should change a mobile to try again?