can't shell to sdcard

dxMorgan

New Member
Joined
Aug 25, 2011
Messages
3
Reaction score
0
Hi all.

I've just gotten a new Droid X and I am trying to use ADB to gain access to the sdcard. when I shell into it and attempt to cd there I get:

$ cd sdcard
cd: can't cd to sdcard

when I ls -l i get :

d--------- system system 2011-08-25 11:12 sdcard-ext
d--------- system system 2011-08-25 11:12 sdcard

so I'm confident it's there. The sdcard shows up in the "SD Card & Phone Storage" area, and there is even another DroidX2 in the office here which works fine. I am running a corporate sync on this one which is not present on the other, but I don't see and haven't heard of that being an impediment to anyone else.

Any help is much appreciated, thanks,
Morgan
 

travisn000

Member
Joined
Aug 5, 2010
Messages
131
Reaction score
0
"sdcard" is not a complete path... on all linux sysems the path to any directory always starts with "/"

I'll install a terminal emulator on my DX and report back with better directions ASAP
 
Last edited:

travisn000

Member
Joined
Aug 5, 2010
Messages
131
Reaction score
0
..just checked; it looks like on my DX you should be able to access the sdcard from shell using either "cd /sdcard" or "cd /mnt/sdcard" (..without the quotes.. they both give the same results)
 
OP
D

dxMorgan

New Member
Joined
Aug 25, 2011
Messages
3
Reaction score
0
$ cd /mnt/sdcard
cd: can't cd to /mnt/sdcard

Sorry, no go! I'm doing a lot of testing and I've done these commands on dozens of devices. cd mnt works fine cd /mnt works fine. but all other directories give the same error.

$ cd config
cd: can't cd to config
$ cd /config
cd: can't cd to /config
$ cd root
cd: can't cd to root
$ cd dev
$ cd data
cd: can't cd to data
$ cd proc
cd: can't cd to proc
$ cd sbin
cd: can't cd to sbin

Thanks for your reply.

..just checked; it looks like on my DX you should be able to access the sdcard from shell using either "cd /sdcard" or "cd /mnt/sdcard" (..without the quotes.. they both give the same results)
 
OP
D

dxMorgan

New Member
Joined
Aug 25, 2011
Messages
3
Reaction score
0
[solved]

so thanks to all who looked into this.

Settings->Applications->Developement->USB Debugging puts the phone into "connect as USB Mass Storage Device" by default. Change it to "Charge Only" if you want access to sdcard, etc.

Happy coding, all.
 

travisn000

Member
Joined
Aug 5, 2010
Messages
131
Reaction score
0
cd mnt works fine cd /mnt works fine. but all other directories give the same error.
Glad to hear you figured it out!

..Just to clarify for anyone that my read my previous post regarding the correct format of a path...

If you are entering a path that is relative to the directory your shell is currently navigated to you don't need to use the initial "/" symbol in the directory path, so if you where in the base directory ("/") you can use the command "cd mnt" and it will work just fine...

However, if you had previously navigated into another directory using the cd command and wanted to navigate directly to a second directory that was not a subdirectory of your current directory, you would have to use the full path beginning with "\"

;)
 
Top