USB external storage second time mount not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB external storage second time mount not working

885 Views
Aravinthkumar
Contributor III

Hi Team,

We are using Android 6 on imx6q processor. We have one more sub-system (imx6 linux) which contains sd card. Based on the required case from sub-system sd card will be mounted to imx6 Android board through USB as read only storage. First time mount its working after unmount if we try to mount its not working. 

When we keep external storage as vfat partition its working multiple mount and unmount. But in ext3/ext4 format only first time mount its working. 

 

Error logs for reference:

09-03 06:26:45.156 457 694 D UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/002/005,mVendorId=57005,mProductId=48879,mClass=0,mSubclass=0,mProtocol=0,mManufacturerName=Medtronic,mProductName=HDS_CSRM,mVersion=2.0,mSerialNumber=23492387,mConfigurations=[
09-03 06:26:45.156 457 694 D UsbHostManager: UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=1,mInterfaces=[
09-03 06:26:45.156 457 694 D UsbHostManager: UsbInterface[mId=0,mAlternateSetting=0,mName=Mass Storage,mClass=8,mSubclass=6,mProtocol=80,mEndpoints=[
09-03 06:26:45.156 457 694 D UsbHostManager: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]
09-03 06:26:45.156 457 694 D UsbHostManager: UsbEndpoint[mAddress=1,mAttributes=2,mMaxPacketSize=512,mInterval=1]]]]
09-03 06:26:45.158 457 694 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:763 com.android.server.usb.UsbSettingsManager.deviceAttached:742 com.android.server.usb.UsbHostManager.endUsbDeviceAdded:225 com.android.server.usb.UsbHostManager.monitorUsbHostBus:-2 com.android.server.usb.UsbHostManager.-wrap0:-1
09-03 06:26:45.854 153 940 I NuPlayerDecoder: [audio] saw output EOS
09-03 06:26:46.190 457 648 D VoldConnector: RCV <- {640 disk:8,0 8}
09-03 06:26:46.191 139 149 V vold : /system/bin/sgdisk
09-03 06:26:46.191 139 149 V vold : --android-dump
09-03 06:26:46.192 139 149 V vold : /dev/block/vold/disk:8,0
09-03 06:26:46.193 457 648 D VoldConnector: RCV <- {641 disk:8,0 59256078336}
09-03 06:26:46.196 457 648 D VoldConnector: RCV <- {642 disk:8,0 Linux
09-03 06:26:46.196 457 648 D VoldConnector: }
09-03 06:26:46.214 457 648 D VoldConnector: RCV <- {644 disk:8,0 /sys//devices/soc0/soc/2100000.aips-bus/2184400.usb/ci_hdrc.2/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sda}
09-03 06:26:46.253 139 149 E vold : Failed to pclose /system/bin/sgdisk --android-dump /dev/block/vold/disk:8,0 : Invalid argument
09-03 06:26:46.253 139 149 W vold : sgdisk failed to scan /dev/block/vold/disk:8,0
09-03 06:26:46.253 139 149 D vold : Disk at 8:0 changed
09-03 06:26:46.254 457 648 D VoldConnector: RCV <- {643 disk:8,0}
09-03 06:26:46.259 139 149 V vold : /system/bin/sgdisk
09-03 06:26:46.259 139 149 V vold : --android-dump
09-03 06:26:46.259 139 149 V vold : /dev/block/vold/disk:8,0
09-03 06:26:46.260 457 648 D VoldConnector: RCV <- {641 disk:8,0 59256078336}
09-03 06:26:46.262 457 648 D VoldConnector: RCV <- {642 disk:8,0 Linux
09-03 06:26:46.262 457 648 D VoldConnector: }
09-03 06:26:46.265 457 648 D VoldConnector: RCV <- {644 disk:8,0 /sys//devices/soc0/soc/2100000.aips-bus/2184400.usb/ci_hdrc.2/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sda}
09-03 06:26:46.332 139 149 E vold : Failed to pclose /system/bin/sgdisk --android-dump /dev/block/vold/disk:8,0 : Invalid argument
09-03 06:26:46.332 139 149 W vold : sgdisk failed to scan /dev/block/vold/disk:8,0
09-03 06:26:46.332 139 149 D vold : Disk at 8:0 changed
09-03 06:26:46.333 457 648 D VoldConnector: RCV <- {643 disk:8,0}
09-03 06:26:46.336 139 149 V vold : /system/bin/sgdisk
09-03 06:26:46.336 139 149 V vold : --android-dump
09-03 06:26:46.336 139 149 V vold : /dev/block/vold/disk:8,0
09-03 06:26:46.336 457 648 D VoldConnector: RCV <- {641 disk:8,0 59256078336}
09-03 06:26:46.341 153 428 W audio_hw_primary: out_set_parameters routing=2, ret 0, out -1242503872
09-03 06:26:46.345 457 648 D VoldConnector: RCV <- {642 disk:8,0 Linux
09-03 06:26:46.345 457 648 D VoldConnector: }
09-03 06:26:46.352 457 648 D VoldConnector: RCV <- {644 disk:8,0 /sys//devices/soc0/soc/2100000.aips-bus/2184400.usb/ci_hdrc.2/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sda}
09-03 06:26:46.428 139 149 E vold : Failed to pclose /system/bin/sgdisk --android-dump /dev/block/vold/disk:8,0 : Invalid argument
09-03 06:26:46.428 139 149 W vold : sgdisk failed to scan /dev/block/vold/disk:8,0
09-03 06:26:46.429 457 648 D VoldConnector: RCV <- {643 disk:8,0}

 

Can you please help me to fix this issue.

 

Regards,

Aravinth

0 Kudos
Reply
1 Reply

829 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Aravinthkumar,

From the logs, it seems there is no umount command. Could you please try adding umount before disconnecting the device?

And this issue might only be related to the Android framework and not the NXP driver. Could you please try debugging below Android framework code?

As the logs show,

09-03 06:26:46.253 139 149 E vold : Failed to pclose /system/bin/sgdisk --android-dump /dev/block/vold/disk:8,0 : Invalid argument
09-03 06:26:46.253 139 149 W vold : sgdisk failed to scan /dev/block/vold/disk:8,0

 

Thank you.
Best regards,
Dhruvit.

0 Kudos
Reply