I have a Samsung S3 which I have installed Cyanogenmod on with a view to carry out some procedures with root permissions.
At the minute I am trying to create a .img file of the userdata memory block using the DD command in the adb shell. I have a 32GB SD card which initially was formatted as FAT32 and therefore failed once the .img file reached 4GB. I expected as much but I wanted to check things were going ok before I reformatted the card.
I then formatted the SDCard as ext4 using gparted. I noticed on my ubuntu machine that the card had root ownership so I changed that to user and I can read and write files in nautilus fine.
Switching back to the adb shell, I carried out the same command as below (which is what I previously used when it was formatted as FAT32) and I get a permission error. Its driving me insane, I've tried chown'ing and chmod'ing till the cows come home and still nothing working.
Commands I'm using
$ ./adb shell shell@mo:/ $ cd dev/block/platform/dw_mmc/by-name shell@mo:/ $ su root@m0:/ # dd if=/dev/block/mmcblk0p12 of=/storage/sdcard1/userdata.img #error message is /storage/sdcard1/userdata.img: cannot open for write: Permission denied
chmod 777 /storage/sdcard1
and various other chowning, but still get the same issue. Am I doing something stupid (probably!) but any tips appreciated.
Relevant output of mount:
/dev/block/vold/179:17 /mnt/media_rw/sdcard1 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1 0 0 /dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
Output of ls -l in storage/
dr-xr-xr-x root root 2014-10-01 08:15 emulated lrwxrwxrwx root root 2014-10-01 08:15 sdcard0 -> /storage/emulated/legacy drwxrwxr-x root sdcard_rw 2014-10-01 08:13 sdcard1 drwxrwxr-x system system 2014-10-01 08:15 usbdisk0
Output of echo'ing foo to a text file
root@m0:/ # echo foo > /storage/sdcard1/foobar.txt sh: can't create /storage/sdcard1/foobar.txt: Permission denied