AnsweredAssumed Answered

g_mass_storage windows seeing something different

Question asked by David Luberger on Oct 26, 2018
Latest reply on Oct 30, 2018 by David Luberger

I'm installing the standard list of modules to get g_mass_storage up and running. I created a partition and formatted it as fat32 on my host linux computer.  this shows up as /dev/mmcblk0p3 on my target

with the prerequisite modules running, i run:

insmod /lib/modules/4*/kernel/drivers/usb/gadget/legacy/g_mass_storage.ko file=/dev/mmcblk0p3

and the device appears to be up and running. I plug in the usb cable to my windows host, and it connects. it shows "unallocated" for the device that shows up in disk manager, so i create a fat32 partition (although i had done that with cfdisk and mkfs.vfat F=32 on my linux host already). to test things out, i create a file called "test" from within the new drive in windows.  i mount the partition in my target to a dummy folder and look inside, and it shows nothing. so from within my target i create a file called "test2" and i look in windows and nothing is there except the original file "test" i created. thinking i wasn't mounted properly, i unmount the partition in my target, the dummy folder is empty, i remount and the "test2" file is there.  i unplug the windows host usb connection and plug it back in, and the drive comes back, and the file "test" is there! what is going on? windows reports the correct partition size, so i know it's connected to the partition i made, but why do my target and windows host see different contents??

 

if anyone could help i would appreciate it, but please don't point me to a document like the linux reference manual. it doesn't help. i need concise instructions on how to get g_mass_storage working between my embedded linux target and my windows host pc. thanks.

Outcomes