error while writing on sdcard

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

error while writing on sdcard

Postby jagtap.jj1 » Wed Oct 01, 2008 3:39 pm

Hello
I am using following command for writing exit1.png file on sdcard, It gines following error. Plz help


Code: Select all
E:\jagtap\Andriod SDK\android-sdk-windows-0.9_beta\tools>adb push exit1.png sd_card

failed to copy 'exit1.png' to 'sd_card': Read-only file system


Regards
jagtap
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Top

Postby ninor » Wed Oct 01, 2008 4:27 pm

Have you created the sdcard as explained here: http://www.anddev.org/emulating_a_sd-card-t263.html

Or, the name of the image is the same you created?

Or, have you properly put the path to it in Eclipse?
User avatar
ninor
Moderator
Moderator
 
Posts: 180
Joined: Thu Aug 14, 2008 6:30 pm
Location: Barcelona, Spain

Postby jagtap.jj1 » Thu Oct 02, 2008 7:04 am

yes, I have created as follows still it is giving error


Code: Select all
E:\jagtap\Andriod SDK\android-sdk-windows-0.9_beta\tools>mksdcard -l mySDCl 128M
"E:\jagtap\Andriod SDK\sdcard.img"



Code: Select all
E:\jagtap\Andriod SDK\android-sdk-windows-0.9_beta\tools>adb push E:\jagtap\Icon
s\options.png /sdcard
failed to copy 'E:\jagtap\Icons\options.png' to '/sdcard/options.png': Read-only
file system



Regards
Jagtap
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby Rahul » Mon Oct 06, 2008 1:07 pm

I too got the same error earlier...but this method worked for me..

i would advice you to create a new img file similar to the example below...In Command prompt type the following...

Code: Select all
mksdcard -l test 10M c:/test1.img


try starting the emulator and loading the SDcard from command prompt by typing...

Code: Select all
emulator -sdcard c:/test1.img


once emulator is started open another command prompt instance and try copying a file to SDcard by typing

Code: Select all
adb push e:/test.png sdcard/test.png


Later try retrieving the same file from sdcard to your system by typing

Code: Select all
adb pull sdcard/test.png d:/


see if the file has been copied in your d:/ ..try and tell me if it works for u:)
Rahul
Experienced Developer
Experienced Developer
 
Posts: 89
Joined: Wed Oct 01, 2008 11:16 am

Postby ninor » Mon Oct 06, 2008 4:27 pm

Thanks Rahul, quick and clear!
With your permission, I'll post this procedure as snippet in its own subforum.
Image AndDev: Your Android Development Community / Tutorials | Here's my Basic ToolKit
User avatar
ninor
Moderator
Moderator
 
Posts: 180
Joined: Thu Aug 14, 2008 6:30 pm
Location: Barcelona, Spain

Postby Rahul » Tue Oct 07, 2008 6:47 am

Yup....thanks for editing the post neatly....I just typed it in a hurry burry and hence didn't add it in snippet :)
I find your site to be a really cool one... lot of useful info abt android... u guys really rock 8)

ninor wrote:Thanks Rahul, quick and clear!
With your permission, I'll post this procedure as snippet in its own subforum.
Rahul
Experienced Developer
Experienced Developer
 
Posts: 89
Joined: Wed Oct 01, 2008 11:16 am

Top

Postby draconis2941 » Sun Oct 19, 2008 9:06 pm

Rahul wrote:I too got the same error earlier...but this method worked for me..

i would advice you to create a new img file similar to the example below...In Command prompt type the following...

Code: Select all
mksdcard -l test 10M c:/test1.img


try starting the emulator and loading the SDcard from command prompt by typing...

Code: Select all
emulator -sdcard c:/test1.img


once emulator is started open another command prompt instance and try copying a file to SDcard by typing

Code: Select all
adb push e:/test.png sdcard/test.png


Later try retrieving the same file from sdcard to your system by typing

Code: Select all
adb pull sdcard/test.png d:/


see if the file has been copied in your d:/ ..try and tell me if it works for u:)


I'm having the same problem, I've tried these steps and got the same result. Has anyone discovered the cause of this or are we still stuck in a "try it again from scratch" loop?
draconis2941
Freshman
Freshman
 
Posts: 4
Joined: Sun Oct 19, 2008 9:04 pm

Postby Rahul » Mon Oct 20, 2008 9:38 am

I am not able to understand you...can you please tell me the steps you have followed and the error you got..??

did you try this command ?...

Code: Select all
adb push f:/test.png /sdcard/test.png 


check if you have that file in the respective location you are mentioning and the sdcard loaded in emulator..



