SD Card directory is unavailable after ADB file transfer. - Android KitKat

Bug #1243160 reported by Botao
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro Android
Triaged
Medium
vishal

Bug Description

On ARM Versatile Express A9 board with Linaro Android image:

https://android-build.linaro.org/builds/~linaro-android/vexpress-linaro-13.10-release/#build=2

SD Card directory is unavailable after ADB file transfer. The procedure list is:

1. Establish ADB connection over Ethernet;
2. From host machine, using "adb push" to transfer any file to path "/sdcard"
3. On target serial console, run "cd /sdcard"

Then the error shows:

root@vexpress:/data # cd /sdcard
/system/bin/sh: cd: /sdcard: Not a directory
2|root@vexpress:/data #

The file can be transferred successfully from host machine side, but can't be found under /sdcard

A reboot can eliminate this issue, though the transferred file is still missing. And the "/sdcard" can also be accessed before the file transfer.

Also, here is the output of "df" and "mount" from my board:
##################################
root@vexpress:/ # df
Filesystem Size Used Free Blksize
/dev 504.1M 84.0K 504.0M 4096
/mnt/secure 504.1M 0.0K 504.1M 4096
/mnt/asec 504.1M 0.0K 504.1M 4096
/mnt/obb 504.1M 0.0K 504.1M 4096
/system 487.9M 433.5M 54.4M 4096
/cache 239.9M 2.0M 237.9M 1024
/data 487.8M 90.6M 397.2M 1024
/mnt/sdcard 2.3G 121.5M 2.2G 4096
/mnt/secure/asec 2.3G 121.5M 2.2G 4096
##################################

root@vexpress:/ # mount
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/block/mmcblk0p2 /system ext4 ro,relatime,data=ordered 0 0
/dev/block/mmcblk0p3 /cache ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
/dev/block/mmcblk0p5 /data ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
nodev /dev/gator gatorfs rw,relatime 0 0
/dev/block/vold/179:6 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codep0
/dev/block/vold/179:6 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
root@vexpress:/ #

Botao (botao-sun)
description: updated
Botao (botao-sun)
description: updated
Revision history for this message
vishal (vishalbhoj) wrote :

Can you try pushing files to /mnt/sdcard which is the right place to push the files.

Revision history for this message
Botao (botao-sun) wrote :

@Vishal, it works well after change the path to /mnt/sdcard. And after file transferred, I still can access /sdcard, and the file is there too.

Is it an expected behaviour? I ask because I always use "/sdcard" as the storage point when I want to transfer files, at least on my Galaxy Nexus phone and Nexus 7 with Google AOSP image.

Revision history for this message
Soumya Basak (soumya-basak) wrote :

Hi Botao,
This issue reproduced with Linaro Android Jellybean 13.10 RC Arndale builds:

https://android-build.linaro.org/builds/~linaro-android/arndale-linaro-13.10-release/#build=4

After establishing Connection ADB over Ethernet
the procedure that I followed:

1. $ adb push ~/Downloads/img146.pdf /sdcard
1798 KB/s (387278 bytes in 0.210s)

2. $ adb shell ls /sdcard
/sdcard

3. $ adb pull /sdcard/img146.pdf
remote object '/sdcard/img146.pdf' does not exist

from the serial console:

root@arndale:/ # cd /sdcard
/system/bin/sh: cd: /sdcard: Not a directory

After rebooting the device the file is not present '/sdcard' directory.

Revision history for this message
Soumya Basak (soumya-basak) wrote :

Hi Botao,
Confirm after adding: /mnt/sdcard the data transfer is successful with builds:

 https://android-build.linaro.org/builds/~linaro-android/arndale-linaro-13.10-release/#build=4

Please ignore the comment #3

Revision history for this message
Tixy (Jon Medhurst) (tixy) wrote :

You need to use '/sdcard/' not '/sdard', the former says to push it into the directory '/sdcard', the latter makes it replace the symlink file /sdard/ with the file you just pushed. This is what happens for me when I just tried this, and I've not noticed this before because I've always used '/sdcard/' as is my habit with these sort of things to avoid ambiguity of whether you mean a directory or file.

Revision history for this message
Tixy (Jon Medhurst) (tixy) wrote :

Type in last comment, shoul have said "...the latter makes it replace the symlink file /sdcard"

vishal (vishalbhoj)
Changed in linaro-android:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → HariGopal (harigopal-gollamudi)
milestone: none → 13.11
Revision history for this message
Botao (botao-sun) wrote :

@Vishal and Tixy, Yes, both ways can walk around this issue:

1. Using "/mnt/sdcard" instead of "/sdcard";
2. Using "/sdcard/" instead of "/sdcard".

However, when I do the same test on my Nexus 7 tablet, I got following output:

$ sudo adb push Wonderful_Tonight.mp3 /sdcard
failed to copy 'Wonderful_Tonight.mp3' to '/sdcard': Is a directory

$ sudo adb push Wonderful_Tonight.mp3 /sdcard/
1158 KB/s (22124380 bytes in 18.654s)
$

So you can see there is an error message to prevent me using "/sdcard" as the destination. But on our Linaro Android image, this mechanism doesn't exist, it shows successful on host PC side regardless using "/sdcard" or "/sdcard/", but then error shows on target side if using the first one.

Should we involve this process to our image? Or just curious that why it's in AOSP but disappeared in Linaro Android?

Fathi Boudra (fboudra)
Changed in linaro-android:
milestone: 13.11 → 13.12
assignee: HariGopal (harigopal-gollamudi) → vishal (vishalbhoj)
Fathi Boudra (fboudra)
Changed in linaro-android:
milestone: 13.12 → 14.01
Botao (botao-sun)
summary: - SD Card directory is unavailable after ADB file transfer.
+ SD Card directory is unavailable after ADB file transfer. - Android
+ KitKat
Fathi Boudra (fboudra)
Changed in linaro-android:
milestone: 14.01 → 14.03
Fathi Boudra (fboudra)
Changed in linaro-android:
milestone: 14.03 → 14.04
Revision history for this message
Botao (botao-sun) wrote :

Do we have any resource to work on this or to compare its behaviour to AOSP, as described in comment #7?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.