draconis2941 wrote:
Rahul wrote:I too got the same error earlier...but this method worked for me..

i would advice you to create a new img file similar to the example below...In Command prompt type the following...

Code: Select all
mksdcard -l test 10M c:/test1.img


try starting the emulator and loading the SDcard from command prompt by typing...

Code: Select all
emulator -sdcard c:/test1.img


once emulator is started open another command prompt instance and try copying a file to SDcard by typing

Code: Select all
adb push e:/test.png sdcard/test.png


Later try retrieving the same file from sdcard to your system by typing

Code: Select all
adb pull sdcard/test.png d:/


see if the file has been copied in your d:/ ..try and tell me if it works for u:)


I'm having the same problem, I've tried these steps and got the same result. Has anyone discovered the cause of this or are we still stuck in a "try it again from scratch" loop?
Rahul
Experienced Developer
Experienced Developer
 
Posts: 89
Joined: Wed Oct 01, 2008 11:16 am

Postby haden » Mon Oct 20, 2008 1:42 pm

Hi rahul. thanks. this code worked just fine
haden
Experienced Developer
Experienced Developer
 
Posts: 74
Joined: Thu Sep 11, 2008 11:51 am

Postby draconis2941 » Tue Oct 21, 2008 2:50 am

I followed these steps exactly:

Code: Select all
mksdcard -l test 10M c:/Development/test1.img

Code: Select all
emulator -sdcard c:/Development/test1.img

Code: Select all
adb push "C:/Development/Picture 1343.jpg" "sdcard/Picture 1343.jpg"


and I'm still getting the Read-only error. I've attached screen shots.
Attachments
Step.png
Step.png (33.96 KiB) Viewed 12321 times
Step1.png
Step1.png (14.21 KiB) Viewed 12321 times
draconis2941
Freshman
Freshman
 
Posts: 4
Joined: Sun Oct 19, 2008 9:04 pm

Postby Rahul » Tue Oct 21, 2008 5:50 am

In the image you have uploaded the slashes got interchanged while typing sdcard..

you have typed

Code: Select all
adb push "c:\development\picture 1343.jpg" "\Sdcard\test.jpg"


also Sdcard and sdcard are not the same...I think its case sensitive

the correct syntax is

Code: Select all
adb push <source path> /sdcard/<filename>


so try typing as you have mentioned in the code

Code: Select all
adb push "c:/development/picture 1343.jpg" "/sdcard/test.jpg"



hope that should work :)


draconis2941 wrote:I followed these steps exactly:

Code: Select all
mksdcard -l test 10M c:/Development/test1.img

Code: Select all
emulator -sdcard c:/Development/test1.img

Code: Select all
adb push "C:/Development/Picture 1343.jpg" "sdcard/Picture 1343.jpg"


and I'm still getting the Read-only error. I've attached screen shots.
Rahul
Experienced Developer
Experienced Developer
 
Posts: 89
Joined: Wed Oct 01, 2008 11:16 am

Re: error while writing on sdcard

Postby Spomega » Sat Jun 26, 2010 2:02 pm

try registering ur sdcard with this command emulator -avd <avd_name> -sdcard <imagename>.
Note do not start emulator before doing this.
Spomega
Freshman
Freshman
 
Posts: 6
Joined: Sat Jun 26, 2010 1:20 pm

Re: error while writing on sdcard

Postby meetalisharma7 » Thu Sep 09, 2010 2:09 pm

Hi Thanks for the steps.

I got this error when I previously tried to push config file.
failed to copy 'd:/APK_files/config.ini' to '/sdcard/config.ini': Read-only file system

Then I realised that emulator is to be started and loaded with sdcard, then it worked.

Here are the steps I followed -
1. mksdcard -l SD256M 256M sdcard.img

2. Started the emulator and loaded the SDcard from command prompt

emulator -avd My_android1.5 -sdcard sdcard.img
Note - I had already made My_android avd using android create avd --target 2 --name newavd

3. once emulator is started, in another command prompt instance copied a file to SDcard.

adb push d:/APK_files/config.ini sdcard/config.ini

4. The I installed the apk file using the command
adb install file_name.apk

Now the application launches successfully, but it gets exception http error 500 for the URL mentioned in config.ini file. So the application do not connects. :(

trying to figure this out..
meetalisharma7
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 09, 2010 2:03 pm

Re: error while writing on sdcard

Postby rapha3l » Mon Mar 21, 2011 5:33 pm

in Run configuration -->> your app --> Target
coche your android emulator and in "Additional emulator command line options"
-partition-size 1024 -sdcard C:\sdcard\test.img
rapha3l
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Mar 21, 2011 5:27 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests